From 2851959dee2c5fc3a92e3288b433759764a0d2b0 Mon Sep 17 00:00:00 2001 From: Sebastien Lorquet Date: Mon, 12 Jun 2017 09:34:09 -0600 Subject: [PATCH 01/55] MTD M2PX: If we READ while a write/erase is pending, the command is ignored and the write/erase continues. If we dont catch this situation we will return garbage to the user because the flash will not execute the command. So READ MUST wait for write completion, and before that, the bus must be locked since it's a precondition to calling waitwritecomplete(). --- drivers/mtd/m25px.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/m25px.c b/drivers/mtd/m25px.c index 3b509eb6c5..bac7fdb7c9 100644 --- a/drivers/mtd/m25px.c +++ b/drivers/mtd/m25px.c @@ -798,6 +798,12 @@ static ssize_t m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes); + /* Lock the SPI bus NOW because the following call must be executed with + * the bus locked. + */ + + m25p_lock(priv->dev); + /* Wait for any preceding write to complete. We could simplify things by * perform this wait at the end of each write operation (rather than at * the beginning of ALL operations), but have the wait first will slightly @@ -806,12 +812,11 @@ static ssize_t m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, m25p_waitwritecomplete(priv); - /* Lock the SPI bus and select this FLASH part */ + /* Select this FLASH part */ - m25p_lock(priv->dev); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); - /* Send "Read from Memory " instruction */ + /* Send "Read from Memory" instruction */ (void)SPI_SEND(priv->dev, M25P_READ); @@ -829,6 +834,7 @@ static ssize_t m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); m25p_unlock(priv->dev); + finfo("return nbytes: %d\n", (int)nbytes); return nbytes; } From 0a85a41678b119dab362281ea96951c0b8c1936f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 12 Jun 2017 09:51:42 -0600 Subject: [PATCH 02/55] MTD FLASH driver: Clone Sebastien Lorquet's m25px change to at25, is25xp, ramtron, and sst25xx. --- drivers/mtd/at25.c | 9 +++++++-- drivers/mtd/is25xp.c | 10 ++++++++-- drivers/mtd/ramtron.c | 13 +++++++++---- drivers/mtd/sst25xx.c | 12 +++++++++--- drivers/mtd/w25.c | 1 + 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/at25.c b/drivers/mtd/at25.c index c499ca2a55..042734593d 100644 --- a/drivers/mtd/at25.c +++ b/drivers/mtd/at25.c @@ -524,6 +524,12 @@ static ssize_t at25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes); + /* Lock the SPI bus NOW because the following call must be executed with + * the bus locked. + */ + + at25_lock(priv->dev); + /* Wait for any preceding write to complete. We could simplify things by * perform this wait at the end of each write operation (rather than at * the beginning of ALL operations), but have the wait first will slightly @@ -532,9 +538,8 @@ static ssize_t at25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, at25_waitwritecomplete(priv); - /* Lock the SPI bus and select this FLASH part */ + /* Select this FLASH part */ - at25_lock(priv->dev); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); /* Send "Read from Memory " instruction */ diff --git a/drivers/mtd/is25xp.c b/drivers/mtd/is25xp.c index 1d663a42bd..5ea9e8ae1a 100644 --- a/drivers/mtd/is25xp.c +++ b/drivers/mtd/is25xp.c @@ -749,6 +749,12 @@ static ssize_t is25xp_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes); + /* Lock the SPI bus NOW because the following call must be executed with + * the bus locked. + */ + + is25xp_lock(priv->dev); + /* Wait for any preceding write to complete. We could simplify things by * perform this wait at the end of each write operation (rather than at * the beginning of ALL operations), but have the wait first will slightly @@ -760,9 +766,8 @@ static ssize_t is25xp_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte is25xp_waitwritecomplete(priv); } - /* Lock the SPI bus and select this FLASH part */ + /* Select this FLASH part */ - is25xp_lock(priv->dev); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); /* Send "Read from Memory " instruction */ @@ -783,6 +788,7 @@ static ssize_t is25xp_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte SPI_SELECT(priv->dev, SPIDEV_FLASH(0), false); is25xp_unlock(priv->dev); + finfo("return nbytes: %d\n", (int)nbytes); return nbytes; } diff --git a/drivers/mtd/ramtron.c b/drivers/mtd/ramtron.c index ee07d18e07..2216a475e5 100644 --- a/drivers/mtd/ramtron.c +++ b/drivers/mtd/ramtron.c @@ -532,8 +532,8 @@ static inline void ramtron_sendaddr(const struct ramtron_dev_s *priv, uint32_t a * Name: ramtron_pagewrite ************************************************************************************/ -static inline int ramtron_pagewrite(struct ramtron_dev_s *priv, FAR const uint8_t *buffer, - off_t page) +static inline int ramtron_pagewrite(struct ramtron_dev_s *priv, + FAR const uint8_t *buffer, off_t page) { off_t offset = page << priv->pageshift; @@ -663,6 +663,12 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes); + /* Lock the SPI bus NOW because the ramtron_waitwritecomplete call must be + * executed with the bus locked. + */ + + ramtron_lock(priv); + #ifndef CONFIG_RAMTRON_WRITEWAIT /* Wait for any preceding write to complete. We could simplify things by * perform this wait at the end of each write operation (rather than at @@ -673,9 +679,8 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt (void)ramtron_waitwritecomplete(priv); #endif - /* Lock the SPI bus and select this FLASH part */ + /* Select this FLASH part */ - ramtron_lock(priv); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); /* Send "Read from Memory " instruction */ diff --git a/drivers/mtd/sst25xx.c b/drivers/mtd/sst25xx.c index a6e71f12e1..efd5385916 100644 --- a/drivers/mtd/sst25xx.c +++ b/drivers/mtd/sst25xx.c @@ -680,7 +680,8 @@ static ssize_t sst25xx_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t /* On this device, we can handle the block read just like the byte-oriented read */ - nbytes = sst25xx_read(dev, startblock << priv->pageshift, nblocks << priv->pageshift, buffer); + nbytes = sst25xx_read(dev, startblock << priv->pageshift, + nblocks << priv->pageshift, buffer); if (nbytes > 0) { return nbytes >> priv->pageshift; @@ -727,6 +728,12 @@ static ssize_t sst25xx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes); + /* Lock the SPI bus NOW because the following conditional call to + * sst25xx_waitwritecomplete must be executed with the bus locked. + */ + + sst25xx_lock(priv->dev); + /* Wait for any preceding write to complete. We could simplify things by * perform this wait at the end of each write operation (rather than at * the beginning of ALL operations), but have the wait first will slightly @@ -738,9 +745,8 @@ static ssize_t sst25xx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt sst25xx_waitwritecomplete(priv); } - /* Lock the SPI bus and select this FLASH part */ + /* Select this FLASH part */ - sst25xx_lock(priv->dev); SPI_SELECT(priv->dev, SPIDEV_FLASH(0), true); /* Send "Read from Memory " instruction */ diff --git a/drivers/mtd/w25.c b/drivers/mtd/w25.c index 6bf757d3ef..9fc0d754a5 100644 --- a/drivers/mtd/w25.c +++ b/drivers/mtd/w25.c @@ -1070,6 +1070,7 @@ static ssize_t w25_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbl { nbytes >>= W25_SECTOR512_SHIFT; } + #else nbytes = w25_read(dev, startblock << W25_PAGE_SHIFT, nblocks << W25_PAGE_SHIFT, buffer); if (nbytes > 0) From 7903a8a46ca0a9eab10eb0fef20427fe48d69043 Mon Sep 17 00:00:00 2001 From: JM Date: Tue, 13 Jun 2017 06:01:13 -0600 Subject: [PATCH 03/55] stm32/stm32l4 PWM: While attempting to output a 70 MHz square wave from the timer output of a STM32 clocked at 140 MHz (which works fine in baremetal C), I stumbled on what I believe to be an error in arch/arm/src/stm32/stm32_pwm.c. Line 1304 we are told that reload = timclk / info->frequency; which I belive to be incorrect, it should be reload = timclk / info->frequency - 1; since starting to count from 0, if I want to output half of the TIM clock, I must count to 1 and not to 2. Surely enough, the original code did output 140/3=47 MHz, while this correction does allow the output up to 70 MHz. I am not sure this affects most users generating slow PWM (e.g. PX4) but for frequencies close to the PCLK, indeed the difference becomes significant. --- arch/arm/src/stm32/stm32_pwm.c | 2 +- arch/arm/src/stm32l4/stm32l4_pwm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 85ed3554fc..48640f9869 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -1300,7 +1300,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, timclk = priv->pclk / prescaler; - reload = timclk / info->frequency; + reload = timclk / info->frequency - 1; if (reload < 1) { reload = 1; diff --git a/arch/arm/src/stm32l4/stm32l4_pwm.c b/arch/arm/src/stm32l4/stm32l4_pwm.c index fe46e8cc4e..3c0c8dab18 100644 --- a/arch/arm/src/stm32l4/stm32l4_pwm.c +++ b/arch/arm/src/stm32l4/stm32l4_pwm.c @@ -841,7 +841,7 @@ static int stm32l4pwm_timer(FAR struct stm32l4_pwmtimer_s *priv, timclk = priv->pclk / prescaler; - reload = timclk / info->frequency; + reload = timclk / info->frequency - 1; if (reload < 1) { reload = 1; From e379491d138b3da52970b2a81df13ab85ebbdbc5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 13 Jun 2017 07:05:46 -0600 Subject: [PATCH 04/55] STM32/STM32L4: Review of last commit -- Eliminate possible underflow --- arch/arm/src/stm32/stm32_pwm.c | 8 ++++++-- arch/arm/src/stm32l4/stm32l4_pwm.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 48640f9869..8f66239a11 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -1300,8 +1300,8 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, timclk = priv->pclk / prescaler; - reload = timclk / info->frequency - 1; - if (reload < 1) + reload = timclk / info->frequency; + if (reload < 2) { reload = 1; } @@ -1309,6 +1309,10 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, { reload = 65535; } + else + { + reload--; + } pwminfo("TIM%u PCLK: %u frequency: %u TIMCLK: %u prescaler: %u reload: %u\n", priv->timid, priv->pclk, info->frequency, timclk, prescaler, reload); diff --git a/arch/arm/src/stm32l4/stm32l4_pwm.c b/arch/arm/src/stm32l4/stm32l4_pwm.c index 3c0c8dab18..71c4f1dad2 100644 --- a/arch/arm/src/stm32l4/stm32l4_pwm.c +++ b/arch/arm/src/stm32l4/stm32l4_pwm.c @@ -841,8 +841,8 @@ static int stm32l4pwm_timer(FAR struct stm32l4_pwmtimer_s *priv, timclk = priv->pclk / prescaler; - reload = timclk / info->frequency - 1; - if (reload < 1) + reload = timclk / info->frequency; + if (reload < 2) { reload = 1; } @@ -850,6 +850,10 @@ static int stm32l4pwm_timer(FAR struct stm32l4_pwmtimer_s *priv, { reload = 65535; } + else + { + reload--; + } pwminfo("TIM%u PCLK: %u frequency: %u TIMCLK: %u prescaler: %u reload: %u\n", priv->timid, priv->pclk, info->frequency, timclk, prescaler, reload); From 2596b14c90e168ce4c727e8642ae20bf5a88f2b4 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Tue, 13 Jun 2017 07:33:34 -0600 Subject: [PATCH 05/55] mtd/w25: add missing locking and fix SPI_SELECT usage for w25_unprotect --- drivers/mtd/w25.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/w25.c b/drivers/mtd/w25.c index 9fc0d754a5..0648306ec8 100644 --- a/drivers/mtd/w25.c +++ b/drivers/mtd/w25.c @@ -440,19 +440,16 @@ static inline int w25_readid(struct w25_dev_s *priv) #ifndef CONFIG_W25_READONLY static void w25_unprotect(FAR struct w25_dev_s *priv) { - /* Select this FLASH part */ + /* Lock and configure the SPI bus */ - SPI_SELECT(priv->spi, SPIDEV_FLASH(0), true); + w25_lock(priv->spi); /* Send "Write enable (WREN)" */ w25_wren(priv); - /* Re-select this FLASH part (This might not be necessary... but is it shown in - * the SST25 timing diagrams from which this code was leveraged.) - */ + /* Select this FLASH part */ - SPI_SELECT(priv->spi, SPIDEV_FLASH(0), false); SPI_SELECT(priv->spi, SPIDEV_FLASH(0), true); /* Send "Write enable status (EWSR)" */ @@ -463,6 +460,11 @@ static void w25_unprotect(FAR struct w25_dev_s *priv) SPI_SEND(priv->spi, 0); SPI_SEND(priv->spi, 0); + + /* Deselect the FLASH and unlock the bus */ + + SPI_SELECT(priv->spi, SPIDEV_FLASH(0), false); + w25_unlock(priv->spi); } #endif From 7b8df1b930295094932a77657509022b0d980be1 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Tue, 13 Jun 2017 07:35:49 -0600 Subject: [PATCH 06/55] mtd/w25: wait for BUSY flag to clear in w25_readid and w25_unprotect. W25Q128 datasheet says that all instructions expect 'Read Status Register' and 'Erase/Program Suspend' are ignored when BUSY flag in status register is '1'. Therefore wait for busy flag to clear in w25_readid() and w25_unprotect(). --- drivers/mtd/w25.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/w25.c b/drivers/mtd/w25.c index 0648306ec8..25f263f0ac 100644 --- a/drivers/mtd/w25.c +++ b/drivers/mtd/w25.c @@ -337,9 +337,16 @@ static inline int w25_readid(struct w25_dev_s *priv) finfo("priv: %p\n", priv); - /* Lock the SPI bus, configure the bus, and select this FLASH part. */ + /* Lock and configure the SPI bus */ w25_lock(priv->spi); + + /* Wait for any preceding write or erase operation to complete. */ + + (void)w25_waitwritecomplete(priv); + + /* Select this FLASH part. */ + SPI_SELECT(priv->spi, SPIDEV_FLASH(0), true); /* Send the "Read ID (RDID)" command and read the first three ID bytes */ @@ -444,6 +451,10 @@ static void w25_unprotect(FAR struct w25_dev_s *priv) w25_lock(priv->spi); + /* Wait for any preceding write or erase operation to complete. */ + + (void)w25_waitwritecomplete(priv); + /* Send "Write enable (WREN)" */ w25_wren(priv); @@ -476,7 +487,11 @@ static uint8_t w25_waitwritecomplete(struct w25_dev_s *priv) { uint8_t status; - /* Loop as long as the memory is busy with a write cycle */ + /* Loop as long as the memory is busy with a write cycle. Device sets BUSY + * flag to a 1 state whhen previous write or erase command is still executing + * and during this time, device will ignore further instructions except for + * "Read Status Register" and "Erase/Program Suspend" instructions. + */ do { From 48fb789cf340e0b0c99006c0024ed6e29b067615 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Sat, 10 Jun 2017 06:12:37 -1000 Subject: [PATCH 07/55] testbuild:Added -x to fail build on errors for CI On CI we want to know ASAP of a failure. This adds the -x (exit on build failures) option to faclitate that behavior. Use ${MAKE} ${MAKE_FLAGS} for make invocation. When -x is provided change MAKE_FLAGS to --silent --no-print-directory and set -e Ignore exit status when using grep for checking for CONFIG_NXWM=y --- tools/testbuild.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/testbuild.sh b/tools/testbuild.sh index 7e67b06137..a625f3d8a8 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -43,6 +43,8 @@ wenv=cygwin sizet=uint APPSDIR=../apps NXWDIR=../NxWidgets +MAKE_FLAGS=-i +MAKE=make unset testfile function showusage { @@ -58,6 +60,7 @@ function showusage { echo " -a provides the relative path to the apps/ directory. Default ../apps" echo " -n provides the relative path to the NxWidgets/ directory. Default ../NxWidgets" echo " -d enables script debug output" + echo " -x exit on build failures" echo " -h will show this help test and terminate" echo " selects the list of configurations to test. No default" echo "" @@ -96,6 +99,10 @@ while [ ! -z "$1" ]; do host=windows sizet=long ;; + -x ) + MAKE_FLAGS='--silent --no-print-directory' + set -e + ;; -a ) shift APPSDIR="$1" @@ -142,7 +149,7 @@ function distclean { cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } if [ -f .config ]; then echo " Cleaning..." - make distclean 1>/dev/null + ${MAKE} ${MAKE_FLAGS} distclean 1>/dev/null fi } @@ -225,7 +232,7 @@ function configure { echo " Refreshing..." cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } - make olddefconfig 1>/dev/null 2>&1 + ${MAKE} ${MAKE_FLAGS} olddefconfig 1>/dev/null 2>&1 } # Build the NxWidgets libraries @@ -237,7 +244,7 @@ function nxbuild { unset nxconfig if [ -d $NXWDIR ]; then - nxconfig=`grep CONFIG_NXWM=y $nuttx/.config` + nxconfig=`grep CONFIG_NXWM=y $nuttx/.config` || true fi if [ ! -z "$nxconfig" ]; then @@ -247,18 +254,18 @@ function nxbuild { cd $nuttx/$NXTOOLS || { echo "Failed to CD to $NXTOOLS"; exit 1; } ./install.sh $nuttx/$APPSDIR nxwm 1>/dev/null - make -C $nuttx/$APPSDIR/external TOPDIR=$nuttx APPDIR=$nuttx/$APPSDIR TOPDIR=$nuttx clean 1>/dev/null + ${MAKE} ${MAKE_FLAGS} -C $nuttx/$APPSDIR/external TOPDIR=$nuttx APPDIR=$nuttx/$APPSDIR TOPDIR=$nuttx clean 1>/dev/null cd $nuttx || { echo "Failed to CD to $nuttx"; exit 1; } - make -i context 1>/dev/null + ${MAKE} ${MAKE_FLAGS} context 1>/dev/null cd $nuttx/$NXWIDGETSDIR || { echo "Failed to CD to $NXWIDGETSDIR"; exit 1; } - make -i TOPDIR=$nuttx clean 1>/dev/null - make -i TOPDIR=$nuttx 1>/dev/null + ${MAKE} ${MAKE_FLAGS} TOPDIR=$nuttx clean 1>/dev/null + ${MAKE} ${MAKE_FLAGS} TOPDIR=$nuttx 1>/dev/null cd $nuttx/$NXWMDIR || { echo "Failed to CD to $NXWMDIR"; exit 1; } - make -i TOPDIR=$nuttx clean 1>/dev/null - make -i TOPDIR=$nuttx 1>/dev/null + ${MAKE} ${MAKE_FLAGS} TOPDIR=$nuttx clean 1>/dev/null + ${MAKE} ${MAKE_FLAGS} TOPDIR=$nuttx 1>/dev/null fi } @@ -268,7 +275,7 @@ function build { cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } echo " Building NuttX..." echo "------------------------------------------------------------------------------------" - make -i 1>/dev/null + ${MAKE} ${MAKE_FLAGS} 1>/dev/null } # Coordinate the steps for the next build test From 466fccc494a9bd48111d549a1f4caf6ccb1d0a70 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 13 Jun 2017 17:39:38 -0600 Subject: [PATCH 08/55] NSH Documentation: A justification for 3 ENTERs when using USB serial console. --- Documentation/NuttShell.html | 103 ++++++++++++++++++++++------------- 1 file changed, 65 insertions(+), 38 deletions(-) diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html index 5ee579995f..dae6f3019f 100644 --- a/Documentation/NuttShell.html +++ b/Documentation/NuttShell.html @@ -8,7 +8,7 @@

NuttShell (NSH)

-

Last Updated: June 6, 2017

+

Last Updated: June 13, 2017

@@ -305,7 +305,7 @@
- 2.37 Create a FAT Filesystem (mkfatfs) + 2.37 Create a FAT File System (mkfatfs) @@ -335,7 +335,7 @@
- 2.42 Mount an NFS file system (nfsmount) + 2.42 Mount an NFS File System (nfsmount) @@ -619,9 +619,35 @@ NuttShell (NSH) nsh> - The greating may also include NuttX versioning information if you are using a versioned copy of NuttX. + The greeting may also include NuttX versioning information if you are using a versioned copy of NuttX. nsh> is the NSH prompt and indicates that you may enter a command from the console.

+

+ USB console startup. + When using a USB console, the start-up sequence differs a little: In this case, you are required to press ENTER three times. Then NSH prompt will appear as described above. + This is required for the following reasons: +

+
    +
  1. + This assures that the USB connection is stable. + The USB connection may be made, broken, and re-established a few times if the USB cable is not yet fully seated. + Waiting for ENTER to be pressed three times assures that the connection is stable. +
  2. +
  3. + The establishment of the connection is two step process: First, the USB serial connection is made with the host PC. Then the application that uses the serial interface is started on the host. + When the serial connection is established on the host, the host operating system may send several AT modem commands to the host depending upon how the host serial port is configured. + By waiting for ENTER to be pressed three consecutive times, all of these modem commands will go to the bit-bucket and will not be interpreted as NSH command input. +
  4. +
  5. + Similarly, in the second step when the applications is started, there may be additional AT modem commands sent out the serial port. + Most serial terminal programs will do this unless they are specifically configured to suppress the modem command output. + Waiting for the ENTER input eliminates the invalid command errors from both (2) and (3). +
  6. +
  7. + Finally, if NSH did not wait for some positive indication that the serial terminal program is up and running, then the output of the NSH greeting and initial NSH prompt would be lost. +
  8. +
+

Extended Command Line Editing. By default, NuttX uses a simple command line editor that allows command entry after the nsh> and supports only the backspace key for editing. @@ -752,7 +778,7 @@ nsh> <file> is the full or relative path to any writable object - in the filesystem name space (file or character driver). + in the file system name space (file or character driver). Such objects will be referred to simply as files throughout this document. @@ -968,7 +994,7 @@ done

  • NSH will create a read-only RAM disk (a ROM disk), containing a tiny - ROMFS filesystem containing the following: + ROMFS file system containing the following:
       `--init.d/
            `-- rcS
      @@ -976,7 +1002,7 @@ done
             Where rcS is the NSH start-up script.
           
           
    • - NSH will then mount the ROMFS filesystem at /etc, resulting in: + NSH will then mount the ROMFS file system at /etc, resulting in:
         |--dev/
         |   `-- ram0
        @@ -1352,7 +1378,7 @@ cp <source-path> <dest-path>
         

        Synopsis. Copy of the contents of the file at <source-path> to the location - in the filesystem indicated by <dest-path>. + in the file system indicated by <dest-path>.

        @@ -1726,7 +1752,7 @@ ifconfig [nic_name [<ip-address>|dhcp]] [dr|gw|gateway <dr-address>]
      • With one or no arguments, ifconfig will shows the - current configuration of the network and, perhaps, the status of ethernet + current configuration of the network and, perhaps, the status of Ethernet device:

          @@ -1749,7 +1775,7 @@ eth0    HWaddr 00:18:11:80:10:06
             
        • If both the network interface name and an IP address are supplied as arguments, - then ifconfig will set the address of the ethernet device: + then ifconfig will set the address of the Ethernet device:

             ifconfig nic_name ip_address
            @@ -1970,7 +1996,7 @@ ln [-s] <target> <link>
               This implementation is simplified for use with NuttX in these ways:
             

              -
            • Links may be created only within the NuttX top-level, pseudo filesystem. +
            • Links may be created only within the NuttX top-level, pseudo file system. No file system currently supported by NuttX provides symbolic links.
            • For the same reason, only soft links are implemented.
            • File privileges are ignored.
            • @@ -1992,7 +2018,7 @@ ls [-lRs] <dir-path>

              Synopsis. Show the contents of the directory at <dir-path>. NOTE: - <dir-path> must refer to a directory and no other filesystem + <dir-path> must refer to a directory and no other file system object.

              Options:

              @@ -2172,10 +2198,10 @@ mkdir <path>

              Limited to Mounted File Systems. - Recall that NuttX uses a pseudo filesystem for its root file + Recall that NuttX uses a pseudo file system for its root file system. The mkdir command can only be used to create directories in volumes set up with the - mount command; it cannot be used to create directories in the pseudo filesystem. + mount command; it cannot be used to create directories in the pseudo file system.

              Example:

                @@ -2190,7 +2216,7 @@ nsh>
                 
      • -

        2.37 Create a FAT Filesystem (mkfatfs)

        +

        2.37 Create a FAT File System (mkfatfs)

        @@ -2208,7 +2234,7 @@ mkfatfs [-F <fatsize>] <block-driver>

        NSH provides this command to access the mkfatfs() NuttX API. - This block device must reside in the NuttX pseudo filesystem and + This block device must reside in the NuttX pseudo file system and must have been created by some call to register_blockdriver() (see include/nuttx/fs/fs.h).

        @@ -2323,22 +2349,22 @@ mount -t <fstype> [-o <options>] <block-device> <dir- mount performs a three way association, binding:

          -
        1. File system. +
        2. File System. The '-t <fstype>' option identifies the type of file system that has been formatted on the <block-device>. As of this writing, vfat is the only supported value for <fstype>
        3. Block Device. The <block-device> argument is the full or relative - path to a block driver inode in the pseudo filesystem. + path to a block driver inode in the pseudo file system. By convention, this is a name under the /dev sub-directory. This <block-device> must have been previously formatted with the same file system type as specified by <fstype>
        4. Mount Point. The mount point, <dir-path>, is the location in the - pseudo filesystem where the mounted volume will appear. - This mount point can only reside in the NuttX pseudo filesystem. + pseudo file system where the mounted volume will appear. + This mount point can only reside in the NuttX pseudo file system. By convention, this mount point is a subdirectory under /mnt. The mount command will create whatever pseudo directories that may be needed to complete the full path but the full path must not already exist. @@ -2346,7 +2372,7 @@ mount -t <fstype> [-o <options>] <block-device> <dir-

        After the volume has been mounted in the NuttX - pseudo filesystem, + pseudo file system, it may be access in the same way as other objects in the file system.

        Examples:

        @@ -2395,7 +2421,7 @@ mv <old-path> <new-path>

        Synopsis. Rename the file object at <old-path> to <new-path>. - Both paths must reside in the same mounted filesystem. + Both paths must reside in the same mounted file system.

        @@ -2628,11 +2654,11 @@ rm <file-path>

        Synopsis. Remove the specified <file-path> name from the mounted file system. - Recall that NuttX uses a pseudo filesystem for its root file + Recall that NuttX uses a pseudo file system for its root file system. The rm command can only be used to remove (unlink) files in volumes set up with the mount command; - it cannot be used to remove names in the pseudo filesystem. + it cannot be used to remove names in the pseudo file system.

        Example:

          @@ -2662,11 +2688,11 @@ rmdir <dir-path>
           

          Synopsis. Remove the specified <dir-path> directory from the mounted file system. - Recall that NuttX uses a pseudo filesystem for its root file + Recall that NuttX uses a pseudo file system for its root file system. The rmdir command can only be used to remove directories from volumes set up with the mount command; - it cannot be used to remove directories from the pseudo filesystem. + it cannot be used to remove directories from the pseudo file system.

          Example:

            @@ -3563,11 +3589,11 @@ nsh>
               creation of files for the correct operation of the put command.
            3 CONFIG_FS_READABLE is not a user configuration but is set automatically - if any readable filesystem is selected. At present, this is either CONFIG_FS_FAT + if any readable file system is selected. At present, this is either CONFIG_FS_FAT or CONFIG_FS_ROMFS.
            4 CONFIG_FS_WRITABLE is not a user configuration but is set automatically - if any writable filesystem is selected. At present, this is only CONFIG_FS_FAT.
            + if any writable file system is selected. At present, this is only CONFIG_FS_FAT.
            5 Verbose help output can be suppressed by defining CONFIG_NSH_HELP_TERSE. In that case, the help command is still available but will be slightly smaller. @@ -3625,7 +3651,7 @@ nsh>
        @@ -3698,7 +3724,7 @@ set FOOBAR ABC_${FOO}_${BAR} @@ -3746,7 +3772,7 @@ set FOOBAR ABC_${FOO}_${BAR} @@ -4248,7 +4274,7 @@ mount -t vfat /dev/ram1 /tmp

      • - Mount the FAT filesystem at a configured mountpoint, /tmp. + Mount the FAT file system at a configured mountpoint, /tmp.

        @@ -4666,7 +4692,7 @@ CONFIG_SCHED_WAITPID=y

        You replace the sample code at apps/examples/nsh/nsh_main.c with whatever start-up logic that you want. NSH is a library at apps/nshlib. - apps.examplex/nsh is just a tiny, example start-up function (CONFIG_USER_ENTRYPOINT()) that that runs immediately and illustrates how to start NSH + apps.examples/nsh is just a tiny, example start-up function (CONFIG_USER_ENTRYPOINT()) that that runs immediately and illustrates how to start NSH If you want something else to run immediately then you can write your write your own custom CONFIG_USER_ENTRYPOINT() function and then start other tasks from your custom CONFIG_USER_ENTRYPOINT().

      • @@ -4723,7 +4749,7 @@ CONFIG_SCHED_WAITPID=y
        • - NSH will create a read-only RAM disk (a ROM disk), containing a tiny ROMFS filesystem containing the following: + NSH will create a read-only RAM disk (a ROM disk), containing a tiny ROMFS file system containing the following:

             `--init.d/
            @@ -4734,7 +4760,7 @@ CONFIG_SCHED_WAITPID=y
                 

          • - NSH will then mount the ROMFS filesystem at /etc, resulting in: + NSH will then mount the ROMFS file system at /etc, resulting in:

               |--dev/
              @@ -4841,7 +4867,7 @@ mount -t vfat /dev/ram1 /tmp
                   

              To generate a custom rcS file a copy of rcS.template needs to be placed at tools/ and changed according to the desired start-up behaviour. - Running tools/mkromfsimg.h creates nsh_romfsimg.h which needs to be copied to apps/nhslib OR if CONFIG_NSH_ARCHROMFS is defined to configs/<board>/include. + Running tools/mkromfsimg.h creates nsh_romfsimg.h which needs to be copied to apps/nshlib OR if CONFIG_NSH_ARCHROMFS is defined to configs/<board>/include.

              @@ -5343,10 +5369,10 @@ xxd -i romfs_img >nsh_romfsimg.h
            • mkrd
            • mkromfsimg.sh
            • mount
            • +
            • mv
      • CONFIG_NSH_FILEIOSIZE Size of a static I/O buffer used for file access (ignored if - there is no filesystem). Default is 1024. + there is no file system). Default is 1024.
        CONFIG_NSH_NESTDEPTH The maximum number of nested if-then[-else]-fi sequences that - are permissable. Default: 3 + are permissible. Default: 3
        CONFIG_NSH_ROMFSETC - Mount a ROMFS filesystem at /etc and provide a startup script + Mount a ROMFS file system at /etc and provide a startup script at /etc/init.d/rcS. The default startup script will mount a FAT FS RAMDISK at /tmp but the logic is easily extensible. @@ -3975,7 +4001,7 @@ set FOOBAR ABC_${FOO}_${BAR}
        CONFIG_NSH_NOMAC - Set if your ethernet hardware has no built-in MAC address. + Set if your Ethernet hardware has no built-in MAC address. If set, a bogus MAC will be assigned.
          -
        • mv
        • nfsmount
        • nice
        • NSH library (nshlib)
        • @@ -5403,6 +5429,7 @@ xxd -i romfs_img >nsh_romfsimg.h
        • up_cxxinitialize()
        • urldecode
        • urlencode
        • +
        • USB console startup
        • useradd
        • userdel
        • usleep
        • From de3695d32ba6c6ae089e31d679b3d6d61135fad4 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 8 Jun 2017 12:14:51 -1000 Subject: [PATCH 09/55] kinetis:lpserial fixed header inclusion --- arch/arm/src/kinetis/kinetis_lpserial.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/src/kinetis/kinetis_lpserial.c b/arch/arm/src/kinetis/kinetis_lpserial.c index 5c0c336237..262bda4a8a 100644 --- a/arch/arm/src/kinetis/kinetis_lpserial.c +++ b/arch/arm/src/kinetis/kinetis_lpserial.c @@ -63,11 +63,9 @@ #include "up_arch.h" #include "up_internal.h" -#include "kinetis_config.h" -#include "chip.h" +#include "kinetis.h" #include "chip/kinetis_lpuart.h" #include "chip/kinetis_pinmux.h" -#include "kinetis.h" /**************************************************************************** * Pre-processor Definitions From b2d929e40a9163b2384d85084c5e2137831979b3 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 8 Jun 2017 16:30:48 -1000 Subject: [PATCH 10/55] Kinetis:SPI driver --- arch/arm/src/kinetis/Make.defs | 4 + arch/arm/src/kinetis/chip/kinetis_dspi.h | 6 +- arch/arm/src/kinetis/kinetis_spi.c | 1242 ++++++++++++++++++++++ 3 files changed, 1251 insertions(+), 1 deletion(-) create mode 100644 arch/arm/src/kinetis/kinetis_spi.c diff --git a/arch/arm/src/kinetis/Make.defs b/arch/arm/src/kinetis/Make.defs index 8ec4063b6d..4d9907907e 100644 --- a/arch/arm/src/kinetis/Make.defs +++ b/arch/arm/src/kinetis/Make.defs @@ -140,6 +140,10 @@ ifeq ($(CONFIG_KINETIS_SDHC),y) CHIP_CSRCS += kinetis_sdhc.c endif +ifeq ($(CONFIG_SPI),y) +CHIP_CSRCS += kinetis_spi.c +endif + ifeq ($(CONFIG_USBDEV),y) CHIP_CSRCS += kinetis_usbdev.c endif diff --git a/arch/arm/src/kinetis/chip/kinetis_dspi.h b/arch/arm/src/kinetis/chip/kinetis_dspi.h index e41674494f..897e766cfc 100644 --- a/arch/arm/src/kinetis/chip/kinetis_dspi.h +++ b/arch/arm/src/kinetis/chip/kinetis_dspi.h @@ -140,7 +140,7 @@ #define SPI_MCR_PCSIS_SHIFT (16) /* Bits 16-21: Peripheral Chip Select x Inactive State */ #define SPI_MCR_PCSIS_MASK (0x3f << SPI_MCR_PCSIS_SHIFT) # define SPI_MCR_PCSIS_CS(n) ((1 << (n)) << SPI_MCR_PCSIS_SHIFT) - /* Bits 22–23: Reserved */ + /* Bits 22-23: Reserved */ #define SPI_MCR_ROOE (1 << 24) /* Bit 24: Receive FIFO Overflow Overwrite Enable */ #define SPI_MCR_PCSSE (1 << 25) /* Bit 25: Peripheral Chip Select Strobe Enable */ #define SPI_MCR_MTFE (1 << 26) /* Bit 26: Modified Timing Format Enable */ @@ -165,6 +165,7 @@ #define SPI_CTARM_BR_SHIFT (0) /* Bits 0-3: Baud Rate Scaler */ #define SPI_CTARM_BR_MASK (15 << SPI_CTARM_BR_SHIFT) +# define SPI_CTARM_BR(n) ((((n) & 0xf)) << SPI_CTARM_BR_SHIFT) # define SPI_CTARM_BR_2 (0 << SPI_CTARM_BR_SHIFT) # define SPI_CTARM_BR_4 (1 << SPI_CTARM_BR_SHIFT) # define SPI_CTARM_BR_6 (2 << SPI_CTARM_BR_SHIFT) @@ -205,6 +206,7 @@ # define SPI_CTARM_CSSCK_65536 (15 << SPI_CTARM_CSSCK_SHIFT) #define SPI_CTARM_PBR_SHIFT (16) /* Bits 16-17: Baud Rate Prescaler */ #define SPI_CTARM_PBR_MASK (3 << SPI_CTARM_PBR_SHIFT) +# define SPI_CTARM_PBR(n) (((n) & 0x3) << SPI_CTARM_PBR_SHIFT) # define SPI_CTARM_PBR_2 (0 << SPI_CTARM_PBR_SHIFT) # define SPI_CTARM_PBR_3 (1 << SPI_CTARM_PBR_SHIFT) # define SPI_CTARM_PBR_5 (2 << SPI_CTARM_PBR_SHIFT) @@ -231,6 +233,7 @@ /* Bits 25-26: See common bits above */ #define SPI_CTARM_FMSZ_SHIFT (27) /* Bits 27-30: Frame Size */ #define SPI_CTARM_FMSZ_MASK (15 << SPI_CTARM_FMSZ_SHIFT) +#define SPI_CTARM_FMSZ(n) ((((n) & 0xf)) << SPI_CTARM_FMSZ_SHIFT) #define SPI_CTARM_DBR (1 << 31) /* Bit 31: Double Baud Rate */ /* DSPI Clock and Transfer Attributes Register (Slave Mode) */ @@ -281,6 +284,7 @@ #define SPI_PUSHR_TXDATA_SHIFT (0) /* Bits 0-15: Transmit Data */ #define SPI_PUSHR_TXDATA_MASK (0xffff << SPI_PUSHR_TXDATA_SHIFT) +# define SPI_PUSHR_TXDATA(d) (((d) & 0xffff) << SPI_PUSHR_TXDATA_SHIFT) #define SPI_PUSHR_PCS_SHIFT (16) /* Bits 16-21: Select PCS signals to assert */ #define SPI_PUSHR_PCS_MASK (0x3f << SPI_PUSHR_PCS_SHIFT) # define SPI_PUSHR_PCS(n) ((1 << (n)) << SPI_PUSHR_PCS_SHIFT) diff --git a/arch/arm/src/kinetis/kinetis_spi.c b/arch/arm/src/kinetis/kinetis_spi.c new file mode 100644 index 0000000000..1c25bc9754 --- /dev/null +++ b/arch/arm/src/kinetis/kinetis_spi.c @@ -0,0 +1,1242 @@ +/************************************************************************************ + * arch/arm/src/kinetis/kinetis_spi.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Authors: Gregory Nutt + * David Sidrane + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************************/ + +/************************************************************************************ + * The external functions, kinetis_spi0/1/2select and kinetis_spi0/1/26status + * must be provided by board-specific logic. They are implementations of + * the select and status methods of the SPI interface defined by structure + * spi_ops_s (see include/nuttx/spi/spi.h). All other methods + * (including kinetis_spibus_initialize()) are provided by common Kinetis + * logic. + * To use this common SPI logic on your board: + * + * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip + * select pins. + * 2. Provide kinetis_spi[n]select() and kinetis_spi[n]status() functions + * in your board-specific logic. These functions will perform chip + * selection and status operations using GPIOs in the way your board is + * configured. + * 3. Add a calls to kinetis_spibus_initialize() in your low level + * application initialization logic. + * 4. The handle returned by kinetis_spibus_initialize() may then be used to + * bind the SPI driver to higher level logic (e.g., calling + * mmcsd_spislotinitialize(), for example, will bind the SPI driver to + * the SPI MMC/SD driver). + * + ************************************************************************************/ + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "up_arch.h" + +#include "kinetis.h" +#include "kinetis_spi.h" +#include "chip/kinetis_memorymap.h" +#include "chip/kinetis_sim.h" +#include "chip/kinetis_dspi.h" +#include "chip/kinetis_pinmux.h" + +#if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ + defined(CONFIG_KINETIS_SPI2) + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +#define KINETIS_SPI_CLK_MAX (BOARD_BUS_FREQ / 2) +#define KINETIS_SPI_CLK_INIT 400000 + +/************************************************************************************ + * Private Types + ************************************************************************************/ + +struct kinetis_spidev_s +{ + struct spi_dev_s spidev; /* Externally visible part of the SPI interface */ + uint32_t spibase; /* Base address of SPI registers */ + sem_t exclsem; /* Held while chip is selected for mutual exclusion */ + uint32_t frequency; /* Requested clock frequency */ + uint32_t actual; /* Actual clock frequency */ + uint8_t nbits; /* Width of word in bits (8 to 16) */ + uint8_t mode; /* Mode 0,1,2,3 */ + uint8_t ctarsel; /* Which CTAR */ +}; + +/************************************************************************************ + * Private Function Prototypes + ************************************************************************************/ + +/* Helpers */ + +static inline uint32_t spi_getreg(FAR struct kinetis_spidev_s *priv, uint8_t offset); +static inline void spi_putreg(FAR struct kinetis_spidev_s *priv, uint8_t offset, + uint32_t value); +static inline uint16_t spi_getreg16(FAR struct kinetis_spidev_s *priv, uint8_t offset); +static inline void spi_putreg16(FAR struct kinetis_spidev_s *priv, uint8_t offset, + uint16_t value); +static inline uint8_t spi_getreg8(FAR struct kinetis_spidev_s *priv, uint8_t offset); +static inline void spi_putreg8(FAR struct kinetis_spidev_s *priv, uint8_t offset, + uint8_t value); +static inline uint16_t spi_readword(FAR struct kinetis_spidev_s *priv); +static inline void spi_writeword(FAR struct kinetis_spidev_s *priv, + uint16_t word); + +static inline void spi_run(FAR struct kinetis_spidev_s *priv, bool enable); +static inline void spi_write_control(FAR struct kinetis_spidev_s *priv, + uint32_t control); +static inline void spi_write_status(FAR struct kinetis_spidev_s *priv, + uint32_t status); +static inline void spi_wait_status(FAR struct kinetis_spidev_s *priv, + uint32_t status); +static uint16_t spi_send_data(FAR struct kinetis_spidev_s *priv, uint16_t wd, + bool last); + +/* SPI methods */ + +static int spi_lock(FAR struct spi_dev_s *dev, bool lock); +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency); +static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode); +static void spi_setbits(FAR struct spi_dev_s *dev, int nbits); +#ifdef CONFIG_SPI_HWFEATURES +static int spi_hwfeatures(FAR struct spi_dev_s *dev, + spi_hwfeatures_t features); +#endif +static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd); +static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, + FAR void *rxbuffer, size_t nwords); +#ifndef CONFIG_SPI_EXCHANGE +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *txbuffer, + size_t nwords); +static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer, + size_t nwords); +#endif + +/************************************************************************************ + * Private Data + ************************************************************************************/ + +#ifdef CONFIG_KINETIS_SPI0 +static const struct spi_ops_s g_spi0ops = +{ + .lock = spi_lock, + .select = kinetis_spi0select, + .setfrequency = spi_setfrequency, + .setmode = spi_setmode, + .setbits = spi_setbits, +# ifdef CONFIG_SPI_HWFEATURES + .hwfeatures = spi_hwfeatures, +# endif + .status = kinetis_spi0status, +# ifdef CONFIG_SPI_CMDDATA + .cmddata = kinetis_spi0cmddata, +# endif + .send = spi_send, +# ifdef CONFIG_SPI_EXCHANGE + .exchange = spi_exchange, +# else + .sndblock = spi_sndblock, + .recvblock = spi_recvblock, +# endif +# ifdef CONFIG_SPI_CALLBACK + .registercallback = kinetis_spi0register, /* provided externally */ +# else + .registercallback = 0, /* not implemented */ +# endif +}; + +static struct kinetis_spidev_s g_spi0dev = +{ + .spidev = + { + &g_spi0ops + }, + .spibase = KINETIS_SPI0_BASE, + .ctarsel = KINETIS_SPI_CTAR0_OFFSET, +}; +#endif + +#ifdef CONFIG_KINETIS_SPI1 +static const struct spi_ops_s g_spi1ops = +{ + .lock = spi_lock, + .select = kinetis_spi1select, + .setfrequency = spi_setfrequency, + .setmode = spi_setmode, + .setbits = spi_setbits, +# ifdef CONFIG_SPI_HWFEATURES + .hwfeatures = spi_hwfeatures, +# endif + .status = kinetis_spi1status, +# ifdef CONFIG_SPI_CMDDATA + .cmddata = kinetis_spi1cmddata, +# endif + .send = spi_send, +# ifdef CONFIG_SPI_EXCHANGE + .exchange = spi_exchange, +# else + .sndblock = spi_sndblock, + .recvblock = spi_recvblock, +# endif +# ifdef CONFIG_SPI_CALLBACK + .registercallback = kinetis_spi1register, /* provided externally */ +# else + .registercallback = 0, /* not implemented */ +# endif +}; + +static struct kinetis_spidev_s g_spi1dev = +{ + .spidev = + { + &g_spi1ops + }, + .spibase = KINETIS_SPI1_BASE, + .ctarsel = KINETIS_SPI_CTAR0_OFFSET, +}; +#endif + +#ifdef CONFIG_KINETIS_SPI2 +static const struct spi_ops_s g_spi2ops = +{ + .lock = spi_lock, + .select = kinetis_spi2select, + .setfrequency = spi_setfrequency, + .setmode = spi_setmode, + .setbits = spi_setbits, +# ifdef CONFIG_SPI_HWFEATURES + .hwfeatures = spi_hwfeatures, +# endif + .status = kinetis_spi2status, +# ifdef CONFIG_SPI_CMDDATA + .cmddata = kinetis_spi2cmddata, +# endif + .send = spi_send, +# ifdef CONFIG_SPI_EXCHANGE + .exchange = spi_exchange, +# else + .sndblock = spi_sndblock, + .recvblock = spi_recvblock, +# endif +# ifdef CONFIG_SPI_CALLBACK + .registercallback = kinetis_spi2register, /* provided externally */ +# else + .registercallback = 0, /* not implemented */ +# endif +}; + +static struct kinetis_spidev_s g_spi2dev = +{ + .spidev = + { + &g_spi2ops + }, + .spibase = KINETIS_SPI2_BASE, + .ctarsel = KINETIS_SPI_CTAR0_OFFSET, +}; +#endif + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: spi_getreg + * + * Description: + * Get the 32-bit contents of the SPI register at offset + * + * Input Parameters: + * priv - private SPI device structure + * offset - offset to the register of interest + * + * Returned Value: + * The contents of the 32-bit register + * + ************************************************************************************/ + +static inline uint32_t spi_getreg(FAR struct kinetis_spidev_s *priv, uint8_t offset) +{ + return getreg32(priv->spibase + offset); +} + +/************************************************************************************ + * Name: spi_putreg + * + * Description: + * Write a 32-bit value to the SPI register at offset + * + * Input Parameters: + * priv - private SPI device structure + * offset - offset to the register of interest + * value - the 32-bit value to be written + * + * Returned Value: + * Nothing + * + ************************************************************************************/ + +static inline void spi_putreg(FAR struct kinetis_spidev_s *priv, uint8_t offset, + uint32_t value) +{ + putreg32(value, priv->spibase + offset); +} + +/************************************************************************************ + * Name: spi_getreg16 + * + * Description: + * Get the 16 bit contents of the SPI register at offset + * + * Input Parameters: + * priv - private SPI device structure + * offset - offset to the register of interest + * + * Returned Value: + * The contents of the 16-bit register + * + ************************************************************************************/ + +static inline uint16_t spi_getreg16(FAR struct kinetis_spidev_s *priv, uint8_t offset) +{ + return getreg16(priv->spibase + offset); +} + +/************************************************************************************ + * Name: spi_putreg16 + * + * Description: + * Write a 16-bit value to the SPI register at offset + * + * Input Parameters: + * priv - private SPI device structure + * offset - offset to the register of interest + * value - the 16-bit value to be written + * + * Returned Value: + * Nothing + * + ************************************************************************************/ + +static inline void spi_putreg16(FAR struct kinetis_spidev_s *priv, uint8_t offset, + uint16_t value) +{ + putreg16(value, priv->spibase + offset); +} + +/************************************************************************************ + * Name: spi_getreg8 + * + * Description: + * Get the 8 bit contents of the SPI register at offset + * + * Input Parameters: + * priv - private SPI device structure + * offset - offset to the register of interest + * + * Returned Value: + * The contents of the 8-bit register + * + ************************************************************************************/ + +static inline uint8_t spi_getreg8(FAR struct kinetis_spidev_s *priv, uint8_t offset) +{ + return getreg8(priv->spibase + offset); +} + +/************************************************************************************ + * Name: spi_putreg8 + * + * Description: + * Write a 8-bit value to the SPI register at offset + * + * Input Parameters: + * priv - private SPI device structure + * offset - offset to the register of interest + * value - the 8-bit value to be written + * + * Returned Value: + * Nothing + * + ************************************************************************************/ + +static inline void spi_putreg8(FAR struct kinetis_spidev_s *priv, uint8_t offset, + uint8_t value) +{ + putreg8(value, priv->spibase + offset); +} + +/************************************************************************************ + * Name: spi_write_status + * + * Description: + * Write the 32-bit status + * + * Input Parameters: + * priv - Device-specific state data + * status- any ones will clear flags. + * + * Returned Value: + * None + * + ************************************************************************************/ + +static inline void spi_write_status(FAR struct kinetis_spidev_s *priv, uint32_t status) +{ + + /* Write the SR Register */ + + spi_putreg(priv, KINETIS_SPI_SR_OFFSET, status); +} + +/************************************************************************************ + * Name: spi_wait_status + * + * Description: + * Wait for bit to be set in status + * + * Input Parameters: + * priv - Device-specific state data + * status- bit to wait on. + * + * Returned Value: + * None + * + ************************************************************************************/ + +static inline void spi_wait_status(FAR struct kinetis_spidev_s *priv, uint32_t status) +{ + + while (status != (spi_getreg(priv, KINETIS_SPI_SR_OFFSET) & status)); +} + +/************************************************************************************ + * Name: spi_write_control + * + * Description: + * Write the 16-bit control word to the TX FIFO + * + * Input Parameters: + * priv - Device-specific state data + * control- to write + * + * Returned Value: + * None + * + ************************************************************************************/ + +static inline void spi_write_control(FAR struct kinetis_spidev_s *priv, uint32_t control) +{ + + /* Write the control word to the SPI Data Register */ + + spi_putreg16(priv, KINETIS_SPI_PUSHR_OFFSET + 2, (uint16_t) (control >> 16)); +} + +/************************************************************************************ + * Name: spi_writeword + * + * Description: + * Write one 16 bit word to SPI TX FIFO + * + * Input Parameters: + * priv - Device-specific state data + * word - word to send + * + * Returned Value: + * None + * + ************************************************************************************/ + +static inline void spi_writeword(FAR struct kinetis_spidev_s *priv, uint16_t word) +{ + /* Wait until there is space in the fifo */ + + spi_wait_status(priv, SPI_SR_TFFF); + + /* Write the data to transmitted to the SPI Data Register */ + + spi_putreg16(priv, KINETIS_SPI_PUSHR_OFFSET, SPI_PUSHR_TXDATA(word)); +} + +/************************************************************************************ + * Name: spi_readword + * + * Description: + * Read one 16 bit word from SPI RX FIFO + * + * Input Parameters: + * priv - Device-specific state data + * + * Returned Value: + * The 8-bit value from the FIFO + * + ************************************************************************************/ + +static inline uint16_t spi_readword(FAR struct kinetis_spidev_s *priv) +{ + /* Wait until transfer completes and the data is in the RX FIFO */ + + spi_wait_status(priv, SPI_SR_RFDF | SPI_SR_TCF); + + /* Return the data */ + + return spi_getreg16(priv, KINETIS_SPI_POPR_OFFSET); +} + +/************************************************************************************ + * Name: spi_run + * + * Description: + * Sets or clears the HALT + * + * Input Parameters: + * priv - private SPI device structure + * enable - True clears HALT + * + * Returned Value: + * Last enable setting + * + ************************************************************************************/ + +void inline spi_run(FAR struct kinetis_spidev_s *priv, bool enable) +{ + uint32_t regval; + + regval = spi_getreg(priv, KINETIS_SPI_MCR_OFFSET); + regval &= ~SPI_MCR_HALT; + regval |= enable ? 0 : SPI_MCR_HALT; + spi_putreg(priv, KINETIS_SPI_MCR_OFFSET, regval); +} + +/************************************************************************************ + * Name: spi_lock + * + * Description: + * On SPI busses where there are multiple devices, it will be necessary to + * lock SPI to have exclusive access to the busses for a sequence of + * transfers. The bus should be locked before the chip is selected. After + * locking the SPI bus, the caller should then also call the setfrequency, + * setbits, and setmode methods to make sure that the SPI is properly + * configured for the device. If the SPI buss is being shared, then it + * may have been left in an incompatible state. + * + * Input Parameters: + * dev - Device-specific state data + * lock - true: Lock spi bus, false: unlock SPI bus + * + * Returned Value: + * None + * + ************************************************************************************/ + +static int spi_lock(FAR struct spi_dev_s *dev, bool lock) +{ + FAR struct kinetis_spidev_s *priv = (FAR struct kinetis_spidev_s *)dev; + + if (lock) + { + /* Take the semaphore (perhaps waiting) */ + + while (sem_wait(&priv->exclsem) != 0) + { + /* The only case that an error should occur here is if the wait was awakened + * by a signal. + */ + + ASSERT(errno == EINTR); + } + } + else + { + (void)sem_post(&priv->exclsem); + } + + return OK; +} + +/************************************************************************************ + * Name: spi_setfrequency + * + * Description: + * Set the SPI frequency. + * + * Input Parameters: + * dev - Device-specific state data + * frequency - The SPI frequency requested + * + * Returned Value: + * Returns the actual frequency selected + * + ************************************************************************************/ + +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) +{ + FAR struct kinetis_spidev_s *priv = (FAR struct kinetis_spidev_s *)dev; + + uint32_t prescale; + uint32_t prescalev; + uint32_t doublebr; + uint32_t scaler; + uint32_t scalerv; + uint32_t diff; + uint32_t actual; + uint32_t regval; + + uint32_t pbr = 0; + uint32_t dbr = 1; + uint32_t br = 0; + uint32_t min = UINT32_MAX; + + /* Check if requested frequency reasonable */ + + if (frequency > KINETIS_SPI_CLK_MAX) + { + frequency = KINETIS_SPI_CLK_MAX; + } + else if (frequency == 0) + { + frequency = KINETIS_SPI_CLK_INIT; + } + + /* Check if the requested frequency is the same as the frequency selection */ + + if (priv->frequency == frequency) + { + /* We are already at this frequency. Return the actual. */ + + return priv->actual; + } + + /* The clock source for the SPI baud rate generator is the bus clock. + * and the SCK is given by: + * + * SCK = (fP /PBR) x [(1+DBR)/BR] + * + * Where: + * fP - the Bus Clock + * PBR - Baud Rate Prescaler {2, 3, 5, 7} + * DBR - Double Baud Rate {0, 1} + * BR - Baud Rate Scaler {2, 4, 6, 8 ... 32,768} + * + * We need find a PBR and BR resulting in the in baudrate closest to the + * requested value. We give preference to DBR of 0 to maintina a 50/50 + * duty sysle + * + */ + + for (doublebr = 1; min && doublebr <= 2; doublebr++) + { + for (prescalev = 0, prescale = 2; + min && prescalev <= 3; + prescalev ++, prescale == 2 ? prescale++ : (prescale += 2)) + { + for (scalerv = 0, scaler = 2; + min && scalerv <= 15; + scalerv++, scaler < 8 ? (scaler += 2) : (scaler <<= 1)) + { + actual = ((BOARD_BUS_FREQ * doublebr) / (prescale * scaler)); + if (frequency >= actual) + { + diff = frequency - actual; + if (min > diff) + { + min = diff; + pbr = prescalev; + dbr = doublebr == 2 ? SPI_CTARM_DBR : 0; + br = scalerv; + priv->actual = actual; + } + } + } + } + } + + /* Write the new dividers to the CTAR register */ + + regval = spi_getreg(priv, priv->ctarsel); + regval &= ~(SPI_CTARM_BR_MASK | SPI_CTARM_PBR_MASK | SPI_CTARM_DBR); + regval |= (SPI_CTARM_BR(br) | SPI_CTARM_PBR(pbr) | dbr); + spi_putreg(priv, priv->ctarsel, regval); + + /* Save the frequency setting so that subsequent re-configurations will be + * faster. + */ + + priv->frequency = frequency; + + spiinfo("Frequency %d->%d\n", frequency, priv->actual); + return priv->actual; +} + +/************************************************************************************ + * Name: spi_setmode + * + * Description: + * Set the SPI mode. see enum spi_mode_e for mode definitions + * + * Input Parameters: + * dev - Device-specific state data + * mode - The SPI mode requested + * + * Returned Value: + * Returns the actual frequency selected + * + ************************************************************************************/ + +static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) +{ + FAR struct kinetis_spidev_s *priv = (FAR struct kinetis_spidev_s *)dev; + uint32_t regval; + + spiinfo("mode=%d\n", mode); + + /* Has the mode changed? */ + + if (mode != priv->mode) + { + /* Yes... Set CTAR appropriately */ + + regval = spi_getreg(priv, priv->ctarsel); + regval &= ~(SPI_CTAR_CPOL | SPI_CTAR_CPHA); + + switch (mode) + { + case SPIDEV_MODE0: /* CPOL=0; CPHA=0 */ + break; + + case SPIDEV_MODE1: /* CPOL=0; CPHA=1 */ + regval |= SPI_CTAR_CPHA; + break; + + case SPIDEV_MODE2: /* CPOL=1; CPHA=0 */ + regval |= SPI_CTAR_CPOL; + break; + + case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */ + regval |= (SPI_CTAR_CPOL | SPI_CTAR_CPHA); + break; + + default: + DEBUGASSERT(FALSE); + return; + } + + spi_putreg(priv, priv->ctarsel, regval); + + /* Save the mode so that subsequent re-configurations will be faster */ + + priv->mode = mode; + } +} + +/************************************************************************************ + * Name: spi_setbits + * + * Description: + * Set the number of bits per word. + * + * Input Parameters: + * dev - Device-specific state data + * nbits - The number of bits requested + * + * Returned Value: + * None + * + ************************************************************************************/ + +static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) +{ + FAR struct kinetis_spidev_s *priv = (FAR struct kinetis_spidev_s *)dev; + uint32_t regval; + + if (nbits != priv->nbits) + { + /* Set the number of bits (valid range 4-16) */ + + if (nbits < 4 || nbits > 16) + { + return; + } + + regval = spi_getreg(priv, priv->ctarsel); + regval &= ~(SPI_CTARM_FMSZ_MASK); + regval |= SPI_CTARM_FMSZ(nbits-1); + spi_putreg(priv, priv->ctarsel, regval); + + /* Save the selection so the subsequence re-configurations will be faster */ + + priv->nbits = nbits; + } +} + +/************************************************************************************ + * Name: spi_hwfeatures + * + * Description: + * Set hardware-specific feature flags. + * + * Input Parameters: + * dev - Device-specific state data + * features - H/W feature flags + * + * Returned Value: + * Zero (OK) if the selected H/W features are enabled; A negated errno + * value if any H/W feature is not supportable. + * + ************************************************************************************/ + +#ifdef CONFIG_SPI_HWFEATURES +static int spi_hwfeatures(FAR struct spi_dev_s *dev, spi_hwfeatures_t features) +{ +#ifdef CONFIG_SPI_BITORDER + FAR struct kinetis_spidev_s *priv = (FAR struct spi_dev_s *)dev; + uint32_t setbits; + uint32_t clrbits; + + spiinfo("features=%08x\n", features); + + /* Transfer data LSB first? */ + + if ((features & HWFEAT_LSBFIRST) != 0) + { + setbits = SPI_CTARM_LSBFE; + clrbits = 0; + } + else + { + setbits = 0; + clrbits = SPI_CTARM_LSBFE; + } + + regval = spi_getreg(priv, priv->ctarsel); + regval &= ~clrbits; + regval |= setbits; + spi_putreg(priv, priv->ctarsel, regval); + + /* Other H/W features are not supported */ + + return ((features & ~HWFEAT_LSBFIRST) == 0) ? OK : -ENOSYS; +#else + return -ENOSYS; +#endif +} +#endif + +/************************************************************************************ + * Name: spi_send_data + * + * Description: + * Exchange one word on SPI + * + * Input Parameters: + * priv - Device-specific state data + * wd - The word to send. the size of the data is determined by the + * number of bits selected for the SPI interface. + * + * Returned Value: + * response + * + ************************************************************************************/ + +static uint16_t spi_send_data(FAR struct kinetis_spidev_s *priv, uint16_t wd, + bool last) +{ + uint16_t ret; + + /* On first write set control word and start transfer */ + + if (0 == (spi_getreg(priv, KINETIS_SPI_SR_OFFSET) & SPI_SR_TXRXS)) + { + spi_run(priv, true); + spi_write_control(priv, SPI_PUSHR_CTAS_CTAR0 | SPI_PUSHR_CTCNT); + } + + spi_writeword(priv, wd); + ret = spi_readword(priv); + + if (!last) + { + /* Clear the Transfer complete and the RX FIFO RDY */ + + spi_write_status(priv, SPI_SR_TCF | SPI_SR_RFDF); + } + else + { + /* Clear all status */ + + spi_write_status(priv, spi_getreg(priv, KINETIS_SPI_SR_OFFSET)); + spi_run(priv, false); + } + + return ret; +} + +/************************************************************************************ + * Name: spi_send + * + * Description: + * Exchange one word on SPI + * + * Input Parameters: + * dev - Device-specific state data + * wd - The word to send. the size of the data is determined by the + * number of bits selected for the SPI interface. + * + * Returned Value: + * response + * + ************************************************************************************/ + +static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) +{ + FAR struct kinetis_spidev_s *priv = (FAR struct kinetis_spidev_s *)dev; + + return spi_send_data(priv, wd, true); +} + +/************************************************************************************ + * Name: spi_exchange + * + * Description: + * Exchange a block of data on SPI without using DMA + * + * Input Parameters: + * dev - Device-specific state data + * txbuffer - A pointer to the buffer of data to be sent + * rxbuffer - A pointer to a buffer in which to receive data + * nwords - the length of data to be exchaned in units of words. + * The wordsize is determined by the number of bits-per-word + * selected for the SPI interface. If nbits <= 8, the data is + * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * + * Returned Value: + * None + * + ************************************************************************************/ + +static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, + FAR void *rxbuffer, size_t nwords) +{ + FAR struct kinetis_spidev_s *priv = (FAR struct kinetis_spidev_s *)dev; + uint8_t *brxptr = (uint8_t *)rxbuffer; + const uint8_t *btxptr = (uint8_t *)txbuffer; + uint16_t *wrxptr = (uint16_t *)rxbuffer; + const uint16_t *wtxptr = (const uint16_t *)txbuffer; + uint8_t byte; + uint16_t word; + + spiinfo("txbuffer=%p rxbuffer=%p nwords=%d\n", txbuffer, rxbuffer, nwords); + + if (priv->nbits > 8) + { + /* 16-bit mode */ + + while (nwords-- > 0) + { + /* Get the next word to write. Is there a source buffer? */ + + if (wtxptr) + { + word = *wtxptr++; + } + else + { + word = 0xffff; + } + + /* Exchange one word */ + + word = spi_send_data(priv, word, nwords ? false : true); + + /* Is there a buffer to receive the return value? */ + + if (wrxptr) + { + *wrxptr++ = word; + } + } + } + else + { + + /* 8-bit mode */ + + while (nwords-- > 0) + { + /* Get the next word to write. Is there a source buffer? */ + + if (btxptr) + { + byte = *btxptr++; + } + else + { + byte = 0xff; + } + + /* Exchange one word */ + + byte = (uint8_t) spi_send_data(priv, (uint16_t)byte, nwords ? false : true); + + /* Is there a buffer to receive the return value? */ + + if (brxptr) + { + *brxptr++ = byte; + } + } + } +} +/************************************************************************************ + * Name: spi_sndblock + * + * Description: + * Send a block of data on SPI + * + * Input Parameters: + * dev - Device-specific state data + * txbuffer - A pointer to the buffer of data to be sent + * nwords - the length of data to send from the buffer in number of words. + * The wordsize is determined by the number of bits-per-word + * selected for the SPI interface. If nbits <= 8, the data is + * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * + * Returned Value: + * None + * + ************************************************************************************/ + +#ifndef CONFIG_SPI_EXCHANGE +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *txbuffer, + size_t nwords) +{ + spiinfo("txbuffer=%p nwords=%d\n", txbuffer, nwords); + return spi_exchange(dev, txbuffer, NULL, nwords); +} +#endif + +/************************************************************************************ + * Name: spi_recvblock + * + * Description: + * Receive a block of data from SPI + * + * Input Parameters: + * dev - Device-specific state data + * rxbuffer - A pointer to the buffer in which to recieve data + * nwords - the length of data that can be received in the buffer in number + * of words. The wordsize is determined by the number of bits-per-word + * selected for the SPI interface. If nbits <= 8, the data is + * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * + * Returned Value: + * None + * + ************************************************************************************/ + +#ifndef CONFIG_SPI_EXCHANGE +static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer, size_t nwords) +{ + spiinfo("rxbuffer=%p nwords=%d\n", rxbuffer, nwords); + return spi_exchange(dev, NULL, rxbuffer, nwords); +} +#endif + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: kinetis_spibus_initialize + * + * Description: + * Initialize the selected SPI port. + * + * Input Parameter: + * Port number (for hardware that has mutiple SPI interfaces) + * + * Returned Value: + * Valid SPI device structure reference on succcess; a NULL on failure + * + ************************************************************************************/ + +FAR struct spi_dev_s *kinetis_spibus_initialize(int port) +{ + FAR struct kinetis_spidev_s *priv; + uint32_t regval; + + /* Configure multiplexed pins as connected on the board. Chip select pins + * must be configured by board-specific logic. Most SPI pins multiple, + * alternative pin selection. Definitions in the board.h file must be\ + * provided to resolve the board-specific pin configuration like: + * + * #define PIN_SPI0_SCK PIN_SPI0_SCK_1 + */ + +#ifdef CONFIG_KINETIS_SPI0 + if (port == 0) + { + priv = &g_spi0dev; + + /* Configure pins for SPI0 */ + + kinetis_pinconfig(PIN_SPI0_SCK); + kinetis_pinconfig(PIN_SPI0_SIN); + kinetis_pinconfig(PIN_SPI0_OUT); + + /* Enable clocking */ + + regval = getreg32(KINETIS_SIM_SCGC6); + regval |= SIM_SCGC6_SPI0; + putreg32(regval, KINETIS_SIM_SCGC6); + } + else +#endif +#ifdef CONFIG_KINETIS_SPI1 + if (port == 1) + { + priv = &g_spi1dev; + + /* Configure pins for SPI1 */ + + kinetis_pinconfig(PIN_SPI1_SCK); + kinetis_pinconfig(PIN_SPI1_SIN); + kinetis_pinconfig(PIN_SPI1_OUT); + + /* Enable clocking */ + + regval = getreg32(KINETIS_SIM_SCGC6); + regval |= SIM_SCGC6_SPI1; + putreg32(regval, KINETIS_SIM_SCGC6); + } + else +#endif +#ifdef CONFIG_KINETIS_SPI2 + if (port == 2) + { + priv = &g_spi2dev; + + /* Configure pins for SPI1 */ + + kinetis_pinconfig(PIN_SPI2_SCK); + kinetis_pinconfig(PIN_SPI2_SIN); + kinetis_pinconfig(PIN_SPI2_OUT); + + /* Enable clocking */ + + regval = getreg32(KINETIS_SIM_SCGC3); + regval |= SIM_SCGC3_SPI2; + putreg32(regval, KINETIS_SIM_SCGC3); + } + else +#endif + { + spierr("ERROR: Port %d not configured\n", port); + return NULL; + } + + /* Halt operations */ + + spi_run(priv, false); + + /* Configure master mode: + * Master Mode - Enabled + * Continuous SCK - Disabled + * SPI Configuration - SPI + * Freeze - Disabled + * Modified Transfer Format - Disabled + * Peripheral Chip Select Strobe - Peripheral Chip Select[5] signal + * Receive FIFO Overflow Overwrite - Ignore incoming + * Chip Select x Inactive State - High + * Doze - Disabled + * Module Disable - Enables the module clocks. + * Disable Transmit FIFO - yes + * Disable Receive FIFO - yes + * Clear TX FIFO - No + * Clear RX FIFO - No + * Sample Point - 0 clocks between edge and sample + * + */ + + spi_putreg(priv, KINETIS_SPI_MCR_OFFSET, SPI_MCR_MSTR | SPI_MCR_DCONF_SPI | + SPI_MCR_SMPL_PT_0CLKS | SPI_MCR_PCSIS_MASK | SPI_MCR_HALT| + SPI_MCR_DIS_RXF | SPI_MCR_DIS_TXF); + + /* Set the initial SPI configuration */ + + spi_putreg(priv, priv->ctarsel, 0); + + /* MSB first, 8 bit */ + + priv->nbits = 0; + spi_setbits(&priv->spidev, 8); + + /* select mode 0 */ + + priv->mode = SPIDEV_MODE3; + spi_setmode(&priv->spidev, SPIDEV_MODE0); + + /* Select a default frequency of approx. 400KHz */ + + priv->frequency = 0; + spi_setfrequency(&priv->spidev, KINETIS_SPI_CLK_INIT); + + /* Initialize the SPI semaphore that enforces mutually exclusive access */ + + sem_init(&priv->exclsem, 0, 1); + + return &priv->spidev; +} + +#endif /* CONFIG_KINETIS_SPI0 || CONFIG_KINETIS_SPI1 || CONFIG_KINETIS_SPI2 */ From fbea5abef0514dff55734b417dea6d38d6ec32bc Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 13 Jun 2017 11:10:09 -1000 Subject: [PATCH 11/55] freedom-k66f:Refreshed config --- configs/freedom-k66f/nsh/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/freedom-k66f/nsh/defconfig b/configs/freedom-k66f/nsh/defconfig index 91f33ffc14..aa55534ab8 100644 --- a/configs/freedom-k66f/nsh/defconfig +++ b/configs/freedom-k66f/nsh/defconfig @@ -576,6 +576,7 @@ CONFIG_INPUT=y # CONFIG_INPUT_ADS7843E is not set # CONFIG_INPUT_MXT is not set # CONFIG_INPUT_STMPE811 is not set +# CONFIG_INPUT_CYPRESS_MBR3108 is not set CONFIG_BUTTONS=y CONFIG_BUTTONS_LOWER=y CONFIG_BUTTONS_NPOLLWAITERS=2 From 611612c6f2365f35c87fa7c3666175ebc37777b0 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 13 Jun 2017 11:49:32 -1000 Subject: [PATCH 12/55] freedom-k66f:Use SPI driver. Initalize SPI1 on connector J6. No real use, as of yet. --- configs/freedom-k66f/include/board.h | 18 ++++++++++++++++++ configs/freedom-k66f/nsh/defconfig | 13 +++++++++++-- configs/freedom-k66f/src/freedom-k66f.h | 11 +++++++++++ configs/freedom-k66f/src/k66_bringup.c | 19 ++++++++++++++++++- configs/freedom-k66f/src/k66_spi.c | 9 ++++++--- 5 files changed, 64 insertions(+), 6 deletions(-) diff --git a/configs/freedom-k66f/include/board.h b/configs/freedom-k66f/include/board.h index 4a5673e936..d69bb153a1 100644 --- a/configs/freedom-k66f/include/board.h +++ b/configs/freedom-k66f/include/board.h @@ -348,6 +348,24 @@ #define PIN_I2C0_SCL PIN_I2C0_SCL_3 #define PIN_I2C0_SDA PIN_I2C0_SDA_3 +/* RF/WIFI + * + * J6 Pin Name K66 Name + * ------ ----- ------ --------- + * 1 GND + * 2 P3V3 + * 3 CE PTB20 PTB20 + * 4 CS PTD4 SPI1_PCS0 (use as GPIO) + * 5 SCK PTD5 SPI1_SCK + * 6 MOSI PTD6 SPI1_MOSI + * 7 MISO PTD7 SPI1_MISO + * 8 IRQ PTC18 PTC18 + */ + +#define PIN_SPI1_SCK PIN_SPI1_SCK_3 +#define PIN_SPI1_OUT PIN_SPI1_SOUT_3 +#define PIN_SPI1_SIN PIN_SPI1_SIN_3 + /* * Ethernet MAC/KSZ8081 PHY * ------------------------ diff --git a/configs/freedom-k66f/nsh/defconfig b/configs/freedom-k66f/nsh/defconfig index aa55534ab8..ca3eec729d 100644 --- a/configs/freedom-k66f/nsh/defconfig +++ b/configs/freedom-k66f/nsh/defconfig @@ -223,7 +223,7 @@ CONFIG_KINETIS_UART4=y # CONFIG_KINETIS_FLEXCAN0 is not set # CONFIG_KINETIS_FLEXCAN1 is not set # CONFIG_KINETIS_SPI0 is not set -# CONFIG_KINETIS_SPI1 is not set +CONFIG_KINETIS_SPI1=y # CONFIG_KINETIS_SPI2 is not set CONFIG_KINETIS_I2C0=y # CONFIG_KINETIS_I2C1 is not set @@ -546,7 +546,15 @@ CONFIG_I2C_DRIVER=y # CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set # CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set # CONFIG_ARCH_HAVE_SPI_BITORDER is not set -# CONFIG_SPI is not set +CONFIG_SPI=y +# CONFIG_SPI_SLAVE is not set +CONFIG_SPI_EXCHANGE=y +# CONFIG_SPI_CMDDATA is not set +# CONFIG_SPI_CALLBACK is not set +# CONFIG_SPI_HWFEATURES is not set +CONFIG_SPI_CS_DELAY_CONTROL=y +# CONFIG_SPI_DRIVER is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set # @@ -608,6 +616,7 @@ CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_MULTIBLOCK_DISABLE=y CONFIG_MMCSD_MMCSUPPORT=y CONFIG_MMCSD_HAVECARDDETECT=y +# CONFIG_MMCSD_SPI is not set CONFIG_ARCH_HAVE_SDIO=y # CONFIG_SDIO_DMA is not set # CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE is not set diff --git a/configs/freedom-k66f/src/freedom-k66f.h b/configs/freedom-k66f/src/freedom-k66f.h index 245c480493..da91d285e7 100644 --- a/configs/freedom-k66f/src/freedom-k66f.h +++ b/configs/freedom-k66f/src/freedom-k66f.h @@ -57,6 +57,7 @@ #define HAVE_PROC 1 #define HAVE_MMCSD 1 #define HAVE_AUTOMOUNTER 1 +#define HAVE_SPI 1 #define HAVE_USBDEV 1 #if defined(CONFIG_KINETIS_RTC) @@ -173,6 +174,11 @@ # undef CONFIG_KINETIS_SPI2 #endif +#if !defined(CONFIG_KINETIS_SPI0) && !defined(CONFIG_KINETIS_SPI1) && \ + !defined(CONFIG_KINETIS_SPI3) +# undef HAVE_SPI +#endif + /* FREEDOM-K66F GPIOs ****************************************************************/ /* A micro Secure Digital (SD) card slot is available on the FRDM-K66F connected to * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro @@ -223,6 +229,11 @@ #define GPIO_LED_G (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTE | PIN6) #define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN11) +/* SPI1 on J6 */ + +#define PIN_CE (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN20) +#define PIN_SPI1_PCS0 (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTD | PIN4) + /************************************************************************************ * Public data ************************************************************************************/ diff --git a/configs/freedom-k66f/src/k66_bringup.c b/configs/freedom-k66f/src/k66_bringup.c index 4ec736516a..8de8efb552 100644 --- a/configs/freedom-k66f/src/k66_bringup.c +++ b/configs/freedom-k66f/src/k66_bringup.c @@ -47,8 +47,10 @@ #include #include +#include #include +#include "kinetis_spi.h" #include "freedom-k66f.h" #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_INITIALIZE) @@ -67,6 +69,9 @@ int k66_bringup(void) { +#ifdef HAVE_SPI + FAR struct spi_dev_s *spi1; +#endif int ret; #ifdef HAVE_PROC @@ -151,8 +156,20 @@ int k66_bringup(void) } #endif +#ifdef HAVE_SPI + + /* Verify we can initialize SPI bus 1 */ + + spi1 = kinetis_spibus_initialize(1); + + if (!spi1) + { + syslog(LOG_ERR, "ERROR:FAILED to initialize SPI port 1\n"); + return -ENODEV; + } +#endif + UNUSED(ret); return OK; } - #endif /* CONFIG_LIB_BOARDCTL CONFIG_BOARD_INITIALIZE */ diff --git a/configs/freedom-k66f/src/k66_spi.c b/configs/freedom-k66f/src/k66_spi.c index ce0c6eb78d..2f8e456785 100644 --- a/configs/freedom-k66f/src/k66_spi.c +++ b/configs/freedom-k66f/src/k66_spi.c @@ -53,7 +53,7 @@ #include "freedom-k66f.h" #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ - defined(CONFIG_KINETIS_SPI2) + defined(CONFIG_KINETIS_SPI2) /************************************************************************************ * Public Functions @@ -69,7 +69,10 @@ void weak_function k66_spidev_initialize(void) { -# warning "Missing logic" + /* Initialize the CE CS pins on J6 RF/WIFI connector */ + + kinetis_pinconfig(PIN_CE); + kinetis_pinconfig(PIN_SPI1_PCS0); } /************************************************************************************ @@ -118,7 +121,7 @@ uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) { spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); -# warning "Missing logic" + kinetis_gpiowrite(PIN_SPI1_PCS0, !selected); } uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) From 908d4380471b59fd11559700b13347bce38b6378 Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Fri, 2 Jun 2017 18:49:22 -0400 Subject: [PATCH 13/55] WIP: wireless/ieee802154: More work on association/beacon-enabled networks --- drivers/wireless/ieee802154/mrf24j40.c | 224 ++- .../wireless/ieee802154/ieee802154_mac.h | 15 +- .../wireless/ieee802154/ieee802154_radio.h | 34 +- wireless/ieee802154/Kconfig | 6 + wireless/ieee802154/mac802154.c | 1591 ++++++++++++----- wireless/ieee802154/mac802154.h | 2 - wireless/ieee802154/mac802154_device.c | 4 +- 7 files changed, 1307 insertions(+), 569 deletions(-) diff --git a/drivers/wireless/ieee802154/mrf24j40.c b/drivers/wireless/ieee802154/mrf24j40.c index 903b843c9c..40efb3945a 100644 --- a/drivers/wireless/ieee802154/mrf24j40.c +++ b/drivers/wireless/ieee802154/mrf24j40.c @@ -123,27 +123,28 @@ struct mrf24j40_radio_s FAR const struct mrf24j40_lower_s *lower; FAR struct spi_dev_s *spi; /* Saved SPI interface instance */ - struct work_s irqwork; /* For deferring interrupt work to work queue */ - struct work_s pollwork; /* For deferring poll work to the work queue */ - sem_t exclsem; /* Exclusive access to this struct */ + struct work_s irqwork; /* For deferring interrupt work to work queue */ + struct work_s csma_pollwork; /* For deferring poll work to the work queue */ + struct work_s gts_pollwork; /* For deferring poll work to the work queue */ + + sem_t exclsem; /* Exclusive access to this struct */ struct ieee802154_addr_s addr; - uint8_t channel; /* 11 to 26 for the 2.4 GHz band */ - uint8_t devmode; /* device mode: device, coord, pancoord */ - uint8_t paenabled; /* enable usage of PA */ - uint8_t rxmode; /* Reception mode: Main, no CRC, promiscuous */ - int32_t txpower; /* TX power in mBm = dBm/100 */ - struct ieee802154_cca_s cca; /* Clear channel assessement method */ + uint8_t channel; /* 11 to 26 for the 2.4 GHz band */ + uint8_t devmode; /* device mode: device, coord, pancoord */ + uint8_t paenabled; /* enable usage of PA */ + uint8_t rxmode; /* Reception mode: Main, no CRC, promiscuous */ + int32_t txpower; /* TX power in mBm = dBm/100 */ + struct ieee802154_cca_s cca; /* Clear channel assessement method */ - /* Buffer Allocations */ + struct ieee802154_txdesc_s *txdelayed_desc; + bool txdelayed_busy; struct ieee802154_txdesc_s *csma_desc; - FAR struct iob_s *csma_frame; bool csma_busy; struct ieee802154_txdesc_s *gts_desc[MRF24J40_GTS_SLOTS]; - FAR struct iob_s *gts_frame[MRF24J40_GTS_SLOTS]; bool gts_busy[MRF24J40_GTS_SLOTS]; }; @@ -214,41 +215,30 @@ static int mrf24j40_getcca(FAR struct mrf24j40_radio_s *dev, FAR struct ieee802154_cca_s *cca); static int mrf24j40_energydetect(FAR struct mrf24j40_radio_s *dev, FAR uint8_t *energy); -static int mrf24j40_rxenable(FAR struct mrf24j40_radio_s *dev, bool enable); +static void mrf24j40_mactimer(FAR struct mrf24j40_radio_s *dev, int numsymbols); /* Driver operations */ static int mrf24j40_bind(FAR struct ieee802154_radio_s *radio, FAR struct ieee802154_radiocb_s *radiocb); -static int mrf24j40_txnotify_csma(FAR struct ieee802154_radio_s *radio); -static int mrf24j40_txnotify_gts(FAR struct ieee802154_radio_s *radio); +static int mrf24j40_txnotify(FAR struct ieee802154_radio_s *radio, bool gts); +static int mrf24j40_txdelayed(FAR struct ieee802154_radio_s *radio, + FAR struct ieee802154_txdesc_s *txdesc, + uint32_t symboldelay); static int mrf24j40_get_attr(FAR struct ieee802154_radio_s *radio, enum ieee802154_pib_attr_e pib_attr, FAR union ieee802154_attr_u *attrval); -static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, +static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, enum ieee802154_pib_attr_e pib_attr, FAR const union ieee802154_attr_u *attrval); +static int mrf24j40_rxenable(FAR struct ieee802154_radio_s *dev, bool enable); +static int mrf24j40_req_rxenable(FAR struct ieee802154_radio_s *radio, + FAR struct ieee802154_rxenable_req_s *req); /**************************************************************************** * Private Data ****************************************************************************/ -/* These are pointers to ALL registered MRF24J40 devices. - * This table is used during irqs to find the context - * Only one device is supported for now. - * More devices can be supported in the future by lookup them up - * using the IRQ number. See the ENC28J60 or CC3000 drivers for reference. - */ - -static const struct ieee802154_radioops_s mrf24j40_devops = -{ - mrf24j40_bind, - mrf24j40_txnotify_csma, - mrf24j40_txnotify_gts, - mrf24j40_get_attr, - mrf24j40_set_attr -}; - /**************************************************************************** * Radio Interface Functions ****************************************************************************/ @@ -264,7 +254,7 @@ static int mrf24j40_bind(FAR struct ieee802154_radio_s *radio, } /**************************************************************************** - * Function: mrf24j40_txnotify_csma + * Function: mrf24j40_txnotify * * Description: * Driver callback invoked when new TX data is available. This is a @@ -281,32 +271,49 @@ static int mrf24j40_bind(FAR struct ieee802154_radio_s *radio, * ****************************************************************************/ -static int mrf24j40_txnotify_csma(FAR struct ieee802154_radio_s *radio) +static int mrf24j40_txnotify(FAR struct ieee802154_radio_s *radio, bool gts) { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; - /* Is our single work structure available? It may not be if there are - * pending interrupt actions and we will have to ignore the Tx - * availability action. - */ - - if (work_available(&dev->pollwork)) + if (gts) { - /* Schedule to serialize the poll on the worker thread. */ + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ - work_queue(HPWORK, &dev->pollwork, mrf24j40_dopoll_csma, dev, 0); + if (work_available(&dev->gts_pollwork)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(HPWORK, &dev->gts_pollwork, mrf24j40_dopoll_gts, dev, 0); + } + } + else + { + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&dev->csma_pollwork)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(HPWORK, &dev->csma_pollwork, mrf24j40_dopoll_csma, dev, 0); + } } return OK; } /**************************************************************************** - * Function: mrf24j40_txnotify_gts + * Function: mrf24j40_txdelayed * * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. + * Transmit a packet without regard to supeframe structure after a certain + * number of symbols. This function is used to send Data Request responses. + * It can also be used to send data immediately is the delay is set to 0. * * Parameters: * radio - Reference to the radio driver state structure @@ -318,28 +325,25 @@ static int mrf24j40_txnotify_csma(FAR struct ieee802154_radio_s *radio) * ****************************************************************************/ -static int mrf24j40_txnotify_gts(FAR struct ieee802154_radio_s *radio) +static int mrf24j40_txdelayed(FAR struct ieee802154_radio_s *radio, + FAR struct ieee802154_txdesc_s *txdesc, + uint32_t symboldelay) { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; - /* Is our single work structure available? It may not be if there are - * pending interrupt actions and we will have to ignore the Tx - * availability action. - */ + /* An immediate transaction uses the CSMA FIFO. If there is a CSMA transaction + * in use, cancel it and put it back when we are done */ - if (work_available(&dev->pollwork)) - { - /* Schedule to serialize the poll on the worker thread. */ + + + - work_queue(HPWORK, &dev->pollwork, mrf24j40_dopoll_gts, dev, 0); - } - - return OK; + return -ENOTTY; } -static int mrf24j40_get_attr(FAR struct ieee802154_radio_s *radio, - enum ieee802154_pib_attr_e pib_attr, - FAR union ieee802154_attr_u *attrval) +static int mrf24j40_get_attr(FAR struct ieee802154_radio_s *radio, + enum ieee802154_pib_attr_e pib_attr, + FAR union ieee802154_attr_u *attrval) { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; int ret; @@ -390,19 +394,60 @@ static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, case IEEE802154_PIB_MAC_RX_ON_WHEN_IDLE: { dev->rxonidle = attrval->mac.rxonidle; - mrf24j40_rxenable(dev, dev->rxonidle); + mrf24j40_rxenable(radio, dev->rxonidle); + ret = IEEE802154_STATUS_SUCCESS; } break; default: ret = IEEE802154_STATUS_UNSUPPORTED_ATTRIBUTE; + break; } + return ret; } +static int mrf24j40_req_rxenable(FAR struct ieee802154_radio_s *radio, + FAR struct ieee802154_rxenable_req_s *req) +{ + return -ENOTTY; +} + /**************************************************************************** * Internal Functions ****************************************************************************/ +static void mrf24j40_mactimer(FAR struct mrf24j40_radio_s *dev, int numsymbols) +{ + uint16_t nhalfsym; + uint8_t intcon; + + nhalfsym = (numsymbols << 1); + + /* Get exclusive access to the device */ + + while (sem_wait(&dev->exclsem) != 0) { } + + /* Disable the interrupt, clear the timer count */ + + intcon = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); + intcon &= ~MRF24J40_INTCON_HSYMTMRIE; + mrf24j40_setreg(dev->spi, MRF24J40_INTCON, intcon); + + mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRL, 0x00); + mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRH, 0x00); + + /* Set the timer count and enable interrupts */ + + mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRL, nhalfsym & 0xFF); + mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRH, (nhalfsym >> 8) & 0xFF); + + intcon |= MRF24J40_INTCON_HSYMTMRIE; + mrf24j40_setreg(dev->spi, MRF24J40_INTCON, intcon); + + sem_post(&dev->exclsem); +} + + /**************************************************************************** * Function: mrf24j40_dopoll_csma * @@ -411,7 +456,7 @@ static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, * This is done: * * 1. After completion of a transmission (mrf24j40_txdone_csma), - * 2. When new TX data is available (mrf24j40_txnotify_csma), and + * 2. When new TX data is available (mrf24j40_txnotify), and * 3. After a TX timeout to restart the sending process * (mrf24j40_txtimeout_csma). * @@ -438,10 +483,8 @@ static void mrf24j40_dopoll_csma(FAR void *arg) if (!dev->csma_busy) { - /* need to somehow allow for a handle to be passed */ - - len = dev->radiocb->poll_csma(dev->radiocb, &dev->csma_desc, - &dev->csma_frame); + len = dev->radiocb->poll(dev->radiocb, false, &dev->csma_desc); + if (len > 0) { /* Now the txdesc is in use */ @@ -450,7 +493,7 @@ static void mrf24j40_dopoll_csma(FAR void *arg) /* Setup the transaction on the device in the CSMA FIFO */ - mrf24j40_csma_setup(dev, dev->csma_frame); + mrf24j40_csma_setup(dev, dev->csma_desc->frame); } } @@ -465,7 +508,7 @@ static void mrf24j40_dopoll_csma(FAR void *arg) * This is done: * * 1. After completion of a transmission (mrf24j40_txdone_gts), - * 2. When new TX data is available (mrf24j40_txnotify_gts), and + * 2. When new TX data is available (mrf24j40_txnotify), and * 3. After a TX timeout to restart the sending process * (mrf24j40_txtimeout_gts). * @@ -493,8 +536,8 @@ static void mrf24j40_dopoll_gts(FAR void *arg) { if (!dev->gts_busy[gts]) { - len = dev->radiocb->poll_gts(dev->radiocb, &dev->gts_desc[gts], - &dev->gts_frame[0]); + len = dev->radiocb->poll(dev->radiocb, true, &dev->gts_desc[gts]); + if (len > 0) { /* Now the txdesc is in use */ @@ -503,7 +546,7 @@ static void mrf24j40_dopoll_gts(FAR void *arg) /* Setup the transaction on the device in the open GTS FIFO */ - mrf24j40_gts_setup(dev, gts, dev->gts_frame[0]); + mrf24j40_gts_setup(dev, gts, dev->gts_desc[gts]->frame); } } } @@ -1281,9 +1324,8 @@ static int mrf24j40_csma_setup(FAR struct mrf24j40_radio_s *dev, ret = mrf24j40_setup_fifo(dev, frame, MRF24J40_TXNORM_FIFO); - /* If the frame control field contains - * an acknowledgment request, set the TXNACKREQ bit. - * See IEEE 802.15.4/2003 7.2.1.1 page 112 for info. + /* If the frame control field contains an acknowledgment request, set the + * TXNACKREQ bit. See IEEE 802.15.4/2003 7.2.1.1 page 112 for info. */ reg = MRF24J40_TXNCON_TXNTRIG; @@ -1406,10 +1448,6 @@ static void mrf24j40_irqwork_txnorm(FAR struct mrf24j40_radio_s *dev) dev->csma_busy = 0; - /* Free the IOB */ - - iob_free(dev->csma_frame); - mrf24j40_dopoll_csma(dev); } @@ -1456,10 +1494,6 @@ static void mrf24j40_irqwork_txgts(FAR struct mrf24j40_radio_s *dev, dev->gts_busy[gts]= 0; - /* Free the IOB */ - - iob_free(dev->gts_frame[gts]); - mrf24j40_dopoll_gts(dev); } @@ -1471,8 +1505,9 @@ static void mrf24j40_irqwork_txgts(FAR struct mrf24j40_radio_s *dev, * ****************************************************************************/ -static int mrf24j40_rxenable(FAR struct mrf24j40_radio_s *dev, bool enable) +static int mrf24j40_rxenable(FAR struct ieee802154_radio_s *radio, bool enable) { + FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; uint8_t reg; if (enable) @@ -1597,7 +1632,7 @@ done: static void mrf24j40_irqworker(FAR void *arg) { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)arg; - uint8_t intstat; + uint8_t intstat, intcon; DEBUGASSERT(dev); DEBUGASSERT(dev->spi); @@ -1609,6 +1644,17 @@ static void mrf24j40_irqworker(FAR void *arg) /* Do work according to the pending interrupts */ + if ((intstat & MRF24J40_INTSTAT_HSYMTMRIF)) + { + /* TODO: What to do when timer expires? */ + + /* Timers are one-shot, so disable the interrupt */ + + intcon = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); + intcon &= ~MRF24J40_INTCON_HSYMTMRIE; + mrf24j40_setreg(dev->spi, MRF24J40_INTCON, intcon); + } + if ((intstat & MRF24J40_INTSTAT_RXIF)) { /* A packet was received, retrieve it */ @@ -1721,7 +1767,13 @@ FAR struct ieee802154_radio_s *mrf24j40_init(FAR struct spi_dev_s *spi, sem_init(&dev->exclsem, 0, 1); - dev->radio.ops = &mrf24j40_devops; + dev->radio.bind = mrf24j40_bind; + dev->radio.txnotify = mrf24j40_txnotify; + dev->radio.txdelayed = mrf24j40_txdelayed; + dev->radio.get_attr = mrf24j40_get_attr; + dev->radio.set_attr = mrf24j40_set_attr; + dev->radio.rxenable = mrf24j40_rxenable; + dev->radio.req_rxenable = mrf24j40_req_rxenable; dev->lower = lower; dev->spi = spi; diff --git a/include/nuttx/wireless/ieee802154/ieee802154_mac.h b/include/nuttx/wireless/ieee802154/ieee802154_mac.h index 5f28cfa0c7..9068b18750 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_mac.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_mac.h @@ -269,6 +269,7 @@ enum ieee802154_pib_attr_e IEEE802154_PIB_PHY_UWB_RX_RMARKER, IEEE802154_PIB_PHY_RFRAME_PROC_TIME, IEEE802154_PIB_PHY_CCA_DURATION, + IEEE802154_PIB_PHY_SYMBOL_DURATION, /* Non-standard attribute */ /* MAC PIB Attributes */ @@ -543,7 +544,8 @@ union ieee802154_macattr_u union ieee802154_phyattr_u { uint8_t channel; - int32_t txpwr + int32_t txpwr; + uint32_t symdur_picosec; /* TODO: Fill this out as we implement supported get/set commands */ }; @@ -851,7 +853,7 @@ struct ieee802154_assoc_conf_s * unsuccessful. */ - struct ieee802154_addr_s dev_addr; + uint16_t saddr; /* Status of association attempt */ @@ -1185,7 +1187,7 @@ struct ieee802154_scan_conf_s uint8_t ch_page; uint8_t num_channels; -#warning Figure out how to handle missing primitive semantics. See standard. + /* TODO: Figure out how to handle missing primitive semantics. See standard. */ }; /***************************************************************************** @@ -1396,13 +1398,16 @@ union ieee802154_notif_u struct ieee802154_notif_s { /* Must be first member so that we can interchange between the actual - *notification and this extended struct. + * notification and this extended struct. */ union ieee802154_notif_u u; enum ieee802154_notify_e notiftype; - /* Support a singly linked list */ + /* Support a singly linked list. For use by receivers. The MAC has it's own + * extended struct type with another forward link that the MAC uses internally + * to handle allocation and freeing. + */ FAR struct ieee802154_notif_s *flink; }; diff --git a/include/nuttx/wireless/ieee802154/ieee802154_radio.h b/include/nuttx/wireless/ieee802154/ieee802154_radio.h index e0ff8b664f..90de13d40d 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_radio.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_radio.h @@ -66,6 +66,10 @@ struct ieee802154_txdesc_s FAR struct ieee802154_txdesc_s *flink; + /* Pointer to the frame IOB */ + + FAR struct iob_s *frame; + /* Pointer to the data confirmation structure to be populated upon * success/failure of the transmission. */ @@ -74,6 +78,8 @@ struct ieee802154_txdesc_s enum ieee802154_frametype_e frametype; /* Frame type. Used by MAC layer to * control how tx done is handled */ + bool framepending; /* Did the ACK have the frame pending bit + * bit set */ /* TODO: Add slotting information for GTS transactions */ }; @@ -82,37 +88,31 @@ struct ieee802154_txdesc_s struct ieee802154_radiocb_s { - CODE int (*poll_csma) (FAR const struct ieee802154_radiocb_s *radiocb, - FAR struct ieee802154_txdesc_s **tx_desc, - FAR struct iob_s **frame); - CODE int (*poll_gts) (FAR const struct ieee802154_radiocb_s *radiocb, - FAR struct ieee802154_txdesc_s **tx_desc, - FAR struct iob_s **frame); + CODE int (*poll) (FAR const struct ieee802154_radiocb_s *radiocb, + bool gts, FAR struct ieee802154_txdesc_s **tx_desc); CODE void (*txdone) (FAR const struct ieee802154_radiocb_s *radiocb, - FAR const struct ieee802154_txdesc_s *tx_desc); + FAR struct ieee802154_txdesc_s *tx_desc); CODE void (*rxframe) (FAR const struct ieee802154_radiocb_s *radiocb, FAR struct ieee802154_data_ind_s *ind); }; -struct ieee802154_radio_s; /* Forward reference */ - -struct ieee802154_radioops_s +struct ieee802154_radio_s { CODE int (*bind) (FAR struct ieee802154_radio_s *radio, FAR struct ieee802154_radiocb_s *radiocb); - CODE int (*txnotify_csma)(FAR struct ieee802154_radio_s *radio); - CODE int (*txnotify_gts)(FAR struct ieee802154_radio_s *radio); + CODE int (*txnotify)(FAR struct ieee802154_radio_s *radio, bool gts); + CODE int (*txdelayed)(FAR struct ieee802154_radio_s *radio, + FAR struct ieee802154_txdesc_s *txdesc, + uint32_t symboldelay); CODE int (*get_attr) (FAR struct ieee802154_radio_s *radio, enum ieee802154_pib_attr_e pib_attr, FAR union ieee802154_attr_u *attrval); CODE int (*set_attr) (FAR struct ieee802154_radio_s *radio, enum ieee802154_pib_attr_e pib_attr, FAR const union ieee802154_attr_u *attrval); -}; - -struct ieee802154_radio_s -{ - FAR const struct ieee802154_radioops_s *ops; + CODE int (*rxenable) (FAR struct ieee802154_radio_s *radio, bool enable); + CODE int (*req_rxenable)(FAR struct ieee802154_radio_s *radio, + FAR struct ieee802154_rxenable_req_s *req); }; #ifdef __cplusplus diff --git a/wireless/ieee802154/Kconfig b/wireless/ieee802154/Kconfig index 9e12f8b1bb..7ffe2654f4 100644 --- a/wireless/ieee802154/Kconfig +++ b/wireless/ieee802154/Kconfig @@ -15,6 +15,12 @@ menuconfig WIRELESS_IEEE802154 if WIRELESS_IEEE802154 +config IEEE802154_DEFAULT_EADDR + hex "IEEE 802.15.4 Default Extended Address" + default 0x00fade00deadbeef + ---help--- + Set the default extended address to be used by MAC networks on init + config IEEE802154_MAC_DEV bool "Character driver for IEEE 802.15.4 MAC layer" default n diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index c57891f83c..04fe802eeb 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -94,37 +94,44 @@ #error CONFIG_MAC802154_NNOTIF must be greater than CONFIG_MAC802154_NTXDESC #endif +#if !defined(CONFIG_IEEE802154_DEFAULT_EADDR) +#define CONFIG_IEEE802154_DEFAULT_EADDR 0xFFFFFFFFFFFFFFFF +#endif + /**************************************************************************** * Private Types ****************************************************************************/ -struct mac802154_txtrans_s -{ - /* Supports a singly linked list */ - - FAR struct mac802154_txtrans_s *flink; - FAR struct iob_s *frame; - uint8_t handle; - enum ieee802154_frametype_e frametype; - sem_t sem; -}; - -struct mac802154_unsec_mhr_s -{ - uint8_t length; - union - { - uint16_t frame_control; - uint8_t data[IEEE802154_MAX_UNSEC_MHR_OVERHEAD]; - } u; -}; - struct mac802154_radiocb_s { struct ieee802154_radiocb_s cb; FAR struct ieee802154_privmac_s *priv; }; +/* Extend the public ieee802154_notif_s to include a private forward link to + * support a list to handle allocation + */ + +struct mac802154_notif_s +{ + struct ieee802154_notif_s pub; + FAR struct mac802154_notif_s *flink; +}; + +/* Enumeration for representing what operation the MAC layer is currently doing. + * There can only be one command being handled at any given time, but certain + * operations such as association requires more than one command to be sent. + * Therefore, the need to track not only what command is currently active, but + * also, what overall operation the command is apart of is necessary. + */ + +enum mac802154_operation_e +{ + MAC802154_OP_NONE, + MAC802154_OP_ASSOC, + MAC802154_OP_POLL +}; + /* The privmac structure holds the internal state of the MAC and is the * underlying represention of the opaque MACHANDLE. It contains storage for * the IEEE802.15.4 MIB attributes. @@ -138,44 +145,29 @@ struct ieee802154_privmac_s sem_t exclsem; /* Support exclusive access */ - /* Support a single transaction dedicated to commands. As of now I see no + /* Only support a single command at any given time. As of now I see no * condition where you need to have more than one command frame simultaneously */ - - struct - { - sem_t sem; /* Exclusive use of the cmdtrans */ - enum ieee802154_cmdid_e type; /* Type of cmd in the cmdtrans */ - struct mac802154_txtrans_s trans; /* Dedicated txframe for cmds */ - /* Has the command been successfully sent. This is to help protect - * against an odd edge case that may or may not ever happen. The condition - * occurs when you receive a seemingly appropriate response to the command - * yet the command was never actually sent. - */ - - bool txdone; - } cmd; + sem_t op_sem; /* Exclusive operations */ + enum mac802154_operation_e curr_op; /* The current overall operation */ + enum ieee802154_cmdid_e curr_cmd; /* Type of the current cmd */ /* Pre-allocated notifications to be passed to the registered callback. These * need to be freed by the application using mac802154_xxxxnotif_free when * the callee layer is finished with it's use. */ - FAR struct ieee802154_notif_s *notif_free; - struct ieee802154_notif_s notif_alloc[CONFIG_MAC802154_NNOTIF]; + FAR struct mac802154_notif_s *notif_free; + struct mac802154_notif_s notif_pool[CONFIG_MAC802154_NNOTIF]; + sem_t notif_sem; sq_queue_t notif_queue; - FAR struct ieee802154_txdesc_s *txdesc_free; - struct ieee802154_txdesc_s txdesc_alloc[CONFIG_IEEE802154_NTXDESC]; + struct ieee802154_txdesc_s txdesc_pool[CONFIG_IEEE802154_NTXDESC]; + sem_t txdesc_sem; sq_queue_t txdesc_queue; sq_queue_t txdone_queue; - /* Work structures for offloading aynchronous work */ - - struct work_s tx_work; - struct work_s rx_work; - /* Support a singly linked list of transactions that will be sent using the * CSMA algorithm. On a non-beacon enabled PAN, these transactions will be * sent whenever. On a beacon-enabled PAN, these transactions will be sent @@ -183,6 +175,7 @@ struct ieee802154_privmac_s */ sq_queue_t csma_queue; + sq_queue_t gts_queue; /* Support a singly linked list of transactions that will be sent indirectly. * This list should only be used by a MAC acting as a coordinator. These @@ -198,6 +191,14 @@ struct ieee802154_privmac_s sq_queue_t dataind_queue; + /* Work structures for offloading aynchronous work */ + + struct work_s tx_work; + struct work_s rx_work; + struct work_s timeout_work; + + WDOG_ID timeout; /* Timeout watchdog */ + /* MAC PIB attributes, grouped to save memory */ /* Holds all address information (Extended, Short, and PAN ID) for the MAC. */ @@ -238,7 +239,7 @@ struct ieee802154_privmac_s uint8_t beacon_payload[IEEE802154_MAX_BEACON_PAYLOAD_LEN]; uint8_t beacon_payload_len; /* Length of beacon payload */ - uint8_t battlifeext_periods; /* # of backoff periods during which rx is + uint8_t battlifeext_periods; /* # of backoff periods during which rx is * enabled after the IFS following beacon */ uint8_t bsn; /* Seq. num added to tx beacon frame */ @@ -260,6 +261,7 @@ struct ieee802154_privmac_s /* Start of 32-bit bitfield */ + uint32_t trackingbeacon : 1; /* Are we tracking the beacon */ uint32_t isassoc : 1; /* Are we associated to the PAN */ uint32_t assocpermit : 1; /* Are we allowing assoc. as a coord. */ uint32_t autoreq : 1; /* Automatically send data req. if addr @@ -272,8 +274,7 @@ struct ieee802154_privmac_s uint32_t sec_enabled : 1; /* Does MAC sublayer have security en. */ uint32_t timestamp_support : 1; /* Does MAC layer supports timestamping */ - uint32_t max_csmabackoffs : 3; /* Max num backoffs for CSMA algorithm - * before declaring ch access failure */ + /* 2 available bits */ uint32_t beaconorder : 4; /* Freq. that beacon is transmitted */ @@ -308,11 +309,11 @@ struct ieee802154_privmac_s /* What type of device is this node acting as */ enum ieee802154_devmode_e devmode : 2; + + uint32_t max_csmabackoffs : 3; /* Max num backoffs for CSMA algorithm + * before declaring ch access failure */ - bool csma_tryagain : 1; - bool gts_tryagain : 1; - - /* 10-bits remaining */ + /* 9-bits remaining */ /* End of 32-bit bitfield. */ @@ -325,39 +326,66 @@ struct ieee802154_privmac_s /* Internal Functions */ -static inline int mac802154_takesem(sem_t *sem); +static inline int mac802154_takesem(sem_t *sem, bool allow_interrupt); #define mac802154_givesem(s) sem_post(s); +/* Data structure pools and allocation helpers */ + static void mac802154_resetqueues(FAR struct ieee802154_privmac_s *priv); static void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv); -static FAR struct ieee802154_notif_s * - mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv); + +static int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_notif_s **notif, + bool allow_interrupt); + +static inline int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s **txdesc, + bool allow_interrupt); +static void mac802154_txdesc_free(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc); static int mac802154_defaultmib(FAR struct ieee802154_privmac_s *priv); static int mac802154_applymib(FAR struct ieee802154_privmac_s *priv); +/* Watchdog Timeout Functions */ + +static void mac802154_timeout_expiry(int argc, uint32_t arg, ...); + +/* Worker functions */ + static void mac802154_txdone_worker(FAR void *arg); static void mac802154_rxframe_worker(FAR void *arg); +static void mac802154_timeout_worker(FAR void *arg); -static void mac802154_cmd_txdone(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc); +/* Functions for handling tx done for different types of frames */ + +static void mac802154_datareq_txdone(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc); + +static void mac802154_assocreq_txdone(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc); + +/* Functions for processing incoming frames */ + +static void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind); + +/* Helper Functions for sequencing different operations */ + +static FAR struct ieee802154_txdesc_s * + mac802154_assoc_getresp(FAR struct ieee802154_privmac_s *priv); /* IEEE 802.15.4 PHY Interface OPs */ -static int mac802154_poll_csma(FAR const struct ieee802154_radiocb_s *radiocb, - FAR struct ieee802154_txdesc_s **tx_desc, - FAR struct iob_s **frame); - -static int mac802154_poll_gts(FAR const struct ieee802154_radiocb_s *radiocb, - FAR struct ieee802154_txdesc_s **tx_desc, - FAR struct iob_s **frame); +static int mac802154_poll(FAR const struct ieee802154_radiocb_s *radiocb, + bool gts, FAR struct ieee802154_txdesc_s **tx_desc); static void mac802154_txdone(FAR const struct ieee802154_radiocb_s *radiocb, - FAR const struct ieee802154_txdesc_s *tx_desc); + FAR struct ieee802154_txdesc_s *tx_desc); static void mac802154_rxframe(FAR const struct ieee802154_radiocb_s *radiocb, FAR struct ieee802154_data_ind_s *ind); - + /**************************************************************************** * Private Data ****************************************************************************/ @@ -378,18 +406,27 @@ static const uint8_t mac802154_addr_length[4] = {0, 0, 2, 8}; * ****************************************************************************/ -static inline int mac802154_takesem(sem_t *sem) +static inline int mac802154_takesem(sem_t *sem, bool allowinterrupt) { - /* Take a count from the semaphore, possibly waiting */ - - if (sem_wait(sem) < 0) + int ret; + do { - /* EINTR is the only error that we expect */ + /* Take a count from the semaphore, possibly waiting */ - int errcode = get_errno(); - DEBUGASSERT(errcode == EINTR); - return -errcode; + ret = sem_wait(sem); + if (ret < 0) + { + /* EINTR is the only error that we expect */ + + DEBUGASSERT(get_errno() == EINTR); + + if (allowinterrupt) + { + return -EINTR; + } + } } + while (ret != OK); return OK; } @@ -409,21 +446,20 @@ static void mac802154_resetqueues(FAR struct ieee802154_privmac_s *priv) sq_init(&priv->txdone_queue); sq_init(&priv->csma_queue); + sq_init(&priv->gts_queue); sq_init(&priv->indirect_queue); sq_init(&priv->dataind_queue); - sq_init(&priv->notif_queue); + /* Initialize the tx descriptor allocation pool */ + sq_init(&priv->txdesc_queue); - - for (i = 0; i < CONFIG_MAC802154_NNOTIF; i++) - { - sq_addlast((FAR sq_entry_t *)&priv->notif_alloc[i], &priv->notif_queue); - } - for (i = 0; i < CONFIG_MAC802154_NTXDESC; i++) { - sq_addlast((FAR sq_entry_t *)&priv->txdesc_alloc[i], &priv->txdesc_queue); + sq_addlast((FAR sq_entry_t *)&priv->txdesc_pool[i], &priv->txdesc_queue); } + sem_init(&priv->txdesc_sem, 0, CONFIG_MAC802154_NTXDESC); + + /* Initialize the notifcation allocation pool */ mac802154_notifpool_init(priv); } @@ -440,13 +476,13 @@ static void mac802154_resetqueues(FAR struct ieee802154_privmac_s *priv) static void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv) { - FAR struct ieee802154_notif_s *pool = priv->notif_alloc; + FAR struct mac802154_notif_s *pool = priv->notif_pool; int remaining = CONFIG_MAC802154_NNOTIF; priv->notif_free = NULL; while (remaining > 0) { - FAR struct ieee802154_notif_s *notif = pool; + FAR struct mac802154_notif_s *notif = pool; /* Add the next meta data structure from the pool to the list of * general structures. @@ -460,6 +496,7 @@ static void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv) pool++; remaining--; } + sem_init(&priv->notif_sem, 0, CONFIG_MAC802154_NNOTIF); } /**************************************************************************** @@ -474,21 +511,231 @@ static void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv) * Assumptions: * priv MAC struct is locked when calling. * + * Notes: + * If any of the semaphore waits inside this function get interrupted, the + * function will release the MAC layer. If this function returns -EINTR, the + * calling code should NOT release the MAC semaphore. + * ****************************************************************************/ -static FAR struct ieee802154_notif_s * - mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv) + +static int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_notif_s **notif, + bool allow_interrupt) { + int ret; + FAR struct mac802154_notif_s *privnotif; + + /* Try and take a count from the semaphore. If this succeeds, we have + * "reserved" the structure, but still need to unlink it from the free list. + * The MAC is already locked, so there shouldn't be any other conflicting calls + */ + + ret = sem_trywait(&priv->notif_sem); + + if (ret == OK) + { + privnotif = priv->notif_free; + priv->notif_free = privnotif->flink; + } + else + { + /* Unlock MAC so that other work can be done to free a notification */ + + mac802154_givesem(&priv->exclsem); + + /* Take a count from the notification semaphore, waiting if necessary. We + * only return from here with an error if we are allowing interruptions + * and we received a signal */ + + ret = mac802154_takesem(&priv->notif_sem, allow_interrupt); + if (ret < 0) + { + /* MAC sem is already released */ + + return -EINTR; + } + + /* If we've taken a count from the semaphore, we have "reserved" the struct + * but now we need to pop it off of the free list. We need to re-lock the + * MAC in order to ensure this happens correctly. + */ + + ret = mac802154_takesem(&priv->exclsem, allow_interrupt); + if (ret < 0) + { + mac802154_givesem(&priv->notif_sem); + return -EINTR; + } + + /* We can now safely unlink the next free structure from the free list */ + + privnotif = priv->notif_free; + priv->notif_free = privnotif->flink; + } + + *notif = (FAR struct ieee802154_notif_s *)privnotif; + + return OK; +} + +/**************************************************************************** + * Name: mac802154_txdesc_pool + * + * Description: + * This function allocates a tx descriptor and the dependent notification (data + * confirmation) from the free list. The notification and tx descriptor will + * be freed seperately, both by the MAC layer either directly, or through + * mac802154_notif_free in the case of the notification. + * + * Assumptions: + * priv MAC struct is locked when calling. + * + * Notes: + * If any of the semaphore waits inside this function get interrupted, the + * function will release the MAC layer. If this function returns -EINTR, the + * calling code should NOT release the MAC semaphore. + * + ****************************************************************************/ + +static inline int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s **txdesc, + bool allow_interrupt) +{ + int ret; FAR struct ieee802154_notif_s *notif; - if (priv->notif_free == NULL) + /* Try and take a count from the semaphore. If this succeeds, we have + * "reserved" the structure, but still need to unlink it from the free list. + * The MAC is already locked, so there shouldn't be any other conflicting calls + */ + + ret = sem_trywait(&priv->txdesc_sem); + + if (ret == OK) { - return NULL; + *txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->txdesc_queue); + } + else + { + /* Unlock MAC so that other work can be done to free a notification */ + + mac802154_givesem(&priv->exclsem); + + /* Take a count from the tx desc semaphore, waiting if necessary. We + * only return from here with an error if we are allowing interruptions + * and we received a signal */ + + ret = mac802154_takesem(&priv->txdesc_sem, allow_interrupt); + if (ret < 0) + { + /* MAC is already released */ + + return -EINTR; + } + + /* If we've taken a count from the semaphore, we have "reserved" the struct + * but now we need to pop it off of the free list. We need to re-lock the + * MAC in order to ensure this happens correctly. + */ + + ret = mac802154_takesem(&priv->exclsem, allow_interrupt); + if (ret < 0) + { + mac802154_givesem(&priv->txdesc_sem); + return -EINTR; + } + + /* We can now safely unlink the next free structure from the free list */ + + *txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->txdesc_queue); + } + + /* We have now successfully allocated the tx descriptor. Now we need to allocate + * the notification for the data confirmation that gets passed along with the + * tx descriptor. These are allocated together, but not freed together. + */ + + ret = mac802154_notif_alloc(priv, ¬if, allow_interrupt); + if (ret < 0) + { + /* The mac802154_notif_alloc function follows the same rules as this + * function. If it returns -EINTR, the MAC layer is already released + */ + + /* We need to free the txdesc */ + + mac802154_txdesc_free(priv, *txdesc); + return -EINTR; } - notif = priv->notif_free; - priv->notif_free = notif->flink; + (*txdesc)->conf = ¬if->u.dataconf; + + return OK; +} - return notif; +/**************************************************************************** + * Name: mac802154_txdesc_free + * + * Description: + * This function frees a tx descriptor. + * + * Assumptions: + * priv MAC struct is locked when calling. + * + ****************************************************************************/ +static void mac802154_txdesc_free(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) +{ + + sq_addlast((FAR sq_entry_t *)txdesc, &priv->txdesc_queue); + mac802154_givesem(&priv->txdesc_sem); +} + +/**************************************************************************** + * Name: mac802154_symtoticks + * + * Description: + * Helper function for converting symbols to system clock ticks + * + * Assumptions: + * priv MAC struct is locked when calling. + * + ****************************************************************************/ + +static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, + uint32_t symbols) +{ + union ieee802154_attr_u attrval; + uint32_t ret; + + /* First, get the symbol duration from the radio layer. Symbol duration is + * returned in picoseconds to ensure precision is kept when multiplying to + * get overall times. + */ + + priv->radio->get_attr(priv->radio, IEEE802154_PIB_PHY_SYMBOL_DURATION, + &attrval); + + /* After this step, ret represents microseconds */ + + ret = (attrval.phy.symdur_picosec * symbols) / (1000 * 1000); + + /* This method should only be used for things that can be late. For instance, + * it's always okay to wait a little longer before disabling your receiver. + * Therefore, we force the tick count to round up. + */ + + if (ret % USEC_PER_TICK == 0) + { + ret = ret/USEC_PER_TICK; + } + else + { + ret = ret/USEC_PER_TICK; + ret++; + } + + return ret; } /**************************************************************************** @@ -502,7 +749,8 @@ static FAR struct ieee802154_notif_s * static int mac802154_defaultmib(FAR struct ieee802154_privmac_s *priv) { priv->isassoc = false; /* Not associated with a PAN */ - priv->assocpermit = false; /* Device (if coord) not accepting association */ + priv->trackingbeacon = false; /* Not tracking beacon by default */ + priv->assocpermit = false; /* Device (if coord) not accepting ssociation */ priv->autoreq = true; /* Auto send data req if addr. in beacon */ priv->battlifeext = false; /* BLE disabled */ priv->beacon_payload_len = 0; /* Beacon payload NULL */ @@ -575,137 +823,50 @@ static int mac802154_applymib(FAR struct ieee802154_privmac_s *priv) } /**************************************************************************** - * Name: mac802154_poll_csma + * Name: mac802154_poll * * Description: * Called from the radio driver through the callback struct. This function is - * called when the radio has room for another CSMA transaction. If the MAC - * layer has a CSMA transaction, it copies it into the supplied buffer and + * called when the radio has room for another transaction. If the MAC + * layer has a transaction, it copies it into the supplied buffer and * returns the length. A descriptor is also populated with the transaction. * ****************************************************************************/ -static int mac802154_poll_csma(FAR const struct ieee802154_radiocb_s *radiocb, - FAR struct ieee802154_txdesc_s **txdesc, - FAR struct iob_s **frame) +static int mac802154_poll(FAR const struct ieee802154_radiocb_s *radiocb, + bool gts, FAR struct ieee802154_txdesc_s **txdesc) { FAR struct mac802154_radiocb_s *cb = (FAR struct mac802154_radiocb_s *)radiocb; FAR struct ieee802154_privmac_s *priv; - FAR struct mac802154_txtrans_s *trans; - FAR struct ieee802154_txdesc_s *desc; - FAR struct ieee802154_notif_s *notif; DEBUGASSERT(cb != NULL && cb->priv != NULL); priv = cb->priv; - /* Get exclusive access to the driver structure. We don't care about any - * signals so if we see one, just go back to trying to get access again. - */ + /* Get exclusive access to the driver structure. Ignore any EINTR signals */ - while (mac802154_takesem(&priv->exclsem) != 0); + mac802154_takesem(&priv->exclsem, false); - /* Check to see if there are any CSMA transactions waiting */ - - trans = (FAR struct mac802154_txtrans_s *)sq_remfirst(&priv->csma_queue); - mac802154_givesem(&priv->exclsem); - - if (trans != NULL) + if (gts) { - /* Allocate a Tx descriptor to pass */ + /* Check to see if there are any GTS transactions waiting */ - desc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->txdesc_queue); - if (desc == NULL) - { - wlerr("ERROR: Failed to allocate ieee802154_txdesc_s"); - goto errout; - } + *txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->gts_queue); + } + else + { + /* Check to see if there are any CSMA transactions waiting */ - /* Allocate a notif struct (ie data confirmation struct) to pass with - * the tx descriptor. - */ - - notif = mac802154_notif_alloc(priv); - if (notif == NULL) - { - wlerr("ERROR: Failed to allocate ieee802154_notif_s"); - - /* Free the tx descriptor */ - - sq_addlast((FAR sq_entry_t *)desc, &priv->txdesc_queue); - goto errout; - } - - desc->conf = (FAR struct ieee802154_data_conf_s *)notif; - desc->conf->handle = trans->handle; - desc->frametype = trans->frametype; - - *frame = trans->frame; - *txdesc = desc; - - /* Now that we've passed off the data, notify the waiting thread. - * NOTE: The transaction was allocated on the waiting thread's stack so - * it will be automatically deallocated when that thread awakens and - * returns. */ - - sem_post(&trans->sem); - return (trans->frame->io_len); + *txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->csma_queue); } -errout: - /* Need to set flag to tell MAC to retry notifying radio layer about transmit - * since we couldn't allocate the required data structures at this time. - */ - - priv->csma_tryagain = true; - mac802154_givesem(&priv->exclsem); - return 0; -} - -/**************************************************************************** - * Name: mac802154_poll_gts - * - * Description: - * Called from the radio driver through the callback struct. This function is - * called when the radio has room for another GTS transaction. If the MAC - * layer has a GTS transaction, it copies it into the supplied buffer and - * returns the length. A descriptor is also populated with the transaction. - * - ****************************************************************************/ - -static int mac802154_poll_gts(FAR const struct ieee802154_radiocb_s *radiocb, - FAR struct ieee802154_txdesc_s **tx_desc, - FAR struct iob_s **frame) -{ - FAR struct mac802154_radiocb_s *cb = - (FAR struct mac802154_radiocb_s *)radiocb; - FAR struct ieee802154_privmac_s *priv; - FAR struct mac802154_txtrans_s *trans; - FAR struct ieee802154_txdesc_s *desc; - int ret = 0; - - DEBUGASSERT(cb != NULL && cb->priv != NULL); - priv = cb->priv; - - /* Get exclusive access to the driver structure. We don't care about any - * signals so if we see one, just go back to trying to get access again. - */ - - while (mac802154_takesem(&priv->exclsem) != 0); - -#warning Missing logic. - mac802154_givesem(&priv->exclsem); - return 0; - -errout: - /* Need to set flag to tell MAC to retry notifying radio layer about transmit - * since we couldn't allocate the required data structures at this time. - */ - - priv->gts_tryagain = true; - mac802154_givesem(&priv->exclsem); + if (*txdesc != NULL) + { + return (*txdesc)->frame->io_len; + } + return 0; } @@ -723,7 +884,7 @@ errout: ****************************************************************************/ static void mac802154_txdone(FAR const struct ieee802154_radiocb_s *radiocb, - FAR const struct ieee802154_txdesc_s *txdesc) + FAR struct ieee802154_txdesc_s *txdesc) { FAR struct mac802154_radiocb_s *cb = (FAR struct mac802154_radiocb_s *)radiocb; @@ -733,10 +894,10 @@ static void mac802154_txdone(FAR const struct ieee802154_radiocb_s *radiocb, priv = cb->priv; /* Get exclusive access to the driver structure. We don't care about any - * signals so if we see one, just go back to trying to get access again. + * signals so don't allow interruptions */ - while (mac802154_takesem(&priv->exclsem) != 0); + mac802154_takesem(&priv->exclsem, false); sq_addlast((FAR sq_entry_t *)txdesc, &priv->txdone_queue); @@ -766,16 +927,14 @@ static void mac802154_txdone_worker(FAR void *arg) FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)arg; FAR struct ieee802154_txdesc_s *txdesc; - FAR struct ieee802154_data_conf_s *conf; FAR struct ieee802154_notif_s *notif; - enum ieee802154_frametype_e frametype; - int count; + FAR struct mac802154_notif_s *privnotif; /* Get exclusive access to the driver structure. We don't care about any - * signals so if we see one, just go back to trying to get access again. + * signals so don't allow interruptions */ - while (mac802154_takesem(&priv->exclsem) != 0); + mac802154_takesem(&priv->exclsem, false); while (1) { @@ -786,112 +945,510 @@ static void mac802154_txdone_worker(FAR void *arg) break; } - count++; - - /* Once we get the frametype and data confirmation struct, we can free - * the tx descriptor. + /* Cast the data_conf to a notification. We get both the private and public + * notification structure to make it easier to use. */ - conf = txdesc->conf; - frametype = txdesc->frametype; - sq_addlast((FAR sq_entry_t *)txdesc, &priv->txdesc_queue); + privnotif = (FAR struct mac802154_notif_s *)txdesc->conf; + notif = &privnotif->pub; - /* Cast the data_conf to a notification */ - - notif = (FAR struct ieee802154_notif_s *)conf; - - switch(frametype) + switch(txdesc->frametype) { case IEEE802154_FRAME_DATA: { notif->notiftype = IEEE802154_NOTIFY_CONF_DATA; - /* Release the MAC then call the callback */ - + /* Release the MAC, call the callback, get exclusive access again */ mac802154_givesem(&priv->exclsem); priv->cb->notify(priv->cb, notif); + mac802154_takesem(&priv->exclsem, false); } break; - case IEEE802154_FRAME_COMMAND: { - mac802154_cmd_txdone(priv, txdesc); - - /* We can deallocate the data conf notification as it is no longer - * needed. We don't use the public function here since we already - * have the MAC locked. Additionally, we are already handling the - * tx_tryagain here, so we wouldn't want to handle it twice. - */ - - notif->flink = priv->notif_free; - priv->notif_free = notif; - mac802154_givesem(&priv->exclsem); + switch (priv->curr_cmd) + { + case IEEE802154_CMD_ASSOC_REQ: + mac802154_assocreq_txdone(priv, txdesc); + break; + case IEEE802154_CMD_ASSOC_RESP: + break; + case IEEE802154_CMD_DISASSOC_NOT: + break; + case IEEE802154_CMD_DATA_REQ: + mac802154_datareq_txdone(priv, txdesc); + break; + case IEEE802154_CMD_PANID_CONF_NOT: + break; + case IEEE802154_CMD_ORPHAN_NOT: + break; + case IEEE802154_CMD_BEACON_REQ: + break; + case IEEE802154_CMD_COORD_REALIGN: + break; + case IEEE802154_CMD_GTS_REQ: + break; + default: + /* We can deallocate the data conf notification as it is no + * longer needed. We can't use the public function here + * since we already have the MAC locked. + */ + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + mac802154_givesem(&priv->notif_sem); + break; + } } break; - default: { - mac802154_givesem(&priv->exclsem); + /* We can deallocate the data conf notification as it is no longer + * needed. We can't use the public function here since we already + * have the MAC locked. + */ + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + mac802154_givesem(&priv->notif_sem); } break; - } + + /* Free the IOB and the tx descriptor */ + + iob_free(txdesc->frame); + mac802154_txdesc_free(priv, txdesc); } - /* If we've freed a tx descriptor or notification structure and a previous - * attempt at passing data to the radio layer failed due to insufficient - * available structures, try again now that we've freed some resources */ + mac802154_givesem(&priv->exclsem); +} - if (count > 0 && priv->csma_tryagain) +/**************************************************************************** + * Name: mac802154_assocreq_txdone + * + * Description: + * Handle the completion (success/failure) of transmitting an association + * request command. + * + * Assumptions: + * Called with the MAC locked. + * + ****************************************************************************/ + +static void mac802154_assocreq_txdone(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) +{ + enum ieee802154_status_e status; + FAR struct mac802154_notif_s *privnotif = + (FAR struct mac802154_notif_s *)txdesc->conf; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; + FAR struct ieee802154_txdesc_s *respdesc; + + if(txdesc->conf->status != IEEE802154_STATUS_SUCCESS) { - priv->csma_tryagain = false; - priv->radio->ops->txnotify_csma(priv->radio); + /* if the association request command cannot be sent due to a + * channel access failure, the MAC sublayer shall notify the next + * higher layer. [1] pg. 33 + */ + + /* We can actually high-jack the data conf notification since it + * is allocated as an ieee80215_notif_s anyway. Before we overwrite + * any data though, we need to get the status from the data + * confirmation as that is the method we use to get the reason + * why the tx failed from the radio layer. + */ + + status = txdesc->conf->status; + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + + notif->u.assocconf.status = status; + + /* The short device address allocated by the coordinator on + * successful association. This parameter will be equal to 0xffff + * if the association attempt was unsuccessful. [1] pg. 81 + */ + + notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; + + /* We are now done the operation, unlock the semaphore */ + + priv->curr_op = MAC802154_OP_NONE; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC, call the callback, get exclusive access again */ + + mac802154_givesem(&priv->exclsem); + priv->cb->notify(priv->cb, notif); + mac802154_takesem(&priv->exclsem, false); } - - if (count > 0 && priv->gts_tryagain) + else { - priv->gts_tryagain = false; - priv->radio->ops->txnotify_gts(priv->radio); + /* On receipt of the acknowledgment to the association request + * command, the device shall wait for at most macResponseWaitTime + * for the coordinator to make its association decision; the PIB + * attribute macResponseWaitTime is a network-topology-dependent + * parameter and may be set to match the specific requirements of + * the network that a device is trying to join. If the device is + * tracking the beacon, it shall attempt to extract the association + * response command from the coordinator whenever it is indicated in + * the beacon frame. If the device is not tracking the beacon, it + * shall attempt to extract the association response command from + * the coordinator after macResponseWaitTime. [1] pg. 34 + */ + + if (priv->trackingbeacon) + { + /* We are tracking the beacon, so we should see our address in the + * beacon frame within macResponseWaitTime if the coordinator is going + * to respond. Setup a timeout for macResponseWaitTime so that we + * can inform the next highest layer if the association attempt fails + * due to NO_DATA. + */ + + uint32_t ticks = mac802154_symtoticks(priv, + priv->resp_waittime*IEEE802154_BASE_SUPERFRAME_DURATION); + + wd_start(priv->timeout, ticks, mac802154_timeout_expiry, (uint32_t)priv); + } + else + { + /* Send the Data Request MAC command after macResponseWaitTime to + * extract the data from the coordinator. + */ + + respdesc = mac802154_assoc_getresp(priv); + priv->radio->txdelayed(priv->radio, respdesc, + (priv->resp_waittime*IEEE802154_BASE_SUPERFRAME_DURATION)); + } + + /* We can deallocate the data conf notification as it is no longer + * needed. We can't use the public function here since we already + * have the MAC locked. + */ + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + mac802154_givesem(&priv->notif_sem); } } /**************************************************************************** - * Name: mac802154_cmd_txdone + * Name: mac802154_datareq_txdone * * Description: - * Called from mac802154_txdone_worker, this is a helper function for - * handling command frames that have either successfully sent or failed. + * Handle the completion (success/failure) of transmitting a data request + * command. + * + * Assumptions: + * Called with the MAC locked. * ****************************************************************************/ -static void mac802154_cmd_txdone(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc) +static void mac802154_datareq_txdone(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) { + enum ieee802154_status_e status; + FAR struct mac802154_notif_s *privnotif = + (FAR struct mac802154_notif_s *)txdesc->conf; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; - /* Check to see what type of command it was. All information about the command - * will still be valid because it is protected by a semaphore. + /* Data requests can be sent for 3 different reasons. + * + * 1. On a beacon-enabled PAN, this command shall be sent by a device when + * macAutoRequest is equal to TRUE and a beacon frame indicating that + * data are pending for that device is received from its coordinator. + * 2. when instructed to do so by the next higher layer on reception of the + * MLME-POLL.request primitive. + * 3. a device may send this command to the coordinator macResponseWaitTime + * after the acknowledgment to an association request command. */ - switch (priv->cmd.type) + switch (priv->curr_op) { - case IEEE802154_CMD_ASSOC_REQ: - if(txdesc->conf->status != IEEE802154_STATUS_SUCCESS) - { - /* if the association request command cannot be sent due to a - * channel access failure, the MAC sublayer shall notify the next - * higher layer. [1] pg. 33 - */ + case MAC802154_OP_ASSOC: + { + /* If the data request failed to be sent, notify the next layer + * that the association has failed. + * OR + * On receipt of the Ack frame with the Frame Pending field set + * to zero, the device shall conclude that there are no data + * pending at the coordinator. [1] pg. 43 + */ + if(notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS || + txdesc->framepending == 0) + { + if (notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS) + { + status = notif->u.dataconf.status; + } + else + { + /* If the device does not extract an association response + * command frame from the coordinator within macResponseWaitTime, + * the MLME shall issue the MLME-ASSOCIATE.confirm primitive, + * as described in 6.2.2.4, with a status of NO_DATA, and the + * association attempt shall be deemed a failure. [1] pg. 34 + */ - } - else - { - priv->cmd.txdone = true; - } + status = IEEE802154_STATUS_NO_DATA; + } + + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + notif->u.assocconf.status = status; + + /* The short device address allocated by the coordinator on + * successful association. This parameter will be equal to 0xffff + * if the association attempt was unsuccessful. [1] pg. 81 + */ + + notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; + + /* We are now done the operation, and can release the command */ + + priv->curr_op = MAC802154_OP_NONE; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC, call the callback, get exclusive access again */ + + mac802154_givesem(&priv->exclsem); + priv->cb->notify(priv->cb, notif); + mac802154_takesem(&priv->exclsem, false); + + /* Return here so that the notification doesn't get freed */ + + return; + } + else + { + /* On receipt of the acknowledgment frame with the Frame + * Pending field set to one, a device shall enable its + * receiver for at most macMaxFrameTotalWaitTime to receive + * the corresponding data frame from the coordinator. [1] pg.43 + */ + + priv->radio->rxenable(priv->radio, true); + + /* Start a watchdog, if we receive the data frame, we will cancel + * the timer, otherwise it will expire and we will notify the + * next highest layer of the failure. + */ + + wd_start(priv->timeout, + mac802154_symtoticks(priv, priv->max_frame_waittime), + mac802154_timeout_expiry, 1, (uint32_t)priv); + } + } + break; + case MAC802154_OP_POLL: break; default: break; } + + /* We can deallocate the data conf notification as it is no longer + * needed. We can't use the public function here since we already + * have the MAC locked. + */ + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + mac802154_givesem(&priv->notif_sem); +} + +/**************************************************************************** + * Function: mac802154_timeout_expiry + * + * Description: + * The watchdog timed out. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void mac802154_timeout_expiry(int argc, uint32_t arg, ...) +{ + FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)arg; + + /* There should never be a case where the timeout is used twice at the same + * time. */ + + DEBUGASSERT(work_available(&priv->timeout_work)); + + work_queue(MAC802154_WORK, &priv->timeout_work, mac802154_timeout_worker, priv, 0); +} + +/**************************************************************************** + * Name: mac802154_timeout_worker + * + * Description: + * Worker function scheduled from mac802154_timeout_expiry. This function + * handles any timeouts that occur during various MAC operations. + * + ****************************************************************************/ + +static void mac802154_timeout_worker(FAR void *arg) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)arg; + FAR struct ieee802154_notif_s *notif; + + switch (priv->curr_op) + { + case MAC802154_OP_ASSOC: + { + /* If the device does not extract an association response command + * frame from the coordinator within macResponseWaitTime, the MLME + * shall issue the MLME-ASSOCIATE.confirm primitive, as described + * in 6.2.2.4, with a status of NO_DATA, and the association attempt + * shall be deemed a failure. [1] pg. 33 + */ + + /* Allocate a notification struct to pass to the next highest layer. + * Don't allow EINTR to interrupt. + */ + + mac802154_takesem(&priv->exclsem, false); + mac802154_notif_alloc(priv, ¬if, false); + + /* We are no longer performing the association operation */ + priv->curr_op = MAC802154_OP_NONE; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC */ + + mac802154_givesem(&priv->exclsem); + + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + notif->u.assocconf.status = IEEE802154_STATUS_NO_DATA; + notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; + + priv->cb->notify(priv->cb, notif); + } + break; + default: + wlwarn("Timeout occured for unknown reason!"); + break; + } +} + +/**************************************************************************** + * Name: mac802154_assoc_getresp + * + * Description: + * Send a data request to the coordinator to extract the association response. + * + * Assumptions: + * MAC is locked when called. + * + * TODO: Can this be used for general data extraction? + * + ****************************************************************************/ + +static FAR struct ieee802154_txdesc_s * + mac802154_assoc_getresp(FAR struct ieee802154_privmac_s *priv) +{ + FAR struct iob_s *iob; + FAR struct ieee802154_txdesc_s *txdesc; + FAR uint16_t *u16; + + /* Allocate an IOB to put the frame in */ + + iob = iob_alloc(false); + DEBUGASSERT(iob != NULL); + + iob->io_flink = NULL; + iob->io_len = 0; + iob->io_offset = 0; + iob->io_pktlen = 0; + + /* Allocate a tx descriptor */ + + mac802154_txdesc_alloc(priv, &txdesc, false); + + priv->curr_cmd = IEEE802154_CMD_DATA_REQ; + + /* Get a uin16_t reference to the first two bytes. ie frame control field */ + + u16 = (FAR uint16_t *)&iob->io_data[0]; + + *u16 = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); + *u16 |= IEEE802154_FRAMECTRL_ACKREQ; + *u16 |= (priv->coordaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); + *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); + + /* If the Destination Addressing Mode field is set to indicate that + * destination addressing information is not present, the PAN ID Compression + * field shall be set to zero and the source PAN identifier shall contain the + * value of macPANId. Otherwise, the PAN ID Compression field shall be set to + * one. In this case and in accordance with the PAN ID Compression field, the + * Destination PAN Identifier field shall contain the value of macPANId, while + * the Source PAN Identifier field shall be omitted. [1] pg. 72 + * + * The destination address for a data request to extract an assoication request + * should never be set to none. So we always set the PAN ID compression field + */ + + DEBUGASSERT(priv->coordaddr.mode != IEEE802154_ADDRMODE_NONE); + + *u16 |= IEEE802154_FRAMECTRL_PANIDCOMP; + + iob->io_len = 2; + + /* Each time a data or a MAC command frame is generated, the MAC sublayer + * shall copy the value of macDSN into the Sequence Number field of the + * MHR of the outgoing frame and then increment it by one. [1] pg. 40. + */ + + iob->io_data[iob->io_len++] = priv->dsn++; + + /* The Destination PAN Identifier field shall contain the identifier of + * the PAN to which to associate. [1] pg. 68 + */ + + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.panid, 2); + + /* The Destination Address field shall contain the address from the + * beacon frame that was transmitted by the coordinator to which the + * association request command is being sent. [1] pg. 68 + */ + + if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.saddr, 2); + iob->io_len += 2; + } + else if (priv->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) + { + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.eaddr[0], + IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + } + + /* The Source Address field shall contain the value of macExtendedAddress. */ + + memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], + IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + + /* Copy in the Command Frame Identifier */ + + iob->io_data[iob->io_len++] = IEEE802154_CMD_DATA_REQ; + + /* Copy the IOB reference to the descriptor */ + + txdesc->frame = iob; + + return txdesc; } /**************************************************************************** @@ -922,7 +1479,7 @@ static void mac802154_rxframe(FAR const struct ieee802154_radiocb_s *radiocb, * signals so if we see one, just go back to trying to get access again. */ - while (mac802154_takesem(&priv->exclsem) != 0); + mac802154_takesem(&priv->exclsem, false); /* Push the iob onto the tail of the frame list for processing */ @@ -966,22 +1523,21 @@ static void mac802154_rxframe_worker(FAR void *arg) * signals so if we see one, just go back to trying to get access again. */ - while (mac802154_takesem(&priv->exclsem) != 0); + mac802154_takesem(&priv->exclsem, false); /* Push the iob onto the tail of the frame list for processing */ ind = (FAR struct ieee802154_data_ind_s *)sq_remfirst(&priv->dataind_queue); - if (ind == NULL) - { - mac802154_givesem(&priv->exclsem); - break; - } - /* Once we pop off the indication, we don't need to keep the mac locked */ mac802154_givesem(&priv->exclsem); + if (ind == NULL) + { + return; + } + /* Get a local copy of the frame to make it easier to access */ frame = ind->frame; @@ -1086,130 +1642,150 @@ static void mac802154_rxframe_worker(FAR void *arg) } else if (ftype == IEEE802154_FRAME_COMMAND) { + /* Get the command type. The command type is always the first + * field after the MHR. Consume the byte by increasing offset so that + * subsequent functions can start from the byte after the command ID. + */ + uint8_t cmdtype = frame->io_data[frame->io_offset++]; + + switch (cmdtype) + { + case IEEE802154_CMD_ASSOC_REQ: + break; + case IEEE802154_CMD_ASSOC_RESP: + { + mac802154_rx_assocresp(priv, ind); + } + break; + case IEEE802154_CMD_DISASSOC_NOT: + break; + case IEEE802154_CMD_DATA_REQ: + break; + case IEEE802154_CMD_PANID_CONF_NOT: + break; + case IEEE802154_CMD_ORPHAN_NOT: + break; + case IEEE802154_CMD_BEACON_REQ: + break; + case IEEE802154_CMD_COORD_REALIGN: + break; + case IEEE802154_CMD_GTS_REQ: + break; + } + + /* Free the data indication struct from the pool */ + + ieee802154_ind_free(ind); } else if (ftype == IEEE802154_FRAME_BEACON) { + /* TODO: Add logic here to handle extracting association response from + * coordinator if beacon tracking was enabled during the Association + * operation. + * + * txdesc = mac802154_assoc_getresp(priv); + * sq_addlast((FAR sq_entry_t *)txdesc, &priv->csma_queue); + */ } else { - /* The radio layer is responsible for handling all ACKs and retries. If for - * some reason an ACK gets here, just throw it out. + /* The radio layer is responsible for handling all ACKs and retries. + * If for some reason an ACK gets here, just throw it out. */ } } } /**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: mac802154_create + * Name: mac802154_rxframe_worker * * Description: - * Create a 802.15.4 MAC device from a 802.15.4 compatible radio device. + * Worker function scheduled from mac802154_rxframe. This function processes + * any frames in the list. Frames intended to be consumed by the MAC layer + * will not produce any callbacks to the next highest layer. Frames intended + * for the application layer will be forwarded to them. * - * The returned MAC structure should be passed to either the next highest - * layer in the network stack, or registered with a mac802154dev character - * or network drivers. In any of these scenarios, the next highest layer - * should register a set of callbacks with the MAC layer by setting the - * mac->cbs member. - * - * NOTE: This API does not create any device accessible to userspace. If - * you want to call these APIs from userspace, you have to wrap your mac - * in a character device via mac802154_device.c. - * - * Input Parameters: - * radiodev - an instance of an IEEE 802.15.4 radio - * - * Returned Value: - * An opaque reference to the MAC state data. + * Assumptions: + * Called with the MAC unlocked * ****************************************************************************/ -MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev) +static void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind) { - FAR struct ieee802154_privmac_s *mac; - FAR struct ieee802154_radiocb_s *radiocb; + FAR struct iob_s *frame = ind->frame; + FAR struct ieee802154_notif_s *notif; - /* Allocate object */ + /* Check if we are performing an Association operation, if not, we will just + * ignore the frame. + */ - mac = (FAR struct ieee802154_privmac_s *) - kmm_zalloc(sizeof(struct ieee802154_privmac_s)); - - if (mac == NULL) + if (priv->curr_op != MAC802154_OP_ASSOC) { - return NULL; + return; + } + + /* Cancel the timeout used if we didn't get a response */ + + wd_cancel(priv->timeout); + + /* Get exclusive access to the MAC */ + + mac802154_takesem(&priv->exclsem, false); + + /* Allocate a notification to pass to the next highest layer */ + + mac802154_notif_alloc(priv, ¬if, false); + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + + /* Parse the short address from the response */ + + priv->addr.saddr = (uint16_t)(frame->io_data[frame->io_offset]); + frame->io_offset += 2; + + /* A Short Address field value equal to 0xfffe shall indicate that the device + * has been successfully associated with a PAN but has not been allocated a + * short address. In this case, the device shall communicate on the PAN using + * only its extended address. [1] pg. 70 + */ + + if (priv->addr.saddr == IEEE802154_SADDR_BCAST) + { + /* TODO: Figure out if this is sufficient */ + + priv->addr.mode = IEEE802154_ADDRMODE_SHORT; + } + + /* Parse the status from the response */ + + notif->u.assocconf.status = frame->io_data[frame->io_offset++]; + + if (notif->u.assocconf.status == IEEE802154_STATUS_SUCCESS) + { + priv->isassoc = true; + } + else + { + priv->isassoc = false; } - /* Allow exclusive access to the privmac struct */ + notif->u.assocconf.saddr = priv->addr.saddr; - sem_init(&mac->exclsem, 0, 1); + /* Unlock the MAC */ - /* Allow exlusive access to the dedicated command transaction */ + mac802154_givesem(&priv->exclsem); - sem_init(&mac->cmd.sem, 0, 1); + /* Notify the next highest layer of the association status */ - /* Setup the signaling semaphore for the dedicated command transaction */ - - sem_init(&mac->cmd.trans.sem, 0, 0); - sem_setprotocol(&mac->cmd.trans.sem, SEM_PRIO_NONE); - - /* Initialize fields */ - - mac->radio = radiodev; - - mac802154_defaultmib(mac); - mac802154_applymib(mac); - - /* Initialize the Radio callbacks */ - - mac->radiocb.priv = mac; - - radiocb = &mac->radiocb.cb; - radiocb->poll_csma = mac802154_poll_csma; - radiocb->poll_gts = mac802154_poll_gts; - radiocb->txdone = mac802154_txdone; - radiocb->rxframe = mac802154_rxframe; - - /* Bind our callback structure */ - - radiodev->ops->bind(radiodev, &mac->radiocb.cb); - - /* Initialize our various data pools */ - - ieee802154_indpool_initialize(); - mac802154_resetqueues(mac); - - return (MACHANDLE)mac; + priv->cb->notify(priv->cb, notif); } /**************************************************************************** - * Name: mac802154_bind - * - * Description: - * Bind the MAC callback table to the MAC state. - * - * Parameters: - * mac - Reference to the MAC driver state structure - * cb - MAC callback operations - * - * Returned Value: - * OK on success; Negated errno on failure. - * + * Public Functions ****************************************************************************/ -int mac802154_bind(MACHANDLE mac, FAR const struct mac802154_maccb_s *cb) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - - priv->cb = cb; - return OK; -} - /**************************************************************************** * Name: mac802154_ioctl * @@ -1419,7 +1995,7 @@ int mac802154_req_data(MACHANDLE mac, { FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac; - FAR struct mac802154_txtrans_s trans; + FAR struct ieee802154_txdesc_s *txdesc; uint16_t *frame_ctrl; uint8_t mhr_len = 3; /* Start assuming frame control and seq. num */ int ret; @@ -1488,10 +2064,9 @@ int mac802154_req_data(MACHANDLE mac, /* From this point on, we need exclusive access to the privmac struct */ - ret = mac802154_takesem(&priv->exclsem); + ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { - wlerr("ERROR: mac802154_takesem failed: %d\n", ret); return ret; } @@ -1562,13 +2137,17 @@ int mac802154_req_data(MACHANDLE mac, frame->io_offset = 0; /* Set the offset to 0 to include the header */ - /* Setup our transaction */ + /* Allocate the txdesc, waiting if necessary, allow interruptions */ - trans.handle = meta->msdu_handle; - trans.frametype = IEEE802154_FRAME_DATA; - trans.frame = frame; - sem_init(&trans.sem, 0, 0); - sem_setprotocol(&trans.sem, SEM_PRIO_NONE); + ret = mac802154_txdesc_alloc(priv, &txdesc, true); + if (ret < 0) + { + return ret; + } + + txdesc->conf->handle = meta->msdu_handle; + txdesc->frame = frame; + txdesc->frametype = IEEE802154_FRAME_DATA; /* If the TxOptions parameter specifies that a GTS transmission is required, * the MAC sublayer will determine whether it has a valid GTS as described @@ -1591,6 +2170,10 @@ int mac802154_req_data(MACHANDLE mac, * don't have to try and kick-off any transmission here. */ + /* We no longer need to have the MAC layer locked. */ + + mac802154_givesem(&priv->exclsem); + return -ENOTSUP; } else @@ -1613,14 +2196,16 @@ int mac802154_req_data(MACHANDLE mac, * error, since this really shouldn't be happening. */ - if (priv->devmode == IEEE802154_DEVMODE_PANCOORD && + if (priv->devmode == IEEE802154_DEVMODE_COORD && meta->dest_addr.mode != IEEE802154_ADDRMODE_NONE) { /* Link the transaction into the indirect_trans list */ + mac802154_givesem(&priv->exclsem); } else { + mac802154_givesem(&priv->exclsem); return -EINVAL; } } @@ -1628,7 +2213,7 @@ int mac802154_req_data(MACHANDLE mac, { /* Link the transaction into the CSMA transaction list */ - sq_addlast((FAR sq_entry_t *)&trans, &priv->csma_queue); + sq_addlast((FAR sq_entry_t *)txdesc, &priv->csma_queue); /* We no longer need to have the MAC layer locked. */ @@ -1636,17 +2221,10 @@ int mac802154_req_data(MACHANDLE mac, /* Notify the radio driver that there is data available */ - priv->radio->ops->txnotify_csma(priv->radio); - - ret = sem_wait(&trans.sem); - if (ret < 0) - { - return -EINTR; - } + priv->radio->txnotify(priv->radio, false); } } - sem_destroy(&trans.sem); return OK; } @@ -1681,6 +2259,11 @@ int mac802154_req_purge(MACHANDLE mac, uint8_t msdu_handle) * association with a coordinator. Confirmation is returned via the * struct mac802154_maccb_s->conf_associate callback. * + * On receipt of the MLME-ASSOCIATE.request primitive, the MLME of an + * unassociated device first updates the appropriate PHY and MAC PIB + * attributes, as described in 5.1.3.1, and then generates an association + * request command, as defined in 5.3.1 [1] pg.80 + * ****************************************************************************/ int mac802154_req_associate(MACHANDLE mac, @@ -1688,56 +2271,50 @@ int mac802154_req_associate(MACHANDLE mac, { FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac; - FAR struct mac802154_txtrans_s trans; + FAR struct ieee802154_txdesc_s *txdesc; FAR struct iob_s *iob; FAR uint16_t *u16; bool rxonidle; int ret; - /* On receipt of the MLME-ASSOCIATE.request primitive, the MLME of an - * unassociated device first updates the appropriate PHY and MAC PIB - * attributes, as described in 5.1.3.1, and then generates an association - * request command, as defined in 5.3.1 [1] pg.80 + /* Get exlusive access to the operation sempaphore. This must happen before + * getting exclusive access to the MAC struct or else there could be a lockup + * condition. This would occur if another thread is using the cmdtrans but + * needs access to the MAC in order to unlock it. */ - /* Get exlusive access to the shared command transaction. This must happen - * before getting exclusive access to the MAC struct or else there could be - * a lockup condition. This would occur if another thread is using the cmdtrans - * but needs access to the MAC in order to unlock it. - */ - - if (sem_wait(&priv->cmd.sem) < 0) + ret = mac802154_takesem(&priv->op_sem, true); + if (ret < 0) { - /* EINTR is the only error that we expect */ - - int errcode = get_errno(); - DEBUGASSERT(errcode == EINTR); - return -errcode; + return ret; } + priv->curr_op = MAC802154_OP_ASSOC; + priv->curr_cmd = IEEE802154_CMD_ASSOC_REQ; + /* Get exclusive access to the MAC */ - ret = mac802154_takesem(&priv->exclsem); + ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { - wlerr("ERROR: mac802154_takesem failed: %d\n", ret); + mac802154_givesem(&priv->op_sem); return ret; } /* Set the channel and channel page of the PHY layer */ - priv->radio->ops->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_CHANNEL, - (FAR const union ieee802154_attr_u *)&req->chnum); + priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_CHANNEL, + (FAR const union ieee802154_attr_u *)&req->chnum); - priv->radio->ops->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_PAGE, - (FAR const union ieee802154_attr_u *)&req->chpage); + priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_PAGE, + (FAR const union ieee802154_attr_u *)&req->chpage); /* Set the PANID attribute */ priv->addr.panid = req->coordaddr.panid; priv->coordaddr.panid = req->coordaddr.panid; - priv->radio->ops->set_attr(priv->radio, IEEE802154_PIB_MAC_PANID, - (FAR const union ieee802154_attr_u *)&req->coordaddr.panid); + priv->radio->set_attr(priv->radio, IEEE802154_PIB_MAC_PANID, + (FAR const union ieee802154_attr_u *)&req->coordaddr.panid); /* Set the coordinator address attributes */ @@ -1774,8 +2351,8 @@ int mac802154_req_associate(MACHANDLE mac, */ rxonidle = req->capabilities.rxonidle; - priv->radio->ops->set_attr(priv->radio, IEEE802154_PIB_MAC_RX_ON_WHEN_IDLE, - (FAR const union ieee802154_attr_u *)&rxonidle); + priv->radio->set_attr(priv->radio, IEEE802154_PIB_MAC_RX_ON_WHEN_IDLE, + (FAR const union ieee802154_attr_u *)&rxonidle); /* Allocate an IOB to put the frame in */ @@ -1787,6 +2364,16 @@ int mac802154_req_associate(MACHANDLE mac, iob->io_offset = 0; iob->io_pktlen = 0; + /* Allocate the txdesc, waiting if necessary */ + + ret = mac802154_txdesc_alloc(priv, &txdesc, true); + if (ret < 0) + { + mac802154_givesem(&priv->exclsem); + mac802154_givesem(&priv->op_sem); + return ret; + } + /* Get a uin16_t reference to the first two bytes. ie frame control field */ u16 = (FAR uint16_t *)&iob->io_data[0]; @@ -1860,35 +2447,16 @@ int mac802154_req_associate(MACHANDLE mac, iob->io_len++; - /* Copy reference to the frame into the shared command transaction */ - - priv->cmd.trans.frame = iob; - priv->cmd.trans.frametype = IEEE802154_FRAME_COMMAND; - priv->cmd.type = IEEE802154_CMD_ASSOC_REQ; - - /* Link the transaction into the CSMA transaction list */ - - sq_addlast((FAR sq_entry_t *)&trans, &priv->csma_queue); + txdesc->frame = iob; + txdesc->frametype = IEEE802154_FRAME_COMMAND; /* We no longer need to have the MAC layer locked. */ mac802154_givesem(&priv->exclsem); - /* TODO: Need to setup a timeout here so that we can return an error to the - * user if the device never receives a response. - */ + /* Association Request commands get sent out immediately */ - /* Notify the radio driver that there is data available */ - - priv->radio->ops->txnotify_csma(priv->radio); - - /* Wait for the transaction to be passed to the radio layer */ - - ret = sem_wait(&priv->cmd.trans.sem); - if (ret < 0) - { - return -EINTR; - } + priv->radio->txdelayed(priv->radio, txdesc, 0); return OK; @@ -2058,7 +2626,7 @@ int mac802154_req_set(MACHANDLE mac, enum ieee802154_pib_attr_e pib_attr, /* Tell the radio about the attribute */ - priv->radio->ops->set_attr(priv->radio, pib_attr, attrval); + priv->radio->set_attr(priv->radio, pib_attr, attrval); ret = IEEE802154_STATUS_SUCCESS; } @@ -2069,7 +2637,7 @@ int mac802154_req_set(MACHANDLE mac, enum ieee802154_pib_attr_e pib_attr, * it along. */ - ret = priv->radio->ops->set_attr(priv->radio, pib_attr, attrval); + ret = priv->radio->set_attr(priv->radio, pib_attr, attrval); } break; } @@ -2094,10 +2662,9 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) /* Get exclusive access to the MAC */ - ret = mac802154_takesem(&priv->exclsem); + ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { - wlerr("ERROR: mac802154_takesem failed: %d\n", ret); return ret; } @@ -2121,15 +2688,15 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) /* Set the PANID attribute */ priv->addr.panid = req->panid; - priv->radio->ops->set_attr(priv->radio, IEEE802154_PIB_MAC_PANID, - (FAR const union ieee802154_attr_u *)&req->panid); + priv->radio->set_attr(priv->radio, IEEE802154_PIB_MAC_PANID, + (FAR const union ieee802154_attr_u *)&req->panid); /* Set the radio attributes */ - priv->radio->ops->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_CHANNEL, - (FAR const union ieee802154_attr_u *)&req->chnum); + priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_CHANNEL, + (FAR const union ieee802154_attr_u *)&req->chnum); - priv->radio->ops->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_PAGE, - (FAR const union ieee802154_attr_u *)&req->chpage); + priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_PAGE, + (FAR const union ieee802154_attr_u *)&req->chpage); /* Set the superframe order */ @@ -2171,7 +2738,7 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) priv->battlifeext = req->battlifeext; /* TODO: Finish starting beacon enabled network */ - return -ENOTTY; + return -ENOTTY; } mac802154_givesem(&priv->exclsem); @@ -2268,27 +2835,135 @@ int mac802154_notif_free(MACHANDLE mac, { FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac; + FAR struct mac802154_notif_s *privnotif = (FAR struct mac802154_notif_s *)notif; /* Get exclusive access to the MAC */ - while(mac802154_takesem(&priv->exclsem) < 0); + mac802154_takesem(&priv->exclsem, false); - notif->flink = priv->notif_free; - priv->notif_free = notif; + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + mac802154_givesem(&priv->notif_sem); mac802154_givesem(&priv->exclsem); - if (priv->csma_tryagain) - { - priv->csma_tryagain = false; - priv->radio->ops->txnotify_csma(priv->radio); - } - - if (priv->gts_tryagain) - { - priv->gts_tryagain = false; - priv->radio->ops->txnotify_gts(priv->radio); - } - return -ENOTTY; } + +/**************************************************************************** + * Name: mac802154_create + * + * Description: + * Create a 802.15.4 MAC device from a 802.15.4 compatible radio device. + * + * The returned MAC structure should be passed to either the next highest + * layer in the network stack, or registered with a mac802154dev character + * or network drivers. In any of these scenarios, the next highest layer + * should register a set of callbacks with the MAC layer by setting the + * mac->cbs member. + * + * NOTE: This API does not create any device accessible to userspace. If + * you want to call these APIs from userspace, you have to wrap your mac + * in a character device via mac802154_device.c. + * + * Input Parameters: + * radiodev - an instance of an IEEE 802.15.4 radio + * + * Returned Value: + * An opaque reference to the MAC state data. + * + ****************************************************************************/ + +MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev) +{ + FAR struct ieee802154_privmac_s *mac; + FAR struct ieee802154_radiocb_s *radiocb; + uint8_t eaddr[IEEE802154_EADDR_LEN]; + int i; + + /* Allocate object */ + + mac = (FAR struct ieee802154_privmac_s *) + kmm_zalloc(sizeof(struct ieee802154_privmac_s)); + + if (mac == NULL) + { + return NULL; + } + + /* Allow exclusive access to the privmac struct */ + + sem_init(&mac->exclsem, 0, 1); + + /* Allow exclusive access to the dedicated command transaction */ + + sem_init(&mac->op_sem, 0, 1); + + /* Setup watchdog for extraction timeout */ + + mac->timeout = wd_create(); + + /* Initialize fields */ + + mac->radio = radiodev; + + mac802154_defaultmib(mac); + mac802154_applymib(mac); + + /* Initialize the Radio callbacks */ + + mac->radiocb.priv = mac; + + radiocb = &mac->radiocb.cb; + radiocb->poll = mac802154_poll; + radiocb->txdone = mac802154_txdone; + radiocb->rxframe = mac802154_rxframe; + + /* Bind our callback structure */ + + radiodev->bind(radiodev, &mac->radiocb.cb); + + /* Initialize our various data pools */ + + ieee802154_indpool_initialize(); + mac802154_resetqueues(mac); + + /* Set the default extended address */ + + for (i = 0; i < IEEE802154_EADDR_LEN; i++) + { + eaddr[i] = (CONFIG_IEEE802154_DEFAULT_EADDR >> (8 * i)) & 0xFF; + } + + memcpy(&mac->addr.eaddr, &eaddr[0], IEEE802154_EADDR_LEN); + mac->radio->set_attr(mac->radio, IEEE802154_PIB_MAC_EXTENDED_ADDR, + (union ieee802154_attr_u *)&eaddr[0]); + + return (MACHANDLE)mac; +} + +/**************************************************************************** + * Name: mac802154_bind + * + * Description: + * Bind the MAC callback table to the MAC state. + * + * Parameters: + * mac - Reference to the MAC driver state structure + * cb - MAC callback operations + * + * Returned Value: + * OK on success; Negated errno on failure. + * + ****************************************************************************/ + +int mac802154_bind(MACHANDLE mac, FAR const struct mac802154_maccb_s *cb) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + + priv->cb = cb; + return OK; +} + + diff --git a/wireless/ieee802154/mac802154.h b/wireless/ieee802154/mac802154.h index 2e8110f755..724b80482c 100644 --- a/wireless/ieee802154/mac802154.h +++ b/wireless/ieee802154/mac802154.h @@ -58,8 +58,6 @@ * Public Data Types ****************************************************************************/ - - /* Callback operations to notify the next highest layer of various asynchronous * events, usually triggered by some previous request or response invoked by the * upper layer. diff --git a/wireless/ieee802154/mac802154_device.c b/wireless/ieee802154/mac802154_device.c index a41ff240bf..b1bcd749fb 100644 --- a/wireless/ieee802154/mac802154_device.c +++ b/wireless/ieee802154/mac802154_device.c @@ -600,6 +600,8 @@ static ssize_t mac802154dev_write(FAR struct file *filep, ret = mac802154_req_data(dev->md_mac, &tx->meta, iob); if (ret < 0) { + /* TODO: Should the IOB be freed here? */ + wlerr("ERROR: req_data failed %d\n", ret); return ret; } @@ -616,7 +618,7 @@ static ssize_t mac802154dev_write(FAR struct file *filep, ****************************************************************************/ static int mac802154dev_ioctl(FAR struct file *filep, int cmd, - unsigned long arg) + unsigned long arg) { FAR struct inode *inode; FAR struct mac802154_chardevice_s *dev; From 8ae5450268934014c8e630c7081c5ac92ee68392 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 07:21:01 -0600 Subject: [PATCH 14/55] pthreads: Move pthread_yield from sched/pthreads to libc/pthreads. it is a simple wrapper for sched_yield and does not belong within the OS. --- configs/b-l475e-iot01a/README.txt | 3 +++ include/sys/syscall.h | 3 +-- libc/libc.csv | 1 + libc/pthread/Make.defs | 1 + {sched => libc}/pthread/pthread_yield.c | 4 ++-- sched/pthread/Make.defs | 2 +- syscall/syscall.csv | 1 - syscall/syscall_lookup.h | 1 - syscall/syscall_stublookup.c | 1 - 9 files changed, 9 insertions(+), 8 deletions(-) rename {sched => libc}/pthread/pthread_yield.c (96%) diff --git a/configs/b-l475e-iot01a/README.txt b/configs/b-l475e-iot01a/README.txt index e99c3a9503..013ac41fbf 100644 --- a/configs/b-l475e-iot01a/README.txt +++ b/configs/b-l475e-iot01a/README.txt @@ -27,6 +27,9 @@ STATUS NuttX. But no work has yet been done for this board port other than writing this README file. + o 2017-06-13: I just learned that development boards will not be + available for another month. + Board Features ============== diff --git a/include/sys/syscall.h b/include/sys/syscall.h index 6f1911c6c4..3f21f74d73 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -430,8 +430,7 @@ # define SYS_pthread_setschedparam (__SYS_pthread_once+1) # define SYS_pthread_setschedprio (__SYS_pthread_once+2) # define SYS_pthread_setspecific (__SYS_pthread_once+3) -# define SYS_pthread_yield (__SYS_pthread_once+4) -# define __SYS_pthread_smp (__SYS_pthread_once+5) +# define __SYS_pthread_smp (__SYS_pthread_once+4) # ifdef CONFIG_SMP # define SYS_pthread_setaffinity_np (__SYS_pthread_smp+0) diff --git a/libc/libc.csv b/libc/libc.csv index 02cf739bd3..89bc65c0b0 100644 --- a/libc/libc.csv +++ b/libc/libc.csv @@ -117,6 +117,7 @@ "pthread_mutexattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *" "pthread_mutexattr_setpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *","int " "pthread_mutexattr_settype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_PTHREAD_MUTEX_TYPES)","int","pthread_mutexattr_t *","int" +"pthread_yield","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void" "puts","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR const char *" "qsort","stdlib.h","","void","void *","size_t","size_t","int(*)(const void *","FAR const void *)" "rand","stdlib.h","","int" diff --git a/libc/pthread/Make.defs b/libc/pthread/Make.defs index 291dfdfd4e..5cd35f0255 100644 --- a/libc/pthread/Make.defs +++ b/libc/pthread/Make.defs @@ -53,6 +53,7 @@ CSRCS += pthread_mutexattr_setrobust.c pthread_mutexattr_getrobust.c CSRCS += pthread_setcancelstate.c pthread_setcanceltype.c CSRCS += pthread_testcancel.c CSRCS += pthread_rwlock.c pthread_rwlock_rdlock.c pthread_rwlock_wrlock.c +CSRCS += pthread_yield.c ifeq ($(CONFIG_SMP),y) CSRCS += pthread_attr_getaffinity.c pthread_attr_setaffinity.c diff --git a/sched/pthread/pthread_yield.c b/libc/pthread/pthread_yield.c similarity index 96% rename from sched/pthread/pthread_yield.c rename to libc/pthread/pthread_yield.c index 0577e21f83..2af7ea2b93 100644 --- a/sched/pthread/pthread_yield.c +++ b/libc/pthread/pthread_yield.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_yield.c + * libc/pthread/pthread_yield.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread/Make.defs b/sched/pthread/Make.defs index 20bc7e8d6c..4d7b870957 100644 --- a/sched/pthread/Make.defs +++ b/sched/pthread/Make.defs @@ -36,7 +36,7 @@ ifneq ($(CONFIG_DISABLE_PTHREAD),y) CSRCS += pthread_create.c pthread_exit.c pthread_join.c pthread_detach.c -CSRCS += pthread_yield.c pthread_getschedparam.c pthread_setschedparam.c +CSRCS += pthread_getschedparam.c pthread_setschedparam.c CSRCS += pthread_mutexinit.c pthread_mutexdestroy.c CSRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c CSRCS += pthread_condinit.c pthread_conddestroy.c diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 1ff6948d74..8afdd21caf 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -99,7 +99,6 @@ "pthread_setschedprio","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int" "pthread_setspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t","FAR const void*" "pthread_sigmask","pthread.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)","int","int","FAR const sigset_t*","FAR sigset_t*" -"pthread_yield","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void" "putenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char*" "read","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR void*","size_t" "readdir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR struct dirent*","FAR DIR*" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 0719358487..4096ebabb9 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -310,7 +310,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) SYSCALL_LOOKUP(pthread_setschedparam, 3, STUB_pthread_setschedparam) SYSCALL_LOOKUP(pthread_setschedprio, 2, STUB_pthread_setschedprio) SYSCALL_LOOKUP(pthread_setspecific, 2, STUB_pthread_setspecific) - SYSCALL_LOOKUP(pthread_yield, 0, STUB_pthread_yield) # ifdef CONFIG_SMP SYSCALL_LOOKUP(pthread_setaffinity, 3, STUB_pthread_setaffinity) SYSCALL_LOOKUP(pthread_getaffinity, 3, STUB_pthread_getaffinity) diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c index 2cc52ad0a3..20119fbfbf 100644 --- a/syscall/syscall_stublookup.c +++ b/syscall/syscall_stublookup.c @@ -310,7 +310,6 @@ uintptr_t STUB_pthread_setschedprio(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_pthread_setspecific(int nbr, uintptr_t parm1, uintptr_t parm2); -uintptr_t STUB_pthread_yield(int nbr); uintptr_t STUB_pthread_setaffinity(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3); From 557fd6504f714b9616e01731fc87eb0731b240d6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 07:30:49 -0600 Subject: [PATCH 15/55] pthreads: Move pthread_once from sched/pthreads to libc/pthreads. pthread_once just coordinates other OS interface calls but is not a fundamental OS interface and, hence, does not belong within the OS. --- include/sys/syscall.h | 13 ++++++------- libc/libc.csv | 1 + libc/pthread/Make.defs | 2 +- {sched => libc}/pthread/pthread_once.c | 4 ++-- sched/pthread/Make.defs | 2 +- syscall/syscall.csv | 1 - syscall/syscall_lookup.h | 1 - syscall/syscall_stublookup.c | 1 - 8 files changed, 11 insertions(+), 14 deletions(-) rename {sched => libc}/pthread/pthread_once.c (97%) diff --git a/include/sys/syscall.h b/include/sys/syscall.h index 3f21f74d73..84f2f9a7a6 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -421,16 +421,15 @@ #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE # define SYS_pthread_mutex_consistent (__SYS_pthread+22) -# define __SYS_pthread_once (__SYS_pthread+23) +# define __SYS_pthread_setschedparam (__SYS_pthread+23) #else -# define __SYS_pthread_once (__SYS_pthread+22) +# define __SYS_pthread_setschedparam (__SYS_pthread+22) #endif -# define SYS_pthread_once (__SYS_pthread_once+0) -# define SYS_pthread_setschedparam (__SYS_pthread_once+1) -# define SYS_pthread_setschedprio (__SYS_pthread_once+2) -# define SYS_pthread_setspecific (__SYS_pthread_once+3) -# define __SYS_pthread_smp (__SYS_pthread_once+4) +# define SYS_pthread_setschedparam (__SYS_pthread_setschedparam+0) +# define SYS_pthread_setschedprio (__SYS_pthread_setschedparam+1) +# define SYS_pthread_setspecific (__SYS_pthread_setschedparam+2) +# define __SYS_pthread_smp (__SYS_pthread_setschedparam+3) # ifdef CONFIG_SMP # define SYS_pthread_setaffinity_np (__SYS_pthread_smp+0) diff --git a/libc/libc.csv b/libc/libc.csv index 89bc65c0b0..91d04270a5 100644 --- a/libc/libc.csv +++ b/libc/libc.csv @@ -117,6 +117,7 @@ "pthread_mutexattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *" "pthread_mutexattr_setpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *","int " "pthread_mutexattr_settype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_PTHREAD_MUTEX_TYPES)","int","pthread_mutexattr_t *","int" +"pthread_once","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_once_t*","CODE void (*)(void)" "pthread_yield","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void" "puts","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR const char *" "qsort","stdlib.h","","void","void *","size_t","size_t","int(*)(const void *","FAR const void *)" diff --git a/libc/pthread/Make.defs b/libc/pthread/Make.defs index 5cd35f0255..7f30abfd39 100644 --- a/libc/pthread/Make.defs +++ b/libc/pthread/Make.defs @@ -53,7 +53,7 @@ CSRCS += pthread_mutexattr_setrobust.c pthread_mutexattr_getrobust.c CSRCS += pthread_setcancelstate.c pthread_setcanceltype.c CSRCS += pthread_testcancel.c CSRCS += pthread_rwlock.c pthread_rwlock_rdlock.c pthread_rwlock_wrlock.c -CSRCS += pthread_yield.c +CSRCS += pthread_once.c pthread_yield.c ifeq ($(CONFIG_SMP),y) CSRCS += pthread_attr_getaffinity.c pthread_attr_setaffinity.c diff --git a/sched/pthread/pthread_once.c b/libc/pthread/pthread_once.c similarity index 97% rename from sched/pthread/pthread_once.c rename to libc/pthread/pthread_once.c index cd778a02d2..d73dde966f 100644 --- a/sched/pthread/pthread_once.c +++ b/libc/pthread/pthread_once.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_once.c + * libc/pthread/pthread_once.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread/Make.defs b/sched/pthread/Make.defs index 4d7b870957..8cc744348a 100644 --- a/sched/pthread/Make.defs +++ b/sched/pthread/Make.defs @@ -46,7 +46,7 @@ CSRCS += pthread_cancel.c CSRCS += pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c CSRCS += pthread_keydelete.c CSRCS += pthread_initialize.c pthread_completejoin.c pthread_findjoininfo.c -CSRCS += pthread_once.c pthread_release.c pthread_setschedprio.c +CSRCS += pthread_release.c pthread_setschedprio.c ifneq ($(CONFIG_PTHREAD_MUTEX_UNSAFE),y) CSRCS += pthread_mutex.c pthread_mutexconsistent.c pthread_mutexinconsistent.c diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 8afdd21caf..ca512fbb24 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -93,7 +93,6 @@ "pthread_mutex_trylock","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutex_t*" "pthread_mutex_unlock","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutex_t*" "pthread_mutex_consistent","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && !defined(CONFIG_PTHREAD_MUTEX_UNSAFE)","int","FAR pthread_mutex_t*" -"pthread_once","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_once_t*","CODE void (*)(void)" "pthread_setaffinity_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP)","int","pthread_t","size_t","FAR const cpu_set_t*" "pthread_setschedparam","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int","FAR const struct sched_param*" "pthread_setschedprio","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 4096ebabb9..ef38aa1d8c 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -306,7 +306,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE SYSCALL_LOOKUP(pthread_mutex_consistent, 1, STUB_pthread_mutex_consistent) #endif - SYSCALL_LOOKUP(pthread_once, 2, STUB_pthread_once) SYSCALL_LOOKUP(pthread_setschedparam, 3, STUB_pthread_setschedparam) SYSCALL_LOOKUP(pthread_setschedprio, 2, STUB_pthread_setschedprio) SYSCALL_LOOKUP(pthread_setspecific, 2, STUB_pthread_setspecific) diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c index 20119fbfbf..ad891727bf 100644 --- a/syscall/syscall_stublookup.c +++ b/syscall/syscall_stublookup.c @@ -303,7 +303,6 @@ uintptr_t STUB_pthread_mutex_lock(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_mutex_trylock(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_mutex_unlock(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_mutex_consistent(int nbr, uintptr_t parm1); -uintptr_t STUB_pthread_once(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_pthread_setschedparam(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3); uintptr_t STUB_pthread_setschedprio(int nbr, uintptr_t parm1, From ae168bffa0125994fcf345f13c329a35e2b3a0ed Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 07:48:45 -0600 Subject: [PATCH 16/55] pthreads: Move pthread_cond_init and pthread_cond_destory from sched/pthreads to libc/pthreads. This just coordinate other OS interface calls but are not a fundamental OS interfaces and, hence, do not belong within the OS. --- include/sys/syscall.h | 38 +++++++++---------- libc/libc.csv | 2 + libc/pthread/Make.defs | 1 + {sched => libc}/pthread/pthread_conddestroy.c | 5 +-- {sched => libc}/pthread/pthread_condinit.c | 6 +-- sched/pthread/Make.defs | 1 - syscall/syscall.csv | 2 - syscall/syscall_lookup.h | 2 - syscall/syscall_stublookup.c | 2 - 9 files changed, 25 insertions(+), 34 deletions(-) rename {sched => libc}/pthread/pthread_conddestroy.c (95%) rename {sched => libc}/pthread/pthread_condinit.c (95%) diff --git a/include/sys/syscall.h b/include/sys/syscall.h index 84f2f9a7a6..77d1c7c6d3 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -401,29 +401,27 @@ # define SYS_pthread_barrier_wait (__SYS_pthread+2) # define SYS_pthread_cancel (__SYS_pthread+3) # define SYS_pthread_cond_broadcast (__SYS_pthread+4) -# define SYS_pthread_cond_destroy (__SYS_pthread+5) -# define SYS_pthread_cond_init (__SYS_pthread+6) -# define SYS_pthread_cond_signal (__SYS_pthread+7) -# define SYS_pthread_cond_wait (__SYS_pthread+8) -# define SYS_pthread_create (__SYS_pthread+9) -# define SYS_pthread_detach (__SYS_pthread+10) -# define SYS_pthread_exit (__SYS_pthread+11) -# define SYS_pthread_getschedparam (__SYS_pthread+12) -# define SYS_pthread_getspecific (__SYS_pthread+13) -# define SYS_pthread_join (__SYS_pthread+14) -# define SYS_pthread_key_create (__SYS_pthread+15) -# define SYS_pthread_key_delete (__SYS_pthread+16) -# define SYS_pthread_mutex_destroy (__SYS_pthread+17) -# define SYS_pthread_mutex_init (__SYS_pthread+18) -# define SYS_pthread_mutex_lock (__SYS_pthread+19) -# define SYS_pthread_mutex_trylock (__SYS_pthread+20) -# define SYS_pthread_mutex_unlock (__SYS_pthread+21) +# define SYS_pthread_cond_signal (__SYS_pthread+5) +# define SYS_pthread_cond_wait (__SYS_pthread+6) +# define SYS_pthread_create (__SYS_pthread+7) +# define SYS_pthread_detach (__SYS_pthread+8) +# define SYS_pthread_exit (__SYS_pthread+9) +# define SYS_pthread_getschedparam (__SYS_pthread+10) +# define SYS_pthread_getspecific (__SYS_pthread+11) +# define SYS_pthread_join (__SYS_pthread+12) +# define SYS_pthread_key_create (__SYS_pthread+13) +# define SYS_pthread_key_delete (__SYS_pthread+14) +# define SYS_pthread_mutex_destroy (__SYS_pthread+15) +# define SYS_pthread_mutex_init (__SYS_pthread+16) +# define SYS_pthread_mutex_lock (__SYS_pthread+17) +# define SYS_pthread_mutex_trylock (__SYS_pthread+18) +# define SYS_pthread_mutex_unlock (__SYS_pthread+19) #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE -# define SYS_pthread_mutex_consistent (__SYS_pthread+22) -# define __SYS_pthread_setschedparam (__SYS_pthread+23) +# define SYS_pthread_mutex_consistent (__SYS_pthread+20) +# define __SYS_pthread_setschedparam (__SYS_pthread+21) #else -# define __SYS_pthread_setschedparam (__SYS_pthread+22) +# define __SYS_pthread_setschedparam (__SYS_pthread+20) #endif # define SYS_pthread_setschedparam (__SYS_pthread_setschedparam+0) diff --git a/libc/libc.csv b/libc/libc.csv index 91d04270a5..a97d54b70f 100644 --- a/libc/libc.csv +++ b/libc/libc.csv @@ -111,6 +111,8 @@ "pthread_barrierattr_setpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrierattr_t *","int" "pthread_condattr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *" "pthread_condattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *" +"pthread_cond_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" +"pthread_cond_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR const pthread_condattr_t*" "pthread_mutexattr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *" "pthread_mutexattr_getpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *","FAR int *" "pthread_mutexattr_gettype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_PTHREAD_MUTEX_TYPES)","int","FAR const pthread_mutexattr_t *","int *" diff --git a/libc/pthread/Make.defs b/libc/pthread/Make.defs index 7f30abfd39..5e08cbefa8 100644 --- a/libc/pthread/Make.defs +++ b/libc/pthread/Make.defs @@ -45,6 +45,7 @@ CSRCS += pthread_attr_setschedparam.c pthread_attr_getschedparam.c CSRCS += pthread_barrierattr_init.c pthread_barrierattr_destroy.c CSRCS += pthread_barrierattr_getpshared.c pthread_barrierattr_setpshared.c CSRCS += pthread_condattr_init.c pthread_condattr_destroy.c +CSRCS += pthread_condinit.c pthread_conddestroy.c CSRCS += pthread_mutexattr_init.c pthread_mutexattr_destroy.c CSRCS += pthread_mutexattr_getpshared.c pthread_mutexattr_setpshared.c CSRCS += pthread_mutexattr_setprotocol.c pthread_mutexattr_getprotocol.c diff --git a/sched/pthread/pthread_conddestroy.c b/libc/pthread/pthread_conddestroy.c similarity index 95% rename from sched/pthread/pthread_conddestroy.c rename to libc/pthread/pthread_conddestroy.c index bff0c3c28b..a691b60d7d 100644 --- a/sched/pthread/pthread_conddestroy.c +++ b/libc/pthread/pthread_conddestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_conddestroy.c + * libc/pthread/pthread_conddestroy.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include #include #include -#include "pthread/pthread.h" /**************************************************************************** * Public Functions diff --git a/sched/pthread/pthread_condinit.c b/libc/pthread/pthread_condinit.c similarity index 95% rename from sched/pthread/pthread_condinit.c rename to libc/pthread/pthread_condinit.c index 7368e0fb5a..81a31ea57f 100644 --- a/sched/pthread/pthread_condinit.c +++ b/libc/pthread/pthread_condinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_condinit.c + * libc/pthread/pthread_condinit.c * - * Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -46,8 +46,6 @@ #include -#include "pthread/pthread.h" - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/sched/pthread/Make.defs b/sched/pthread/Make.defs index 8cc744348a..b450af2900 100644 --- a/sched/pthread/Make.defs +++ b/sched/pthread/Make.defs @@ -39,7 +39,6 @@ CSRCS += pthread_create.c pthread_exit.c pthread_join.c pthread_detach.c CSRCS += pthread_getschedparam.c pthread_setschedparam.c CSRCS += pthread_mutexinit.c pthread_mutexdestroy.c CSRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c -CSRCS += pthread_condinit.c pthread_conddestroy.c CSRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c CSRCS += pthread_cancel.c diff --git a/syscall/syscall.csv b/syscall/syscall.csv index ca512fbb24..7624b5129f 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -72,8 +72,6 @@ "pthread_cleanup_pop","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","int" "pthread_cleanup_push","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","pthread_cleanup_t","FAR void*" "pthread_cond_broadcast","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" -"pthread_cond_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" -"pthread_cond_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR const pthread_condattr_t*" "pthread_cond_signal","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" "pthread_cond_timedwait","pthread.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR pthread_mutex_t*","FAR const struct timespec*" "pthread_cond_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR pthread_mutex_t*" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index ef38aa1d8c..7c9b870981 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -286,8 +286,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) SYSCALL_LOOKUP(pthread_barrier_wait, 1, STUB_pthread_barrier_wait) SYSCALL_LOOKUP(pthread_cancel, 1, STUB_pthread_cancel) SYSCALL_LOOKUP(pthread_cond_broadcast, 1, STUB_pthread_cond_broadcast) - SYSCALL_LOOKUP(pthread_cond_destroy, 1, STUB_pthread_cond_destroy) - SYSCALL_LOOKUP(pthread_cond_init, 2, STUB_pthread_cond_init) SYSCALL_LOOKUP(pthread_cond_signal, 1, STUB_pthread_cond_signal) SYSCALL_LOOKUP(pthread_cond_wait, 2, STUB_pthread_cond_wait) SYSCALL_LOOKUP(pthread_create, 4, STUB_pthread_create) diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c index ad891727bf..cdc2ef7c36 100644 --- a/syscall/syscall_stublookup.c +++ b/syscall/syscall_stublookup.c @@ -281,8 +281,6 @@ uintptr_t STUB_pthread_barrier_init(int nbr, uintptr_t parm1, uintptr_t STUB_pthread_barrier_wait(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cancel(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cond_broadcast(int nbr, uintptr_t parm1); -uintptr_t STUB_pthread_cond_destroy(int nbr, uintptr_t parm1); -uintptr_t STUB_pthread_cond_init(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_pthread_cond_signal(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cond_wait(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_pthread_create(int nbr, uintptr_t parm1, uintptr_t parm2, From 23a6ff5846cdc62cf9ae8962c5388de7c729d1a7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 07:59:54 -0600 Subject: [PATCH 17/55] pthreads: Move pthread_barrier_init, pthread_barrier_destroy, and pthread_barrier_wait from sched/pthreads to libc/pthreads. This just coordinate other OS interface calls but are not a fundamental OS interfaces and, hence, do not belong within the OS. --- include/sys/syscall.h | 43 +++++++++---------- libc/libc.csv | 3 ++ libc/pthread/Make.defs | 1 + .../pthread/pthread_barrierdestroy.c | 5 ++- {sched => libc}/pthread/pthread_barrierinit.c | 4 +- {sched => libc}/pthread/pthread_barrierwait.c | 4 +- sched/pthread/Make.defs | 1 - syscall/syscall.csv | 3 -- syscall/syscall_lookup.h | 3 -- syscall/syscall_stublookup.c | 4 -- 10 files changed, 31 insertions(+), 40 deletions(-) rename {sched => libc}/pthread/pthread_barrierdestroy.c (96%) rename {sched => libc}/pthread/pthread_barrierinit.c (97%) rename {sched => libc}/pthread/pthread_barrierwait.c (98%) diff --git a/include/sys/syscall.h b/include/sys/syscall.h index 77d1c7c6d3..81d17e027c 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -396,32 +396,29 @@ /* The following are defined if pthreads are enabled */ #ifndef CONFIG_DISABLE_PTHREAD -# define SYS_pthread_barrier_destroy (__SYS_pthread+0) -# define SYS_pthread_barrier_init (__SYS_pthread+1) -# define SYS_pthread_barrier_wait (__SYS_pthread+2) -# define SYS_pthread_cancel (__SYS_pthread+3) -# define SYS_pthread_cond_broadcast (__SYS_pthread+4) -# define SYS_pthread_cond_signal (__SYS_pthread+5) -# define SYS_pthread_cond_wait (__SYS_pthread+6) -# define SYS_pthread_create (__SYS_pthread+7) -# define SYS_pthread_detach (__SYS_pthread+8) -# define SYS_pthread_exit (__SYS_pthread+9) -# define SYS_pthread_getschedparam (__SYS_pthread+10) -# define SYS_pthread_getspecific (__SYS_pthread+11) -# define SYS_pthread_join (__SYS_pthread+12) -# define SYS_pthread_key_create (__SYS_pthread+13) -# define SYS_pthread_key_delete (__SYS_pthread+14) -# define SYS_pthread_mutex_destroy (__SYS_pthread+15) -# define SYS_pthread_mutex_init (__SYS_pthread+16) -# define SYS_pthread_mutex_lock (__SYS_pthread+17) -# define SYS_pthread_mutex_trylock (__SYS_pthread+18) -# define SYS_pthread_mutex_unlock (__SYS_pthread+19) +# define SYS_pthread_cancel (__SYS_pthread+0) +# define SYS_pthread_cond_broadcast (__SYS_pthread+1) +# define SYS_pthread_cond_signal (__SYS_pthread+2) +# define SYS_pthread_cond_wait (__SYS_pthread+3) +# define SYS_pthread_create (__SYS_pthread+4) +# define SYS_pthread_detach (__SYS_pthread+5) +# define SYS_pthread_exit (__SYS_pthread+6) +# define SYS_pthread_getschedparam (__SYS_pthread+7) +# define SYS_pthread_getspecific (__SYS_pthread+8) +# define SYS_pthread_join (__SYS_pthread+9) +# define SYS_pthread_key_create (__SYS_pthread+10) +# define SYS_pthread_key_delete (__SYS_pthread+11) +# define SYS_pthread_mutex_destroy (__SYS_pthread+12) +# define SYS_pthread_mutex_init (__SYS_pthread+13) +# define SYS_pthread_mutex_lock (__SYS_pthread+14) +# define SYS_pthread_mutex_trylock (__SYS_pthread+15) +# define SYS_pthread_mutex_unlock (__SYS_pthread+16) #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE -# define SYS_pthread_mutex_consistent (__SYS_pthread+20) -# define __SYS_pthread_setschedparam (__SYS_pthread+21) +# define SYS_pthread_mutex_consistent (__SYS_pthread+17) +# define __SYS_pthread_setschedparam (__SYS_pthread+18) #else -# define __SYS_pthread_setschedparam (__SYS_pthread+20) +# define __SYS_pthread_setschedparam (__SYS_pthread+17) #endif # define SYS_pthread_setschedparam (__SYS_pthread_setschedparam+0) diff --git a/libc/libc.csv b/libc/libc.csv index a97d54b70f..d4a86fe5bf 100644 --- a/libc/libc.csv +++ b/libc/libc.csv @@ -109,6 +109,9 @@ "pthread_barrierattr_getpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR const pthread_barrierattr_t *","FAR int *" "pthread_barrierattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrierattr_t *" "pthread_barrierattr_setpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrierattr_t *","int" +"pthread_barrier_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" +"pthread_barrier_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*","FAR const pthread_barrierattr_t*","unsigned int" +"pthread_barrier_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" "pthread_condattr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *" "pthread_condattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *" "pthread_cond_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" diff --git a/libc/pthread/Make.defs b/libc/pthread/Make.defs index 5e08cbefa8..04ca83dc6a 100644 --- a/libc/pthread/Make.defs +++ b/libc/pthread/Make.defs @@ -44,6 +44,7 @@ CSRCS += pthread_attr_setstacksize.c pthread_attr_getstacksize.c CSRCS += pthread_attr_setschedparam.c pthread_attr_getschedparam.c CSRCS += pthread_barrierattr_init.c pthread_barrierattr_destroy.c CSRCS += pthread_barrierattr_getpshared.c pthread_barrierattr_setpshared.c +CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c CSRCS += pthread_condattr_init.c pthread_condattr_destroy.c CSRCS += pthread_condinit.c pthread_conddestroy.c CSRCS += pthread_mutexattr_init.c pthread_mutexattr_destroy.c diff --git a/sched/pthread/pthread_barrierdestroy.c b/libc/pthread/pthread_barrierdestroy.c similarity index 96% rename from sched/pthread/pthread_barrierdestroy.c rename to libc/pthread/pthread_barrierdestroy.c index 6bf0270b13..3f74e06c49 100644 --- a/sched/pthread/pthread_barrierdestroy.c +++ b/libc/pthread/pthread_barrierdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_barriedestroy.c + * libc/pthread/pthread_barriedestroy.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -87,5 +87,6 @@ int pthread_barrier_destroy(FAR pthread_barrier_t *barrier) sem_destroy(&barrier->sem); barrier->count = 0; } + return ret; } diff --git a/sched/pthread/pthread_barrierinit.c b/libc/pthread/pthread_barrierinit.c similarity index 97% rename from sched/pthread/pthread_barrierinit.c rename to libc/pthread/pthread_barrierinit.c index 5051601417..6f8d427dfe 100644 --- a/sched/pthread/pthread_barrierinit.c +++ b/libc/pthread/pthread_barrierinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_barrieinit.c + * libc/pthread/pthread_barrieinit.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread/pthread_barrierwait.c b/libc/pthread/pthread_barrierwait.c similarity index 98% rename from sched/pthread/pthread_barrierwait.c rename to libc/pthread/pthread_barrierwait.c index cf2f959c4e..8ba29d1d94 100644 --- a/sched/pthread/pthread_barrierwait.c +++ b/libc/pthread/pthread_barrierwait.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_barrierwait.c + * libc/pthread/pthread_barrierwait.c * - * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread/Make.defs b/sched/pthread/Make.defs index b450af2900..ebb512963d 100644 --- a/sched/pthread/Make.defs +++ b/sched/pthread/Make.defs @@ -40,7 +40,6 @@ CSRCS += pthread_getschedparam.c pthread_setschedparam.c CSRCS += pthread_mutexinit.c pthread_mutexdestroy.c CSRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c CSRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c -CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c CSRCS += pthread_cancel.c CSRCS += pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c CSRCS += pthread_keydelete.c diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 7624b5129f..bfb950a8eb 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -65,9 +65,6 @@ "pwrite","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR const void*","size_t","off_t" "posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []" "posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *" -"pthread_barrier_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" -"pthread_barrier_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*","FAR const pthread_barrierattr_t*","unsigned int" -"pthread_barrier_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" "pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t" "pthread_cleanup_pop","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","int" "pthread_cleanup_push","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","pthread_cleanup_t","FAR void*" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 7c9b870981..66a3153aa8 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -281,9 +281,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) /* The following are defined if pthreads are enabled */ #ifndef CONFIG_DISABLE_PTHREAD - SYSCALL_LOOKUP(pthread_barrier_destroy, 1, STUB_pthread_barrier_destroy) - SYSCALL_LOOKUP(pthread_barrier_init, 3, STUB_pthread_barrier_init) - SYSCALL_LOOKUP(pthread_barrier_wait, 1, STUB_pthread_barrier_wait) SYSCALL_LOOKUP(pthread_cancel, 1, STUB_pthread_cancel) SYSCALL_LOOKUP(pthread_cond_broadcast, 1, STUB_pthread_cond_broadcast) SYSCALL_LOOKUP(pthread_cond_signal, 1, STUB_pthread_cond_signal) diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c index cdc2ef7c36..289244e7a8 100644 --- a/syscall/syscall_stublookup.c +++ b/syscall/syscall_stublookup.c @@ -275,10 +275,6 @@ uintptr_t STUB_shmdt(int nbr, uintptr_t parm1); /* The following are defined if pthreads are enabled */ -uintptr_t STUB_pthread_barrier_destroy(int nbr, uintptr_t parm1); -uintptr_t STUB_pthread_barrier_init(int nbr, uintptr_t parm1, - uintptr_t parm2, uintptr_t parm3); -uintptr_t STUB_pthread_barrier_wait(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cancel(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cond_broadcast(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_cond_signal(int nbr, uintptr_t parm1); From 46f86982eeaa91b3b8f8d1b9f26f7541071454f3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 08:39:26 -0600 Subject: [PATCH 18/55] Update TODO list --- TODO | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 64c98a8c86..46f6c597e4 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated May 31, 2017) +NuttX TODO List (Last updated June 14, 2017) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -234,6 +234,33 @@ o Task/Scheduler (sched/) could be improved and made a little more efficient with this change. + Title: INAPPROPRIATE USE OF sched_lock() BY pthreads + Description: In implementation of standard pthread functions, the non- + standard, NuttX function sched_lock() is used. This is very + strong sense it disables pre-emption for all threads in all + task groups. I believe it is only really necessary in most + cases to lock threads in the task group with a new non- + standard interface, say pthread_lock(). + + This is because the OS resources used by a thread such as + mutexes, condition variable, barriers, etc. are only + meaningful from within the task group. So, in order to + performance exclusive operations on these resources, it is + only necessary to block other threads executing within the + task group. + + This is an easy change: pthread_lock() and pthread_unlock() + would simply operate on a semaphore retained in the task + group structure. I am, however, hesitant to make this change: + I the flat build model, there is nothing that prevents people + from accessing the inter-thread controls from threads in + differnt task groups. Making this change, while correct, + might introduce subtle bugs in code by people who are not + using NuttX correctly. + Status: Open + Priority: Low. This change would improve real-time performance of the + OS but is not otherwise required. + o SMP ^^^ From a86f46bc54fe38781e35c1edad85b2f2f9ae6ac8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 09:38:58 -0600 Subject: [PATCH 19/55] MCP1515: Eliminate some warnings --- drivers/can/mcp2515.c | 2 +- include/nuttx/can/mcp2515.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/can/mcp2515.c b/drivers/can/mcp2515.c index 50d4999e60..4a325a0426 100644 --- a/drivers/can/mcp2515.c +++ b/drivers/can/mcp2515.c @@ -2543,7 +2543,7 @@ FAR struct mcp2515_can_s *mcp2515_instantiate(FAR struct mcp2515_config_s *confi /* Return our private data structure as an opaque handle */ - return (MCP2515_HANDLE)priv; + return priv; } /**************************************************************************** diff --git a/include/nuttx/can/mcp2515.h b/include/nuttx/can/mcp2515.h index f7618fd88e..5689f76f1f 100644 --- a/include/nuttx/can/mcp2515.h +++ b/include/nuttx/can/mcp2515.h @@ -61,6 +61,9 @@ * Public Types ****************************************************************************/ +/* Type of the MCP2515 interrupt handling callback */ + +struct mcp2515_config_s; /* Forward reference */ typedef void (*mcp2515_handler_t)(FAR struct mcp2515_config_s *config, FAR void *arg); @@ -104,8 +107,7 @@ struct mcp2515_config_s mcp2515_handler_t handler, FAR void *arg); }; - -typedef FAR void *MCP2515_HANDLE; +/* Internal representation of the MCP2515 state data */ struct mcp2515_can_s; From 78281ef8e0125433a976acbd176e7136fb1c2581 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 10:10:57 -0600 Subject: [PATCH 20/55] configs/stm32f103-minimum/mcp2515/defconfig: Enable CONFIG_CAN_TXREADY=y to eliminate a warning. --- configs/stm32f103-minimum/mcp2515/defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/stm32f103-minimum/mcp2515/defconfig b/configs/stm32f103-minimum/mcp2515/defconfig index 982cc5767e..56727ae711 100644 --- a/configs/stm32f103-minimum/mcp2515/defconfig +++ b/configs/stm32f103-minimum/mcp2515/defconfig @@ -731,7 +731,9 @@ CONFIG_ARCH_HAVE_CAN_ERRORS=y # CONFIG_CAN_FD is not set CONFIG_CAN_FIFOSIZE=8 CONFIG_CAN_NPENDINGRTR=4 -# CONFIG_CAN_TXREADY is not set +CONFIG_CAN_TXREADY=y +# CONFIG_CAN_TXREADY_LOPRI is not set +CONFIG_CAN_TXREADY_HIPRI=y # # CAN Bus Controllers: From 04ae3d51c23215f9d59622abfd34ccebc6c163a9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 10:13:38 -0600 Subject: [PATCH 21/55] drivers/mp2515.c: Remove an incorrect warning. --- drivers/can/mcp2515.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/can/mcp2515.c b/drivers/can/mcp2515.c index 4a325a0426..10ab6e2508 100644 --- a/drivers/can/mcp2515.c +++ b/drivers/can/mcp2515.c @@ -64,14 +64,6 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* Common definitions *******************************************************/ - -/* General Configuration ****************************************************/ - -#ifndef CONFIG_CAN_TXREADY -# warning WARNING!!! CONFIG_CAN_TXREADY is required by this driver -#endif - /* MCP2515 Configuration ****************************************************/ /* Bit timing */ From 2245dddaf9bdb37c51e49d4c53c2faab6bb69b43 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 13:42:56 -0600 Subject: [PATCH 22/55] Break up some long lines --- sched/init/os_smpstart.c | 3 ++- sched/init/os_start.c | 3 ++- sched/sched/sched_note.c | 18 ++++++++++++------ sched/sched/sched_resumescheduler.c | 3 ++- sched/semaphore/sem_holder.c | 3 ++- sched/signal/sig_deliver.c | 5 +++-- sched/signal/sig_dispatch.c | 6 +++--- sched/task/task_prctl.c | 8 ++++++-- sched/wqueue/kwork_inherit.c | 3 ++- 9 files changed, 34 insertions(+), 18 deletions(-) diff --git a/sched/init/os_smpstart.c b/sched/init/os_smpstart.c index 17316e5b61..f5c1213a04 100644 --- a/sched/init/os_smpstart.c +++ b/sched/init/os_smpstart.c @@ -223,7 +223,8 @@ int os_smp_start(void) * this task is locked to this CPU. */ - tcb->flags = (TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_NONCANCELABLE | TCB_FLAG_CPU_LOCKED); + tcb->flags = (TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_NONCANCELABLE | + TCB_FLAG_CPU_LOCKED); tcb->cpu = cpu; } diff --git a/sched/init/os_start.c b/sched/init/os_start.c index 00f932fd13..961152ec4b 100644 --- a/sched/init/os_start.c +++ b/sched/init/os_start.c @@ -543,7 +543,8 @@ void os_start(void) sem_initialize(); -#if defined(MM_KERNEL_USRHEAP_INIT) || defined(CONFIG_MM_KERNEL_HEAP) || defined(CONFIG_MM_PGALLOC) +#if defined(MM_KERNEL_USRHEAP_INIT) || defined(CONFIG_MM_KERNEL_HEAP) || \ + defined(CONFIG_MM_PGALLOC) /* Initialize the memory manager */ { diff --git a/sched/sched/sched_note.c b/sched/sched/sched_note.c index bdc308fa91..6dc17b9936 100644 --- a/sched/sched/sched_note.c +++ b/sched/sched/sched_note.c @@ -447,7 +447,8 @@ void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu) /* Format the note */ - note_common(tcb, ¬e.ncs_cmn, sizeof(struct note_cpu_start_s), NOTE_CPU_START); + note_common(tcb, ¬e.ncs_cmn, sizeof(struct note_cpu_start_s), + NOTE_CPU_START); note.ncs_target = (uint8_t)cpu; /* Add the note to circular buffer */ @@ -461,7 +462,8 @@ void sched_note_cpu_started(FAR struct tcb_s *tcb) /* Format the note */ - note_common(tcb, ¬e.ncs_cmn, sizeof(struct note_cpu_started_s), NOTE_CPU_STARTED); + note_common(tcb, ¬e.ncs_cmn, sizeof(struct note_cpu_started_s), + NOTE_CPU_STARTED); /* Add the note to circular buffer */ @@ -474,7 +476,8 @@ void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu) /* Format the note */ - note_common(tcb, ¬e.ncp_cmn, sizeof(struct note_cpu_pause_s), NOTE_CPU_PAUSE); + note_common(tcb, ¬e.ncp_cmn, sizeof(struct note_cpu_pause_s), + NOTE_CPU_PAUSE); note.ncp_target = (uint8_t)cpu; /* Add the note to circular buffer */ @@ -488,7 +491,8 @@ void sched_note_cpu_paused(FAR struct tcb_s *tcb) /* Format the note */ - note_common(tcb, ¬e.ncp_cmn, sizeof(struct note_cpu_paused_s), NOTE_CPU_PAUSED); + note_common(tcb, ¬e.ncp_cmn, sizeof(struct note_cpu_paused_s), + NOTE_CPU_PAUSED); /* Add the note to circular buffer */ @@ -501,7 +505,8 @@ void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu) /* Format the note */ - note_common(tcb, ¬e.ncr_cmn, sizeof(struct note_cpu_resume_s), NOTE_CPU_RESUME); + note_common(tcb, ¬e.ncr_cmn, sizeof(struct note_cpu_resume_s), + NOTE_CPU_RESUME); note.ncr_target = (uint8_t)cpu; /* Add the note to circular buffer */ @@ -515,7 +520,8 @@ void sched_note_cpu_resumed(FAR struct tcb_s *tcb) /* Format the note */ - note_common(tcb, ¬e.ncr_cmn, sizeof(struct note_cpu_resumed_s), NOTE_CPU_RESUMED); + note_common(tcb, ¬e.ncr_cmn, sizeof(struct note_cpu_resumed_s), + NOTE_CPU_RESUMED); /* Add the note to circular buffer */ diff --git a/sched/sched/sched_resumescheduler.c b/sched/sched/sched_resumescheduler.c index 52eaef8374..96097d4fcd 100644 --- a/sched/sched/sched_resumescheduler.c +++ b/sched/sched/sched_resumescheduler.c @@ -103,4 +103,5 @@ void sched_resume_scheduler(FAR struct tcb_s *tcb) } -#endif /* CONFIG_RR_INTERVAL > 0 || CONFIG_SCHED_SPORADIC || CONFIG_SCHED_INSTRUMENTATION */ +#endif /* CONFIG_RR_INTERVAL > 0 || CONFIG_SCHED_SPORADIC || \ + * CONFIG_SCHED_INSTRUMENTATION */ diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c index a46cf3a8be..bb11dbdeaf 100644 --- a/sched/semaphore/sem_holder.c +++ b/sched/semaphore/sem_holder.c @@ -439,7 +439,8 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder, static int sem_verifyholder(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg) { -#if 0 // Need to revisit this, but these assumptions seem to be untrue -- OR there is a bug??? +#if 0 /* Need to revisit this, but these assumptions seem to be untrue -- \ + * OR there is a bug??? */ FAR struct tcb_s *htcb = (FAR struct tcb_s *)pholder->htcb; /* Called after a semaphore has been released (incremented), the semaphore diff --git a/sched/signal/sig_deliver.c b/sched/signal/sig_deliver.c index 7f676a14a1..728e3a10d0 100644 --- a/sched/signal/sig_deliver.c +++ b/sched/signal/sig_deliver.c @@ -106,8 +106,9 @@ void sig_deliver(FAR struct tcb_s *stcb) * delivered plus the signal being delivered. */ - savesigprocmask = stcb->sigprocmask; - stcb->sigprocmask = savesigprocmask | sigq->mask | SIGNO2SET(sigq->info.si_signo); + savesigprocmask = stcb->sigprocmask; + stcb->sigprocmask = savesigprocmask | sigq->mask | + SIGNO2SET(sigq->info.si_signo); /* Deliver the signal. In the kernel build this has to be handled * differently if we are dispatching to a signal handler in a user- diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 4399dc01f5..c69c6388f6 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -315,9 +315,9 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info) if (sigismember(&stcb->sigprocmask, info->si_signo)) { - /* Check if the task is waiting for this pending signal. If so, then unblock it. - * This must be performed in a critical section because signals can be queued - * from the interrupt level. + /* Check if the task is waiting for this pending signal. If so, then + * unblock it. This must be performed in a critical section because + * signals can be queued * from the interrupt level. */ flags = enter_critical_section(); diff --git a/sched/task/task_prctl.c b/sched/task/task_prctl.c index 5c74ea09f0..f28e76d6fe 100644 --- a/sched/task/task_prctl.c +++ b/sched/task/task_prctl.c @@ -129,14 +129,18 @@ int prctl(int option, ...) if (option == PR_SET_NAME) { - /* Ensure that tcb->name will be null-terminated, truncating if necessary */ + /* Ensure that tcb->name will be null-terminated, truncating if + * necessary. + */ strncpy(tcb->name, name, CONFIG_TASK_NAME_SIZE); tcb->name[CONFIG_TASK_NAME_SIZE] = '\0'; } else { - /* The returned value will be null-terminated, truncating if necessary */ + /* The returned value will be null-terminated, truncating if + * necessary. + */ strncpy(name, tcb->name, CONFIG_TASK_NAME_SIZE-1); name[CONFIG_TASK_NAME_SIZE-1] = '\0'; diff --git a/sched/wqueue/kwork_inherit.c b/sched/wqueue/kwork_inherit.c index a960480bd0..ae4c0e6187 100644 --- a/sched/wqueue/kwork_inherit.c +++ b/sched/wqueue/kwork_inherit.c @@ -403,4 +403,5 @@ void lpwork_restorepriority(uint8_t reqprio) leave_critical_section(flags); } -#endif /* CONFIG_SCHED_WORKQUEUE && CONFIG_SCHED_LPWORK && CONFIG_PRIORITY_INHERITANCE */ +#endif /* CONFIG_SCHED_WORKQUEUE && CONFIG_SCHED_LPWORK && \ + * CONFIG_PRIORITY_INHERITANCE */ From 4a79547fb8b8261cecab5f13ca74b5267173f38c Mon Sep 17 00:00:00 2001 From: Leif Jakob Date: Wed, 14 Jun 2017 22:36:40 +0200 Subject: [PATCH 23/55] multiple fixes for stm32f1xx RTC clock - compile issues because of missing RTC_MAGIC #defines - missing functionality based on RTC_MAGIC in RTC based on stm32_rtcounter.c - IRQ setup from up_rtc_initialize was later reset in up_irqinitialize - write access to backup registers without enabling access to backup domain - possible races in set/cancel alarm tested with STM32F103C8 only device now wakes up from forced STANDBY mode by alarm --- arch/arm/src/stm32/stm32_irq.c | 5 ++ arch/arm/src/stm32/stm32_rtc.h | 39 ++++++++-- arch/arm/src/stm32/stm32_rtc_lowerhalf.c | 4 ++ arch/arm/src/stm32/stm32_rtcc.c | 26 ++++++- arch/arm/src/stm32/stm32_rtcounter.c | 90 ++++++++++++++++++------ arch/arm/src/stm32/stm32f40xxx_rtcc.c | 21 ++++++ arch/arm/src/stm32l4/stm32l4_rtcc.c | 21 ++++++ 7 files changed, 177 insertions(+), 29 deletions(-) diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index 2a51836a52..0f9553210a 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -387,6 +387,11 @@ void up_irqinitialize(void) up_enable_irq(STM32_IRQ_MEMFAULT); #endif +#ifdef CONFIG_RTC + /* RTC was initialized earlier but IRQs weren't ready at that time */ + stm32_rtc_irqinitialize(); +#endif + /* Attach all other processor exceptions (except reset and sys tick) */ #ifdef CONFIG_DEBUG_FEATURES diff --git a/arch/arm/src/stm32/stm32_rtc.h b/arch/arm/src/stm32/stm32_rtc.h index d228a3c458..0c4e5ecbf3 100644 --- a/arch/arm/src/stm32/stm32_rtc.h +++ b/arch/arm/src/stm32/stm32_rtc.h @@ -79,21 +79,35 @@ #define STM32_RTC_PRESCALER_SECOND 32767 /* Default prescaler to get a second base */ #define STM32_RTC_PRESCALER_MIN 1 /* Maximum speed of 16384 Hz */ +#if defined(CONFIG_STM32_STM32F10XX) +/* RTC is only a counter, store RTC data in backup domain register DR1 (if CONFIG_RTC_HIRES) and DR2 (state) */ + #if !defined(CONFIG_RTC_MAGIC) -# define CONFIG_RTC_MAGIC (0xfacefeee) +# define CONFIG_RTC_MAGIC (0xface) /* only 16 bit */ #endif -#if !defined(CONFIG_RTC_MAGIC_TIME_SET) -# define CONFIG_RTC_MAGIC_TIME_SET (CONFIG_RTC_MAGIC + 1) +#define RTC_MAGIC_REG STM32_BKP_DR2 + +#else /* !CONFIG_STM32_STM32F10XX */ + +#if !defined(CONFIG_RTC_MAGIC) +# define CONFIG_RTC_MAGIC (0xfacefeee) #endif #if !defined(CONFIG_RTC_MAGIC_REG) # define CONFIG_RTC_MAGIC_REG (0) #endif +#define RTC_MAGIC_REG STM32_RTC_BKR(CONFIG_RTC_MAGIC_REG) + +#endif /* CONFIG_STM32_STM32F10XX */ + #define RTC_MAGIC CONFIG_RTC_MAGIC #define RTC_MAGIC_TIME_SET CONFIG_RTC_MAGIC_TIME_SET -#define RTC_MAGIC_REG STM32_RTC_BKR(CONFIG_RTC_MAGIC_REG) + +#if !defined(CONFIG_RTC_MAGIC_TIME_SET) +# define CONFIG_RTC_MAGIC_TIME_SET (CONFIG_RTC_MAGIC + 1) +#endif /**************************************************************************** * Public Types @@ -118,6 +132,23 @@ extern "C" * Public Functions ****************************************************************************/ +/************************************************************************************ + * Name: stm32_rtc_irqinitialize + * + * Description: + * Initialize IRQs for RTC, not possible during up_rtc_initialize because + * up_irqinitialize is called later. + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ************************************************************************************/ + +int stm32_rtc_irqinitialize(void); + /**************************************************************************** * Name: stm32_rtc_getdatetime_with_subseconds * diff --git a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c index 548b7fa81b..6a8c079399 100644 --- a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c @@ -365,7 +365,11 @@ static int stm32_settime(FAR struct rtc_lowerhalf_s *lower, static bool stm32_havesettime(FAR struct rtc_lowerhalf_s *lower) { +#if defined(CONFIG_STM32_STM32F10XX) + return getreg16(RTC_MAGIC_REG) == RTC_MAGIC_TIME_SET; +#else return getreg32(RTC_MAGIC_REG) == RTC_MAGIC_TIME_SET; +#endif } /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c index 9adc62433c..b7c96f336a 100644 --- a/arch/arm/src/stm32/stm32_rtcc.c +++ b/arch/arm/src/stm32/stm32_rtcc.c @@ -763,17 +763,37 @@ int up_rtc_initialize(void) * 3. Configure the RTC to generate RTC alarms (Alarm A or Alarm B). */ + g_rtc_enabled = true; + rtc_dumpregs("After Initialization"); + return OK; +} + +/************************************************************************************ + * Name: stm32_rtc_irqinitialize + * + * Description: + * Initialize IRQs for RTC, not possible during up_rtc_initialize because + * up_irqinitialize is called later. + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ************************************************************************************/ + +int stm32_rtc_irqinitialize(void) +{ #ifdef CONFIG_RTC_ALARM # warning "Missing EXTI setup logic" - /* Then attach the ALARM interrupt handler */ + /* then attach the ALARM interrupt handler */ irq_attach(STM32_IRQ_RTC_WKUP, rtc_interrupt, NULL); up_enable_irq(STM32_IRQ_RTC_WKUP); #endif - g_rtc_enabled = true; - rtc_dumpregs("After Initialization"); return OK; } diff --git a/arch/arm/src/stm32/stm32_rtcounter.c b/arch/arm/src/stm32/stm32_rtcounter.c index 9a046f8318..5db3865c0d 100644 --- a/arch/arm/src/stm32/stm32_rtcounter.c +++ b/arch/arm/src/stm32/stm32_rtcounter.c @@ -331,7 +331,9 @@ static int stm32_rtc_interrupt(int irq, void *context, FAR void *arg) #ifdef CONFIG_RTC_HIRES if ((source & RTC_CRL_OWF) != 0) { + stm32_pwr_enablebkp(true); putreg16(getreg16(RTC_TIMEMSB_REG) + 1, RTC_TIMEMSB_REG); + stm32_pwr_enablebkp(false); } #endif @@ -373,25 +375,33 @@ static int stm32_rtc_interrupt(int irq, void *context, FAR void *arg) int up_rtc_initialize(void) { + uint32_t regval; + /* Enable write access to the backup domain (RTC registers, RTC backup data * registers and backup SRAM). */ stm32_pwr_enablebkp(true); + + regval = getreg32(RTC_MAGIC_REG); + + if (regval != RTC_MAGIC && regval != RTC_MAGIC_TIME_SET) + { + /* reset backup domain if bad magic */ + modifyreg32(STM32_RCC_BDCR, 0, RCC_BDCR_BDRST); + modifyreg32(STM32_RCC_BDCR, RCC_BDCR_BDRST, 0); + putreg16(RTC_MAGIC, RTC_MAGIC_REG); + } /* Select the lower power external 32,768Hz (Low-Speed External, LSE) oscillator * as RTC Clock Source and enable the Clock */ modifyreg16(STM32_RCC_BDCR, RCC_BDCR_RTCSEL_MASK, RCC_BDCR_RTCSEL_LSE); + + /* enable RTC and wait for RSF */ + modifyreg16(STM32_RCC_BDCR, 0, RCC_BDCR_RTCEN); - /* TODO: Get state from this function, if everything is - * okay and whether it is already enabled (if it was disabled - * reset upper time register) - */ - - g_rtc_enabled = true; - /* TODO: Possible stall? should we set the timeout period? and return with -1 */ stm32_rtc_wait4rsf(); @@ -403,21 +413,19 @@ int up_rtc_initialize(void) putreg16(STM32_RTC_PRESCALAR_VALUE & 0xffff, STM32_RTC_PRLL); stm32_rtc_endwr(); - /* Configure RTC interrupt to catch overflow and alarm interrupts. */ + stm32_rtc_wait4rsf(); -#if defined(CONFIG_RTC_HIRES) || defined(CONFIG_RTC_ALARM) - irq_attach(STM32_IRQ_RTC, stm32_rtc_interrupt, NULL); - up_enable_irq(STM32_IRQ_RTC); +#ifdef CONFIG_RTC_HIRES + /* enable overflow interrupt - alarm interrupt is enabled in stm32_rtc_setalarm */ + modifyreg16(STM32_RTC_CRH, 0, RTC_CRH_OWIE); #endif - /* Previous write is done? This is required prior writing into CRH */ + /* TODO: Get state from this function, if everything is + * okay and whether it is already enabled (if it was disabled + * reset upper time register) + */ - while ((getreg16(STM32_RTC_CRL) & RTC_CRL_RTOFF) == 0) - { - up_waste(); - } - - modifyreg16(STM32_RTC_CRH, 0, RTC_CRH_OWIE); + g_rtc_enabled = true; /* Alarm Int via EXTI Line */ @@ -432,6 +440,33 @@ int up_rtc_initialize(void) return OK; } +/************************************************************************************ + * Name: stm32_rtc_irqinitialize + * + * Description: + * Initialize IRQs for RTC, not possible during up_rtc_initialize because + * up_irqinitialize is called later. + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ************************************************************************************/ + +int stm32_rtc_irqinitialize(void) +{ + /* Configure RTC interrupt to catch overflow and alarm interrupts. */ + +#if defined(CONFIG_RTC_HIRES) || defined(CONFIG_RTC_ALARM) + irq_attach(STM32_IRQ_RTC, stm32_rtc_interrupt, NULL); + up_enable_irq(STM32_IRQ_RTC); +#endif + + return OK; +} + /************************************************************************************ * Name: up_rtc_time * @@ -613,6 +648,7 @@ int up_rtc_settime(FAR const struct timespec *tp) do { stm32_rtc_beginwr(); + putreg16(RTC_MAGIC, RTC_MAGIC_TIME_SET); putreg16(regvals.cnth, STM32_RTC_CNTH); putreg16(regvals.cntl, STM32_RTC_CNTL); cntl = getreg16(STM32_RTC_CNTL); @@ -652,6 +688,8 @@ int stm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) uint16_t cr; int ret = -EBUSY; + flags = enter_critical_section(); + /* Is there already something waiting on the ALARM? */ if (g_alarmcb == NULL) @@ -664,6 +702,8 @@ int stm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) stm32_rtc_breakout(tp, ®vals); + stm32_pwr_enablebkp(true); + /* Enable RTC alarm */ cr = getreg16(STM32_RTC_CRH); @@ -672,16 +712,18 @@ int stm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) /* The set the alarm */ - flags = enter_critical_section(); stm32_rtc_beginwr(); putreg16(regvals.cnth, STM32_RTC_ALRH); putreg16(regvals.cntl, STM32_RTC_ALRL); stm32_rtc_endwr(); - leave_critical_section(flags); + + stm32_pwr_enablebkp(false); ret = OK; } + leave_critical_section(flags); + return ret; } #endif @@ -706,6 +748,8 @@ int stm32_rtc_cancelalarm(void) irqstate_t flags; int ret = -ENODATA; + flags = enter_critical_section(); + if (g_alarmcb != NULL) { /* Cancel the global callback function */ @@ -714,16 +758,18 @@ int stm32_rtc_cancelalarm(void) /* Unset the alarm */ - flags = enter_critical_section(); + stm32_pwr_enablebkp(true); stm32_rtc_beginwr(); putreg16(0xffff, STM32_RTC_ALRH); putreg16(0xffff, STM32_RTC_ALRL); stm32_rtc_endwr(); - leave_critical_section(flags); + stm32_pwr_enablebkp(false); ret = OK; } + leave_critical_section(flags); + return ret; } #endif diff --git a/arch/arm/src/stm32/stm32f40xxx_rtcc.c b/arch/arm/src/stm32/stm32f40xxx_rtcc.c index e15c995a6c..751989b487 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rtcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rtcc.c @@ -1058,6 +1058,27 @@ int up_rtc_initialize(void) return OK; } +/************************************************************************************ + * Name: stm32_rtc_irqinitialize + * + * Description: + * Initialize IRQs for RTC, not possible during up_rtc_initialize because + * up_irqinitialize is called later. + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ************************************************************************************/ + +int stm32_rtc_irqinitialize(void) +{ + /* nothing to do */ + return OK; +} + /**************************************************************************** * Name: stm32_rtc_getdatetime_with_subseconds * diff --git a/arch/arm/src/stm32l4/stm32l4_rtcc.c b/arch/arm/src/stm32l4/stm32l4_rtcc.c index d053ee9929..9ca5c7b9f8 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rtcc.c @@ -1003,6 +1003,27 @@ int up_rtc_initialize(void) return OK; } +/************************************************************************************ + * Name: stm32_rtc_irqinitialize + * + * Description: + * Initialize IRQs for RTC, not possible during up_rtc_initialize because + * up_irqinitialize is called later. + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ************************************************************************************/ + +int stm32_rtc_irqinitialize(void) +{ + /* nothing to do */ + return OK; +} + /************************************************************************************ * Name: stm32l4_rtc_getdatetime_with_subseconds * From d8da813562ee81407dd3d27ed3fdbc090444414e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 14:53:45 -0600 Subject: [PATCH 24/55] stm32f103-minimum: Fix compiler error in MCP2415 logic. --- configs/stm32f103-minimum/src/stm32_mcp2515.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configs/stm32f103-minimum/src/stm32_mcp2515.c b/configs/stm32f103-minimum/src/stm32_mcp2515.c index 964af8ae8c..739cfe884a 100644 --- a/configs/stm32f103-minimum/src/stm32_mcp2515.c +++ b/configs/stm32f103-minimum/src/stm32_mcp2515.c @@ -70,9 +70,9 @@ struct stm32_mcp2515config_s /* Additional private definitions only known to this driver */ - MCP2515_HANDLE handle; /* The MCP2515 driver handle */ - mcp2515_handler_t handler; /* The MCP2515 interrupt handler */ - FAR void *arg; /* Argument to pass to the interrupt handler */ + FAR struct mcp2515_can_s *handle; /* The MCP2515 driver handle */ + mcp2515_handler_t handler; /* The MCP2515 interrupt handler */ + FAR void *arg; /* Argument to pass to the interrupt handler */ }; /**************************************************************************** @@ -146,7 +146,7 @@ static int mcp2515_attach(FAR struct mcp2515_config_s *state, (FAR struct stm32_mcp2515config_s *)state; irqstate_t flags; - caninfo("Saving handle %p\n", handler); + caninfo("Saving handler %p\n", handler); flags = enter_critical_section(); @@ -220,7 +220,7 @@ int stm32_mcp2515initialize(FAR const char *devpath) /* Save the opaque structure */ - g_mcp2515config.handle = (MCP2515_HANDLE) mcp2515; + g_mcp2515config.handle = mcp2515; /* Initialize the CAN Device with the MCP2515 operations */ From d66539287396e720ab2cf1f573c4abe800a5acf0 Mon Sep 17 00:00:00 2001 From: Hidetaka Takano Date: Wed, 14 Jun 2017 11:51:15 +0900 Subject: [PATCH 25/55] Fixed typo "CORTEXR5F" in arch/arm/Kconfig --- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 54f254ff68..2b70b7b0a9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -397,7 +397,7 @@ config ARCH_CORTEXR5 select ARCH_HAVE_MPU select ARCH_HAVE_COHERENT_DCACHE if ELF || MODULE -config ARCH_CORTEX5F +config ARCH_CORTEXR5F bool default n select ARCH_HAVE_MPU From 5591fc6b165aeb06cf42c520d6e9570fe9fd6d86 Mon Sep 17 00:00:00 2001 From: Hidetaka Takano Date: Wed, 14 Jun 2017 11:24:19 +0900 Subject: [PATCH 26/55] Fixed ARMv7-M Toolchain setting. - Cortex-M4 only have Single Precision FPU. --- arch/arm/src/armv7-m/Toolchain.defs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm/src/armv7-m/Toolchain.defs b/arch/arm/src/armv7-m/Toolchain.defs index 8cfcaa3e1d..74b1fcdcc3 100644 --- a/arch/arm/src/armv7-m/Toolchain.defs +++ b/arch/arm/src/armv7-m/Toolchain.defs @@ -128,11 +128,7 @@ ifeq ($(CONFIG_ARCH_CORTEXM4),y) TOOLCHAIN_MTUNE := -mtune=cortex-m4 TOOLCHAIN_MARCH := -march=armv7e-m ifeq ($(CONFIG_ARCH_FPU),y) - ifeq ($(CONFIG_ARCH_DPFPU),y) - TOOLCHAIN_MFLOAT := -mfpu=fpv4-sp -mfloat-abi=hard - else TOOLCHAIN_MFLOAT := -mfpu=fpv4-sp-d16 -mfloat-abi=hard - endif else TOOLCHAIN_MFLOAT := -mfloat-abi=soft endif From d1559392583632b04e9df85c3233c894585a7ac1 Mon Sep 17 00:00:00 2001 From: Hidetaka Takano Date: Thu, 15 Jun 2017 21:12:56 +0900 Subject: [PATCH 27/55] Improve configure.sh behavior (proposal). - enable to call from top directory. - enable to designate direct path for config. - install .gdbinit if the target has. --- tools/configure.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tools/configure.sh b/tools/configure.sh index 41e9223771..418fb77dd8 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -32,7 +32,7 @@ # POSSIBILITY OF SUCH DAMAGE. # -WD=`pwd` +WD=`test -d ${0%/*} && cd ${0%/*}; pwd` TOPDIR="${WD}/.." USAGE=" @@ -87,17 +87,21 @@ fi configpath=${TOPDIR}/configs/${boardconfig} if [ ! -d "${configpath}" ]; then - echo "Directory ${configpath} does not exist. Options are:" - echo "" - echo "Select one of the following options for :" - configlist=`find ${TOPDIR}/configs -name defconfig` - for defconfig in $configlist; do - config=`dirname $defconfig | sed -e "s,${TOPDIR}/configs/,,g"` - echo " $config" - done - echo "" - echo "$USAGE" - exit 3 + # Try direct path for convenience. + configpath=${TOPDIR}/${boardconfig} + if [ ! -d "${configpath}" ]; then + echo "Directory ${configpath} does not exist. Options are:" + echo "" + echo "Select one of the following options for :" + configlist=`find ${TOPDIR}/configs -name defconfig` + for defconfig in ${configlist}; do + config=`dirname ${defconfig} | sed -e "s,${TOPDIR}/configs/,,g"` + echo " ${config}" + done + echo "" + echo "$USAGE" + exit 3 + fi fi src_makedefs="${configpath}/Make.defs" @@ -176,6 +180,7 @@ install -m 644 "${src_makedefs}" "${dest_makedefs}" || \ { echo "Failed to copy \"${src_makedefs}\"" ; exit 7 ; } install -m 644 "${src_config}" "${dest_config}" || \ { echo "Failed to copy \"${src_config}\"" ; exit 9 ; } +test -f "${configpath}/.gdbinit" && install "${configpath}/.gdbinit" "${TOPDIR}/" # If we did not use the CONFIG_APPS_DIR that was in the defconfig config file, # then append the correct application information to the tail of the .config From d958cec7a4a1a39e3bdb3a664d5d1fed5ee4ee61 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 Jun 2017 15:32:54 -0600 Subject: [PATCH 28/55] Cosmetic changes from review of last PR --- arch/arm/src/stm32/stm32_irq.c | 3 ++- arch/arm/src/stm32/stm32_rtc.h | 27 +++++++++++++++------------ arch/arm/src/stm32/stm32_rtcc.c | 4 ++-- arch/arm/src/stm32/stm32_rtcounter.c | 18 +++++++++++------- arch/arm/src/stm32/stm32f40xxx_rtcc.c | 3 ++- arch/arm/src/stm32l4/stm32l4_rtcc.c | 5 +++-- 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index 0f9553210a..98adf74f36 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/stm32_irq.c * - * Copyright (C) 2009-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -389,6 +389,7 @@ void up_irqinitialize(void) #ifdef CONFIG_RTC /* RTC was initialized earlier but IRQs weren't ready at that time */ + stm32_rtc_irqinitialize(); #endif diff --git a/arch/arm/src/stm32/stm32_rtc.h b/arch/arm/src/stm32/stm32_rtc.h index 0c4e5ecbf3..6271a97ed7 100644 --- a/arch/arm/src/stm32/stm32_rtc.h +++ b/arch/arm/src/stm32/stm32_rtc.h @@ -2,7 +2,7 @@ * arch/arm/src/stm32/stm32_rtc.h * * Copyright (C) 2011 Uros Platise. All rights reserved. - * Copyright (C) 2011-2013, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2015-2017 Gregory Nutt. All rights reserved. * Author: Uros Platise (Original for the F1) * Gregory Nutt (On-going support and development) * @@ -76,37 +76,40 @@ * Pre-processor Definitions ****************************************************************************/ -#define STM32_RTC_PRESCALER_SECOND 32767 /* Default prescaler to get a second base */ -#define STM32_RTC_PRESCALER_MIN 1 /* Maximum speed of 16384 Hz */ +#define STM32_RTC_PRESCALER_SECOND 32767 /* Default prescaler to get a + * second base */ +#define STM32_RTC_PRESCALER_MIN 1 /* Maximum speed of 16384 Hz */ #if defined(CONFIG_STM32_STM32F10XX) -/* RTC is only a counter, store RTC data in backup domain register DR1 (if CONFIG_RTC_HIRES) and DR2 (state) */ +/* RTC is only a counter, store RTC data in backup domain register DR1 (if + * CONFIG_RTC_HIRES) and DR2 (state). + */ #if !defined(CONFIG_RTC_MAGIC) -# define CONFIG_RTC_MAGIC (0xface) /* only 16 bit */ +# define CONFIG_RTC_MAGIC (0xface) /* only 16 bit */ #endif -#define RTC_MAGIC_REG STM32_BKP_DR2 +#define RTC_MAGIC_REG STM32_BKP_DR2 #else /* !CONFIG_STM32_STM32F10XX */ #if !defined(CONFIG_RTC_MAGIC) -# define CONFIG_RTC_MAGIC (0xfacefeee) +# define CONFIG_RTC_MAGIC (0xfacefeee) #endif #if !defined(CONFIG_RTC_MAGIC_REG) -# define CONFIG_RTC_MAGIC_REG (0) +# define CONFIG_RTC_MAGIC_REG (0) #endif -#define RTC_MAGIC_REG STM32_RTC_BKR(CONFIG_RTC_MAGIC_REG) +#define RTC_MAGIC_REG STM32_RTC_BKR(CONFIG_RTC_MAGIC_REG) #endif /* CONFIG_STM32_STM32F10XX */ -#define RTC_MAGIC CONFIG_RTC_MAGIC -#define RTC_MAGIC_TIME_SET CONFIG_RTC_MAGIC_TIME_SET +#define RTC_MAGIC CONFIG_RTC_MAGIC +#define RTC_MAGIC_TIME_SET CONFIG_RTC_MAGIC_TIME_SET #if !defined(CONFIG_RTC_MAGIC_TIME_SET) -# define CONFIG_RTC_MAGIC_TIME_SET (CONFIG_RTC_MAGIC + 1) +# define CONFIG_RTC_MAGIC_TIME_SET (CONFIG_RTC_MAGIC + 1) #endif /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c index b7c96f336a..1e03d89ba1 100644 --- a/arch/arm/src/stm32/stm32_rtcc.c +++ b/arch/arm/src/stm32/stm32_rtcc.c @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/stm32/stm32_rtcc.c * - * Copyright (C) 2012-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -788,7 +788,7 @@ int stm32_rtc_irqinitialize(void) #ifdef CONFIG_RTC_ALARM # warning "Missing EXTI setup logic" - /* then attach the ALARM interrupt handler */ + /* Attach the ALARM interrupt handler */ irq_attach(STM32_IRQ_RTC_WKUP, rtc_interrupt, NULL); up_enable_irq(STM32_IRQ_RTC_WKUP); diff --git a/arch/arm/src/stm32/stm32_rtcounter.c b/arch/arm/src/stm32/stm32_rtcounter.c index 5db3865c0d..b42740b0e1 100644 --- a/arch/arm/src/stm32/stm32_rtcounter.c +++ b/arch/arm/src/stm32/stm32_rtcounter.c @@ -6,7 +6,7 @@ * * With extensions, modifications by: * - * Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregroy Nutt * * Redistribution and use in source and binary forms, with or without @@ -384,21 +384,22 @@ int up_rtc_initialize(void) stm32_pwr_enablebkp(true); regval = getreg32(RTC_MAGIC_REG); - if (regval != RTC_MAGIC && regval != RTC_MAGIC_TIME_SET) { - /* reset backup domain if bad magic */ + /* Reset backup domain if bad magic */ + modifyreg32(STM32_RCC_BDCR, 0, RCC_BDCR_BDRST); modifyreg32(STM32_RCC_BDCR, RCC_BDCR_BDRST, 0); putreg16(RTC_MAGIC, RTC_MAGIC_REG); } /* Select the lower power external 32,768Hz (Low-Speed External, LSE) oscillator - * as RTC Clock Source and enable the Clock */ + * as RTC Clock Source and enable the Clock. + */ modifyreg16(STM32_RCC_BDCR, RCC_BDCR_RTCSEL_MASK, RCC_BDCR_RTCSEL_LSE); - /* enable RTC and wait for RSF */ + /* Enable RTC and wait for RSF */ modifyreg16(STM32_RCC_BDCR, 0, RCC_BDCR_RTCEN); @@ -416,7 +417,10 @@ int up_rtc_initialize(void) stm32_rtc_wait4rsf(); #ifdef CONFIG_RTC_HIRES - /* enable overflow interrupt - alarm interrupt is enabled in stm32_rtc_setalarm */ + /* Enable overflow interrupt - alarm interrupt is enabled in + * stm32_rtc_setalarm. + */ + modifyreg16(STM32_RTC_CRH, 0, RTC_CRH_OWIE); #endif @@ -457,9 +461,9 @@ int up_rtc_initialize(void) int stm32_rtc_irqinitialize(void) { +#if defined(CONFIG_RTC_HIRES) || defined(CONFIG_RTC_ALARM) /* Configure RTC interrupt to catch overflow and alarm interrupts. */ -#if defined(CONFIG_RTC_HIRES) || defined(CONFIG_RTC_ALARM) irq_attach(STM32_IRQ_RTC, stm32_rtc_interrupt, NULL); up_enable_irq(STM32_IRQ_RTC); #endif diff --git a/arch/arm/src/stm32/stm32f40xxx_rtcc.c b/arch/arm/src/stm32/stm32f40xxx_rtcc.c index 751989b487..a2af73794e 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rtcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rtcc.c @@ -1075,7 +1075,8 @@ int up_rtc_initialize(void) int stm32_rtc_irqinitialize(void) { - /* nothing to do */ + /* Nothing to do */ + return OK; } diff --git a/arch/arm/src/stm32l4/stm32l4_rtcc.c b/arch/arm/src/stm32l4/stm32l4_rtcc.c index 9ca5c7b9f8..05f4ff5ae2 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rtcc.c @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/stm32l4/stm32l4_rtcc.c * - * Copyright (C) 2012-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * dev@ziggurat29.com (adaptations to stm32l4) * @@ -1020,7 +1020,8 @@ int up_rtc_initialize(void) int stm32_rtc_irqinitialize(void) { - /* nothing to do */ + /* Nothing to do */ + return OK; } From fe5b3a58e4c941d5da73cf61e6a7284472770713 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 08:24:28 -0600 Subject: [PATCH 29/55] Update tools/configure.c to same functionality as configure.sh. Add an array of optional file names. Currently, .gdbinit is the only optional file but other things like IDE-specific project files might need to be copied as well. --- tools/configure.c | 97 ++++++++++++++++++++++++++++++++++++++++++++-- tools/configure.sh | 16 +++++++- 2 files changed, 107 insertions(+), 6 deletions(-) diff --git a/tools/configure.c b/tools/configure.c index 8a40981d2b..bb3cd9a67d 100644 --- a/tools/configure.c +++ b/tools/configure.c @@ -1,7 +1,7 @@ /**************************************************************************** * tools/configure.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,15 @@ static char g_buffer[BUFFER_SIZE]; /* Scratch buffer for forming full p static struct variable_s *g_configvars = NULL; static struct variable_s *g_versionvars = NULL; +/* Optional configuration files */ + +static const char *g_optfiles[] = +{ + ".gdbinit" +}; + +#define N_OPTFILES (sizeof(g_optfiles) / sizeof(const char *)) + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -240,6 +249,25 @@ static void parse_args(int argc, char **argv) } } +static bool check_directory(const char *directory) +{ + struct stat buf; + + if (stat(directory, &buf) < 0) + { + debug("stat of %s failed: %s\n", directory, strerror(errno)); + return false; + } + + if (!S_ISDIR(buf.st_mode)) + { + debug("%s exists but is not a directory\n", directory); + return false; + } + + return true; +} + static void verify_directory(const char *directory) { struct stat buf; @@ -319,9 +347,14 @@ static bool verify_file(const char *path) return true; } -static void get_topdir(void) +static void find_topdir(void) { + char *currdir; + /* Get and verify the top-level NuttX directory */ + /* First get the current directory. We expect this to be either + * the nuttx root directory or the tools subdirectory. + */ if (getcwd(g_buffer, BUFFER_SIZE) == NULL) { @@ -329,9 +362,38 @@ static void get_topdir(void) exit(EXIT_FAILURE); } + /* Assume that we are in the tools sub-directory and the directory above + * is the nuttx root directory. + */ + + currdir = strdup(g_buffer); g_topdir = strdup(dirname(g_buffer)); - debug("get_topdir: Checking topdir=%s\n", g_topdir); + + debug("get_topdir: Checking parent directory: %s\n", g_topdir); verify_directory(g_topdir); + + /* Check if the current directory is the nuttx root directory. + * If so, then the tools directory should be a sub-directory. + */ + + snprintf(g_buffer, BUFFER_SIZE, "%s%ctools", currdir, g_delim); + debug("get_topdir: Checking topdir/tools=%s\n", g_buffer); + if (check_directory(g_buffer)) + { + /* There is a tools sub-directory under the current directory. + * We must have already been in the nuttx root directory. We + * will find out for sure in later tests. + */ + + free(g_topdir); + g_topdir = currdir; + } + else + { + /* Yes, we are probably in the tools/ sub-directory */ + + free(currdir); + } } static void config_search(const char *boarddir) @@ -714,6 +776,29 @@ static void substitute(char *str, int ch1, int ch2) } } +static void copy_optional(void) +{ + int i; + + for (i = 0; i < N_OPTFILES; i++) + { + snprintf(g_buffer, BUFFER_SIZE, "%s%c%s", + g_configpath, g_delim, g_optfiles[i]); + + if (verify_file(g_buffer)) + { + char *optsrc = strdup(g_buffer); + + snprintf(g_buffer, BUFFER_SIZE, "%s%c.config", g_topdir, g_delim); + + debug("copy_optional: Copying from %s to %s\n", optsrc, g_buffer); + copy_file(optsrc, g_buffer, 0644); + + free(optsrc); + } + } +} + static void configure(void) { char *destconfig; @@ -731,6 +816,10 @@ static void configure(void) debug("configure: Copying from %s to %s\n", g_srcmakedefs, g_buffer); copy_file(g_srcmakedefs, g_buffer, 0644); + /* Copy optional files */ + + copy_optional(); + /* If we did not use the CONFIG_APPS_DIR that was in the defconfig config file, * then append the correct application information to the tail of the .config * file @@ -792,7 +881,7 @@ int main(int argc, char **argv, char **envp) parse_args(argc, argv); debug("main: Checking Nuttx Directories\n"); - get_topdir(); + find_topdir(); check_configdir(); debug("main: Reading the configuration/version files\n"); diff --git a/tools/configure.sh b/tools/configure.sh index 418fb77dd8..87af192271 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -1,7 +1,7 @@ #!/bin/bash # configure.sh # -# Copyright (C) 2007, 2008, 2011, 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2007, 2008, 2011, 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -45,6 +45,12 @@ Where: " +# A list of optional files that may be installed + +OPTFILES="\ + .gdbinit +" + # Parse command arguments unset boardconfig @@ -88,6 +94,7 @@ fi configpath=${TOPDIR}/configs/${boardconfig} if [ ! -d "${configpath}" ]; then # Try direct path for convenience. + configpath=${TOPDIR}/${boardconfig} if [ ! -d "${configpath}" ]; then echo "Directory ${configpath} does not exist. Options are:" @@ -180,7 +187,12 @@ install -m 644 "${src_makedefs}" "${dest_makedefs}" || \ { echo "Failed to copy \"${src_makedefs}\"" ; exit 7 ; } install -m 644 "${src_config}" "${dest_config}" || \ { echo "Failed to copy \"${src_config}\"" ; exit 9 ; } -test -f "${configpath}/.gdbinit" && install "${configpath}/.gdbinit" "${TOPDIR}/" + +# Install any optional files + +for opt in ${OPTFILES}; do + test -f "${configpath}/${opt}" && install "${configpath}/${opt}" "${TOPDIR}/" +done # If we did not use the CONFIG_APPS_DIR that was in the defconfig config file, # then append the correct application information to the tail of the .config From 8a4bac43a1c8d22c94bb65520a5445cb8d8d9661 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 09:59:32 -0600 Subject: [PATCH 30/55] tool/configure will now copy Eclipse project files if they are present in the board directory file --- .gitignore | 4 +++- Makefile.unix | 3 +++ Makefile.win | 3 +++ tools/configure.c | 4 +++- tools/configure.sh | 4 +++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fd06298905..4095c1a294 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ Make.dep .swp .*.swp core -.gdbinit +/.gdbinit /cscope.* /.config /.config.old @@ -24,5 +24,7 @@ core /*.bin /*.ihx /*.hex +/.cproject +/.project /pcode /tags diff --git a/Makefile.unix b/Makefile.unix index bfdc3c5a8d..cca3c1cd6c 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -556,6 +556,9 @@ clean: subdir_clean $(call DELFILE, _SAVED_APPS_config) $(call DELFILE, nuttx-export*) $(call DELFILE, nuttx_user*) + $(call DELFILE, .gdbinit) + $(call DELFILE, .cproject) + $(call DELFILE, .project) $(call CLEAN) subdir_distclean: diff --git a/Makefile.win b/Makefile.win index a023c6e013..91a6e66f91 100644 --- a/Makefile.win +++ b/Makefile.win @@ -538,6 +538,9 @@ clean: subdir_clean $(call DELFILE, _SAVED_APPS_config) $(call DELFILE, nuttx-export*) $(call DELFILE, nuttx_user*) + $(call DELFILE, .gdbinit) + $(call DELFILE, .cproject) + $(call DELFILE, .project) $(call CLEAN) subdir_distclean: diff --git a/tools/configure.c b/tools/configure.c index bb3cd9a67d..80c3b3d5cf 100644 --- a/tools/configure.c +++ b/tools/configure.c @@ -100,7 +100,9 @@ static struct variable_s *g_versionvars = NULL; static const char *g_optfiles[] = { - ".gdbinit" + ".gdbinit", + ".cproject", + ".project" }; #define N_OPTFILES (sizeof(g_optfiles) / sizeof(const char *)) diff --git a/tools/configure.sh b/tools/configure.sh index 87af192271..1cae32ae73 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -48,7 +48,9 @@ Where: # A list of optional files that may be installed OPTFILES="\ - .gdbinit + .gdbinit\ + .cproject\ + .project\ " # Parse command arguments From d5acc050ccd4e89dff2aef239e9a8c1fa12ec684 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 10:03:56 -0600 Subject: [PATCH 31/55] Upate the top-level README.txt file --- README.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index 8e466a7dd4..301fdf72d8 100644 --- a/README.txt +++ b/README.txt @@ -583,13 +583,18 @@ Instantiating "Canned" Configurations included in the build and what is not. This file is also used to generate a C configuration header at include/nuttx/config.h. + Copy other, environment-specic files to ${TOPDIR + + This might include files like .gdbinit or IDE configuration files + like .project or .cproject. + General information about configuring NuttX can be found in: ${TOPDIR}/configs/README.txt ${TOPDIR}/configs//README.txt - There is a configuration script in the tools/ directory that makes this - easier. It is used as follows: + There is a configuration script in the tools/ directory that makes does + all of the above steps for you. It is used as follows: cd ${TOPDIR}/tools ./configure.sh / @@ -600,6 +605,10 @@ Instantiating "Canned" Configurations cd ${TOPDIR}\tools configure.bat \ + And, to make sure that other platform is supported, there is also a + C program at tools/configure.c that can be compiled to establish the + board configuration. + See tools/README.txt for more information about these scripts. Refreshing Configurations From e30501ebd4087994cd5253a71248c6a2e1c5329e Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Wed, 14 Jun 2017 02:49:27 -0400 Subject: [PATCH 32/55] wireless/ieee802154: Lots of fixes, cleanup, new functionality. Functional --- .../clicker2-stm32/mrf24j40-radio/defconfig | 5 +- drivers/wireless/ieee802154/mrf24j40.c | 344 +- drivers/wireless/ieee802154/mrf24j40.h | 5 + .../wireless/ieee802154/ieee802154_mac.h | 210 +- .../wireless/ieee802154/ieee802154_radio.h | 10 +- net/sixlowpan/sixlowpan_framer.c | 16 +- net/sixlowpan/sixlowpan_utils.c | 2 +- wireless/ieee802154/Make.defs | 7 +- wireless/ieee802154/mac802154.c | 2783 ++++------------- wireless/ieee802154/mac802154.h | 4 +- wireless/ieee802154/mac802154_assoc.c | 949 ++++++ wireless/ieee802154/mac802154_assoc.h | 75 + wireless/ieee802154/mac802154_bind.c | 80 + wireless/ieee802154/mac802154_data.c | 331 ++ wireless/ieee802154/mac802154_data.h | 64 + wireless/ieee802154/mac802154_device.c | 4 +- wireless/ieee802154/mac802154_disassoc.c | 79 + wireless/ieee802154/mac802154_get_mhrlen.c | 135 + wireless/ieee802154/mac802154_getset.c | 181 ++ wireless/ieee802154/mac802154_gts.c | 72 + wireless/ieee802154/mac802154_internal.h | 405 +++ wireless/ieee802154/mac802154_ioctl.c | 169 + wireless/ieee802154/mac802154_notif.c | 208 ++ wireless/ieee802154/mac802154_notif.h | 82 + wireless/ieee802154/mac802154_orphan.c | 71 + wireless/ieee802154/mac802154_poll.c | 376 +++ wireless/ieee802154/mac802154_poll.h | 66 + wireless/ieee802154/mac802154_purge.c | 83 + wireless/ieee802154/mac802154_reset.c | 159 + wireless/ieee802154/mac802154_rxenable.c | 78 + wireless/ieee802154/mac802154_scan.c | 82 + wireless/ieee802154/mac802154_start.c | 167 + wireless/ieee802154/mac802154_sync.c | 78 + 33 files changed, 5042 insertions(+), 2338 deletions(-) create mode 100644 wireless/ieee802154/mac802154_assoc.c create mode 100644 wireless/ieee802154/mac802154_assoc.h create mode 100644 wireless/ieee802154/mac802154_bind.c create mode 100644 wireless/ieee802154/mac802154_data.c create mode 100644 wireless/ieee802154/mac802154_data.h create mode 100644 wireless/ieee802154/mac802154_disassoc.c create mode 100644 wireless/ieee802154/mac802154_get_mhrlen.c create mode 100644 wireless/ieee802154/mac802154_getset.c create mode 100644 wireless/ieee802154/mac802154_gts.c create mode 100644 wireless/ieee802154/mac802154_internal.h create mode 100644 wireless/ieee802154/mac802154_ioctl.c create mode 100644 wireless/ieee802154/mac802154_notif.c create mode 100644 wireless/ieee802154/mac802154_notif.h create mode 100644 wireless/ieee802154/mac802154_orphan.c create mode 100644 wireless/ieee802154/mac802154_poll.c create mode 100644 wireless/ieee802154/mac802154_poll.h create mode 100644 wireless/ieee802154/mac802154_purge.c create mode 100644 wireless/ieee802154/mac802154_reset.c create mode 100644 wireless/ieee802154/mac802154_rxenable.c create mode 100644 wireless/ieee802154/mac802154_scan.c create mode 100644 wireless/ieee802154/mac802154_start.c create mode 100644 wireless/ieee802154/mac802154_sync.c diff --git a/configs/clicker2-stm32/mrf24j40-radio/defconfig b/configs/clicker2-stm32/mrf24j40-radio/defconfig index b258d177c3..2455c08c41 100644 --- a/configs/clicker2-stm32/mrf24j40-radio/defconfig +++ b/configs/clicker2-stm32/mrf24j40-radio/defconfig @@ -125,7 +125,6 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="stm32" -# CONFIG_ARCH_TOOLCHAIN_IAR is not set # CONFIG_ARMV7M_USEBASEPRI is not set CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARMV7M_CMNVECTOR is not set @@ -534,6 +533,7 @@ CONFIG_STM32_USART3_SERIALDRIVER=y # # USB Device Configuration # +# CONFIG_ARCH_TOOLCHAIN_IAR is not set CONFIG_ARCH_TOOLCHAIN_GNU=y # @@ -979,6 +979,7 @@ CONFIG_IOB_NCHAINS=0 # CONFIG_WIRELESS=y CONFIG_WIRELESS_IEEE802154=y +CONFIG_IEEE802154_DEFAULT_EADDR=0x00fade00deadbeef CONFIG_IEEE802154_MAC_DEV=y CONFIG_MAC802154_HPWORK=y CONFIG_IEEE802154_NTXDESC=3 @@ -1109,7 +1110,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # CONFIG_C99_BOOL8 is not set CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_CXX_NEWLONG is not set # @@ -1340,6 +1340,7 @@ CONFIG_NSH_ARCHINIT=y # Platform-specific Support # # CONFIG_PLATFORM_CONFIGDATA is not set +CONFIG_HAVE_CXXINITIALIZE=y # # System Libraries and NSH Add-Ons diff --git a/drivers/wireless/ieee802154/mrf24j40.c b/drivers/wireless/ieee802154/mrf24j40.c index 40efb3945a..90fd913334 100644 --- a/drivers/wireless/ieee802154/mrf24j40.c +++ b/drivers/wireless/ieee802154/mrf24j40.c @@ -103,6 +103,22 @@ #define MRF24J40_GTS_SLOTS 2 +/* + * Formula for calculating default macMaxFrameWaitTime is on pg. 130 + * + * For PHYs other than CSS and UWB, the attribute phyMaxFrameDuration is given by: + * + * phyMaxFrameDuration = phySHRDuration + + * ceiling([aMaxPHYPacketSize + 1] x phySymbolsPerOctet) + * + * where ceiling() is a function that returns the smallest integer value greater + * than or equal to its argument value. [1] pg. 158 +*/ + +#define MRF24J40_DEFAULT_MAX_FRAME_WAITTIME 1824 + +#define MRF24J40_SYMBOL_DURATION_PS 16000000 + /**************************************************************************** * Private Types ****************************************************************************/ @@ -138,11 +154,15 @@ struct mrf24j40_radio_s int32_t txpower; /* TX power in mBm = dBm/100 */ struct ieee802154_cca_s cca; /* Clear channel assessement method */ - struct ieee802154_txdesc_s *txdelayed_desc; - bool txdelayed_busy; + /* MAC PIB attributes */ + uint32_t max_frame_waittime; + + struct ieee802154_txdesc_s *txdelayed_desc; struct ieee802154_txdesc_s *csma_desc; - bool csma_busy; + bool txdelayed_busy : 1; + bool csma_busy : 1; + bool reschedule_csma : 1; struct ieee802154_txdesc_s *gts_desc[MRF24J40_GTS_SLOTS]; bool gts_busy[MRF24J40_GTS_SLOTS]; @@ -178,13 +198,15 @@ static int mrf24j40_interrupt(int irq, FAR void *context, FAR void *arg); static void mrf24j40_dopoll_csma(FAR void *arg); static void mrf24j40_dopoll_gts(FAR void *arg); -static int mrf24j40_csma_setup(FAR struct mrf24j40_radio_s *dev, - FAR struct iob_s *frame); +static int mrf24j40_norm_setup(FAR struct mrf24j40_radio_s *dev, + FAR struct iob_s *frame, bool csma); static int mrf24j40_gts_setup(FAR struct mrf24j40_radio_s *dev, uint8_t gts, FAR struct iob_s *frame); static int mrf24j40_setup_fifo(FAR struct mrf24j40_radio_s *dev, FAR struct iob_s *frame, uint32_t fifo_addr); +static inline void mrf24j40_norm_trigger(FAR struct mrf24j40_radio_s *dev); + static int mrf24j40_setchannel(FAR struct mrf24j40_radio_s *dev, uint8_t chan); static int mrf24j40_getchannel(FAR struct mrf24j40_radio_s *dev, @@ -225,11 +247,12 @@ static int mrf24j40_txnotify(FAR struct ieee802154_radio_s *radio, bool gts); static int mrf24j40_txdelayed(FAR struct ieee802154_radio_s *radio, FAR struct ieee802154_txdesc_s *txdesc, uint32_t symboldelay); +static int mrf24j40_reset_attrs(FAR struct ieee802154_radio_s *radio); static int mrf24j40_get_attr(FAR struct ieee802154_radio_s *radio, - enum ieee802154_pib_attr_e pib_attr, + enum ieee802154_attr_e attr, FAR union ieee802154_attr_u *attrval); static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, - enum ieee802154_pib_attr_e pib_attr, + enum ieee802154_attr_e attr, FAR const union ieee802154_attr_u *attrval); static int mrf24j40_rxenable(FAR struct ieee802154_radio_s *dev, bool enable); static int mrf24j40_req_rxenable(FAR struct ieee802154_radio_s *radio, @@ -313,7 +336,7 @@ static int mrf24j40_txnotify(FAR struct ieee802154_radio_s *radio, bool gts) * Description: * Transmit a packet without regard to supeframe structure after a certain * number of symbols. This function is used to send Data Request responses. - * It can also be used to send data immediately is the delay is set to 0. + * It can also be used to send data immediately if the delay is set to 0. * * Parameters: * radio - Reference to the radio driver state structure @@ -330,32 +353,104 @@ static int mrf24j40_txdelayed(FAR struct ieee802154_radio_s *radio, uint32_t symboldelay) { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; - - /* An immediate transaction uses the CSMA FIFO. If there is a CSMA transaction - * in use, cancel it and put it back when we are done */ - - - + uint8_t reg; + /* Get exclusive access to the radio device */ - return -ENOTTY; + if (sem_wait(&dev->exclsem) != 0) + { + return -EINTR; + } + + /* There should never be more than one of these transactions at once. */ + + DEBUGASSERT(!dev->txdelayed_busy); + + dev->txdelayed_desc = txdesc; + dev->txdelayed_busy = true; + + /* Disable the TX norm interrupt and clear it */ + + reg = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); + reg |= MRF24J40_INTCON_TXNIE; + mrf24j40_setreg(dev->spi, MRF24J40_INTCON, reg); + + /* If after disabling the interrupt, the irqworker is not scheduled, there + * are no interrupts to worry about. However, if there is work scheduled, + * we need to process it before going any further. + */ + + if (!work_available(&dev->irqwork)) + { + work_cancel(HPWORK, &dev->irqwork); + sem_post(&dev->exclsem); + mrf24j40_irqworker((FAR void *)dev); + + /* Get exclusive access to the radio device */ + + if (sem_wait(&dev->exclsem) != 0) + { + return -EINTR; + } + } + + if (dev->csma_busy) + { + dev->reschedule_csma = true; + } + + mrf24j40_norm_setup(dev, txdesc->frame, false); + + if (symboldelay == 0) + { + mrf24j40_norm_trigger(dev); + } + else + { + mrf24j40_mactimer(dev, symboldelay); + } + + sem_post(&dev->exclsem); + + return OK; +} + +static int mrf24j40_reset_attrs(FAR struct ieee802154_radio_s *radio) +{ + FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; + + dev->max_frame_waittime = MRF24J40_DEFAULT_MAX_FRAME_WAITTIME; + + return OK; } static int mrf24j40_get_attr(FAR struct ieee802154_radio_s *radio, - enum ieee802154_pib_attr_e pib_attr, + enum ieee802154_attr_e attr, FAR union ieee802154_attr_u *attrval) { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; int ret; - switch (pib_attr) + switch (attr) { - case IEEE802154_PIB_MAC_EXTENDED_ADDR: + case IEEE802154_ATTR_MAC_EXTENDED_ADDR: { memcpy(&attrval->mac.eaddr[0], &dev->addr.eaddr[0], 8); ret = IEEE802154_STATUS_SUCCESS; } break; + case IEEE802154_ATTR_MAC_MAX_FRAME_WAITTIME: + { + attrval->mac.max_frame_waittime = dev->max_frame_waittime; + ret = IEEE802154_STATUS_SUCCESS; + } + break; + case IEEE802154_ATTR_PHY_SYMBOL_DURATION: + { + attrval->phy.symdur_picosec = MRF24J40_SYMBOL_DURATION_PS; + ret = IEEE802154_STATUS_SUCCESS; + } + break; default: ret = IEEE802154_STATUS_UNSUPPORTED_ATTRIBUTE; } @@ -363,21 +458,33 @@ static int mrf24j40_get_attr(FAR struct ieee802154_radio_s *radio, } static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, - enum ieee802154_pib_attr_e pib_attr, + enum ieee802154_attr_e attr, FAR const union ieee802154_attr_u *attrval) { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; int ret; - switch (pib_attr) + switch (attr) { - case IEEE802154_PIB_MAC_EXTENDED_ADDR: + case IEEE802154_ATTR_MAC_PANID: + { + mrf24j40_setpanid(dev, attrval->mac.panid); + ret = IEEE802154_STATUS_SUCCESS; + } + break; + case IEEE802154_ATTR_MAC_SHORT_ADDRESS: + { + mrf24j40_setsaddr(dev, attrval->mac.saddr); + ret = IEEE802154_STATUS_SUCCESS; + } + break; + case IEEE802154_ATTR_MAC_EXTENDED_ADDR: { mrf24j40_seteaddr(dev, &attrval->mac.eaddr[0]); ret = IEEE802154_STATUS_SUCCESS; } break; - case IEEE802154_PIB_MAC_PROMISCUOUS_MODE: + case IEEE802154_ATTR_MAC_PROMISCUOUS_MODE: { if (attrval->mac.promisc_mode) { @@ -391,7 +498,7 @@ static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, ret = IEEE802154_STATUS_SUCCESS; } break; - case IEEE802154_PIB_MAC_RX_ON_WHEN_IDLE: + case IEEE802154_ATTR_MAC_RX_ON_WHEN_IDLE: { dev->rxonidle = attrval->mac.rxonidle; mrf24j40_rxenable(radio, dev->rxonidle); @@ -419,35 +526,31 @@ static int mrf24j40_req_rxenable(FAR struct ieee802154_radio_s *radio, static void mrf24j40_mactimer(FAR struct mrf24j40_radio_s *dev, int numsymbols) { uint16_t nhalfsym; - uint8_t intcon; + uint8_t reg; nhalfsym = (numsymbols << 1); - /* Get exclusive access to the device */ - - while (sem_wait(&dev->exclsem) != 0) { } - /* Disable the interrupt, clear the timer count */ - intcon = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); - intcon &= ~MRF24J40_INTCON_HSYMTMRIE; - mrf24j40_setreg(dev->spi, MRF24J40_INTCON, intcon); + reg = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); + reg |= MRF24J40_INTCON_HSYMTMRIE; + mrf24j40_setreg(dev->spi, MRF24J40_INTCON, reg); mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRL, 0x00); mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRH, 0x00); + reg &= ~MRF24J40_INTCON_HSYMTMRIE; + mrf24j40_setreg(dev->spi, MRF24J40_INTCON, reg); + /* Set the timer count and enable interrupts */ - mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRL, nhalfsym & 0xFF); - mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRH, (nhalfsym >> 8) & 0xFF); + reg = (nhalfsym & 0xFF); + mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRL, reg); - intcon |= MRF24J40_INTCON_HSYMTMRIE; - mrf24j40_setreg(dev->spi, MRF24J40_INTCON, intcon); - - sem_post(&dev->exclsem); + reg = (nhalfsym >> 8) & 0xFF; + mrf24j40_setreg(dev->spi, MRF24J40_HSYMTMRH, reg); } - /**************************************************************************** * Function: mrf24j40_dopoll_csma * @@ -493,7 +596,8 @@ static void mrf24j40_dopoll_csma(FAR void *arg) /* Setup the transaction on the device in the CSMA FIFO */ - mrf24j40_csma_setup(dev, dev->csma_desc->frame); + mrf24j40_norm_setup(dev, dev->csma_desc->frame, true); + mrf24j40_norm_trigger(dev); } } @@ -1301,15 +1405,15 @@ static int mrf24j40_energydetect(FAR struct mrf24j40_radio_s *dev, } /**************************************************************************** - * Name: mrf24j40_csma_setup + * Name: mrf24j40_norm_setup * * Description: - * Setup a CSMA transaction in the normal TX FIFO + * Setup a transaction in the normal TX FIFO * ****************************************************************************/ -static int mrf24j40_csma_setup(FAR struct mrf24j40_radio_s *dev, - FAR struct iob_s *frame) +static int mrf24j40_norm_setup(FAR struct mrf24j40_radio_s *dev, + FAR struct iob_s *frame, bool csma) { uint8_t reg; int ret; @@ -1320,6 +1424,21 @@ static int mrf24j40_csma_setup(FAR struct mrf24j40_radio_s *dev, reg &= ~MRF24J40_INTCON_TXNIE; mrf24j40_setreg(dev->spi, MRF24J40_INTCON, reg); + /* Enable/Disable CSMA mode */ + + reg = mrf24j40_getreg(dev->spi, MRF24J40_TXMCR); + + if (csma) + { + reg &= ~MRF24J40_TXMCR_NOCSMA; + } + else + { + reg |= MRF24J40_TXMCR_NOCSMA; + } + + mrf24j40_setreg(dev->spi, MRF24J40_TXMCR, reg); + /* Setup the FIFO */ ret = mrf24j40_setup_fifo(dev, frame, MRF24J40_TXNORM_FIFO); @@ -1328,18 +1447,41 @@ static int mrf24j40_csma_setup(FAR struct mrf24j40_radio_s *dev, * TXNACKREQ bit. See IEEE 802.15.4/2003 7.2.1.1 page 112 for info. */ - reg = MRF24J40_TXNCON_TXNTRIG; + reg = mrf24j40_getreg(dev->spi, MRF24J40_TXNCON); + if (frame->io_data[0] & IEEE802154_FRAMECTRL_ACKREQ) { reg |= MRF24J40_TXNCON_TXNACKREQ; } - - /* Trigger packet emission */ + else + { + reg &= ~MRF24J40_TXNCON_TXNACKREQ; + } mrf24j40_setreg(dev->spi, MRF24J40_TXNCON, reg); + return ret; } +/**************************************************************************** + * Name: mrf24j40_norm_trigger + * + * Description: + * Trigger the normal TX FIFO + * + ****************************************************************************/ + +static inline void mrf24j40_norm_trigger(FAR struct mrf24j40_radio_s *dev) +{ + uint8_t reg; + + reg = mrf24j40_getreg(dev->spi, MRF24J40_TXNCON); + + reg |= MRF24J40_TXNCON_TXNTRIG; + + mrf24j40_setreg(dev->spi, MRF24J40_TXNCON, reg); +} + /**************************************************************************** * Name: mrf24j40_gts_setup * @@ -1424,31 +1566,87 @@ static int mrf24j40_setup_fifo(FAR struct mrf24j40_radio_s *dev, static void mrf24j40_irqwork_txnorm(FAR struct mrf24j40_radio_s *dev) { - uint8_t txstat; + uint8_t reg; + enum ieee802154_status_e status; + bool framepending; /* Disable tx int */ - txstat = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); - txstat |= MRF24J40_INTCON_TXNIE; - mrf24j40_setreg(dev->spi, MRF24J40_INTCON, txstat); + reg = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); + reg |= MRF24J40_INTCON_TXNIE; + mrf24j40_setreg(dev->spi, MRF24J40_INTCON, reg); /* Get the status from the device and copy the status into the tx desc. * The status for the normal FIFO is represented with bit TXNSTAT where * 0=success, 1= failure. */ - txstat = mrf24j40_getreg(dev->spi, MRF24J40_TXSTAT); - dev->csma_desc->conf->status = txstat & MRF24J40_TXSTAT_TXNSTAT; + reg = mrf24j40_getreg(dev->spi, MRF24J40_TXSTAT); - /* Inform the next layer of the transmission success/failure */ + /* TXNSTAT = 0: Transmission was successful + * TXNSTAT = 1: Transmission failed, retry count exceeded + */ - dev->radiocb->txdone(dev->radiocb, dev->csma_desc); + if (reg & MRF24J40_TXSTAT_TXNSTAT) + { + /* The number of retries of the most recent transmission is contained in the + * TXNRETRY (TXSTAT 0x24<7:6>) bits. The CCAFAIL (TXSTAT 0x24<5>) bit = 1 + * indicates if the failed transmission was due to the channel busy + * (CSMA-CA timed out). + */ + + if (reg & MRF24J40_TXSTAT_CCAFAIL) + { + status = IEEE802154_STATUS_CHANNEL_ACCESS_FAILURE; + } + else + { + status = IEEE802154_STATUS_NO_ACK; + } + } + else + { + status = IEEE802154_STATUS_SUCCESS; + } + + framepending = (mrf24j40_getreg(dev->spi, MRF24J40_TXNCON) & + MRF24J40_TXNCON_FPSTAT); - /* We are now done with the transaction */ + if (dev->txdelayed_busy) + { + /* Inform the next layer of the transmission success/failure */ - dev->csma_busy = 0; + dev->txdelayed_desc->conf->status = status; + dev->txdelayed_desc->framepending = framepending; + dev->radiocb->txdone(dev->radiocb, dev->txdelayed_desc); - mrf24j40_dopoll_csma(dev); + dev->txdelayed_busy = false; + + if (dev->reschedule_csma) + { + mrf24j40_norm_setup(dev, dev->csma_desc->frame, true); + mrf24j40_norm_trigger(dev); + dev->reschedule_csma = false; + } + } + else + { + /* Inform the next layer of the transmission success/failure */ + + dev->csma_desc->conf->status = status; + dev->csma_desc->framepending = framepending; + dev->radiocb->txdone(dev->radiocb, dev->csma_desc); + + /* We are now done with the transaction */ + + dev->csma_busy = 0; + + /* Must unlock the radio before calling poll */ + + sem_post(&dev->exclsem); + mrf24j40_dopoll_csma(dev); + while (sem_wait(&dev->exclsem) != 0) { } + } } /**************************************************************************** @@ -1545,6 +1743,8 @@ static void mrf24j40_irqwork_rx(FAR struct mrf24j40_radio_s *dev) uint32_t index; uint8_t reg; + wlinfo("RX interrupt\n"); + /* Disable rx int */ reg = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); @@ -1560,7 +1760,7 @@ static void mrf24j40_irqwork_rx(FAR struct mrf24j40_radio_s *dev) ind = ieee802154_ind_allocate(); if (ind == NULL) { - wlerr("ERROR: Unable to allocate data_ind. Discarding frame"); + wlerr("ERROR: Unable to allocate data_ind. Discarding frame\n"); goto done; } @@ -1568,7 +1768,7 @@ static void mrf24j40_irqwork_rx(FAR struct mrf24j40_radio_s *dev) addr = MRF24J40_RXBUF_BASE; - ind->frame->io_len= mrf24j40_getreg(dev->spi, addr++); + ind->frame->io_len = mrf24j40_getreg(dev->spi, addr++); /* TODO: This needs to be changed. It is inefficient to do the SPI read byte * by byte */ @@ -1637,21 +1837,29 @@ static void mrf24j40_irqworker(FAR void *arg) DEBUGASSERT(dev); DEBUGASSERT(dev->spi); + /* Get exclusive access to the driver */ + + while (sem_wait(&dev->exclsem) != 0) { } + /* Read and store INTSTAT - this clears the register. */ intstat = mrf24j40_getreg(dev->spi, MRF24J40_INTSTAT); - //wlinfo("INT%02X\n", intstat); + wlinfo("INT%02X\n", intstat); /* Do work according to the pending interrupts */ if ((intstat & MRF24J40_INTSTAT_HSYMTMRIF)) { - /* TODO: What to do when timer expires? */ + /* As of now the only use for the MAC timer is for delayed transactions. + * Therefore, all we do here is trigger the TX norm FIFO + */ + + mrf24j40_norm_trigger(dev); /* Timers are one-shot, so disable the interrupt */ intcon = mrf24j40_getreg(dev->spi, MRF24J40_INTCON); - intcon &= ~MRF24J40_INTCON_HSYMTMRIE; + intcon |= MRF24J40_INTCON_HSYMTMRIE; mrf24j40_setreg(dev->spi, MRF24J40_INTCON, intcon); } @@ -1682,6 +1890,10 @@ static void mrf24j40_irqworker(FAR void *arg) mrf24j40_irqwork_txgts(dev, 1); } + + /* Unlock the radio device */ + + sem_post(&dev->exclsem); /* Re-enable GPIO interrupts */ @@ -1770,6 +1982,7 @@ FAR struct ieee802154_radio_s *mrf24j40_init(FAR struct spi_dev_s *spi, dev->radio.bind = mrf24j40_bind; dev->radio.txnotify = mrf24j40_txnotify; dev->radio.txdelayed = mrf24j40_txdelayed; + dev->radio.reset_attrs = mrf24j40_reset_attrs; dev->radio.get_attr = mrf24j40_get_attr; dev->radio.set_attr = mrf24j40_set_attr; dev->radio.rxenable = mrf24j40_rxenable; @@ -1798,6 +2011,13 @@ FAR struct ieee802154_radio_s *mrf24j40_init(FAR struct spi_dev_s *spi, mrf24j40_pacontrol(dev, MRF24J40_PA_AUTO); + /* For now, we want to always just have the frame pending bit set when + * acknowledging a Data Request command. The standard says that the coordinator + * can do this if it needs time to figure out whether it has data or not + */ + + mrf24j40_setreg(dev->spi, MRF24J40_ACKTMOUT, 0x39 | MRF24J40_ACKTMOUT_DRPACK); + dev->lower->enable(dev->lower, true); return &dev->radio; } diff --git a/drivers/wireless/ieee802154/mrf24j40.h b/drivers/wireless/ieee802154/mrf24j40.h index f9a8a35a5d..397b9f4e39 100644 --- a/drivers/wireless/ieee802154/mrf24j40.h +++ b/drivers/wireless/ieee802154/mrf24j40.h @@ -184,6 +184,11 @@ #define MRF24J40_TXMCR_BATLIFEXT 0x40 #define MRF24J40_TXMCR_NOCSMA 0x80 +/* ACKTMOUT bits */ + +#define MRF24J40_ACKTMOUT_MAWD 0xEF +#define MRF24J40_ACKTMOUT_DRPACK 0x80 + /* INTCON bits */ #define MRF24J40_INTCON_SLPIE 0x80 diff --git a/include/nuttx/wireless/ieee802154/ieee802154_mac.h b/include/nuttx/wireless/ieee802154/ieee802154_mac.h index 9068b18750..ac51825c9a 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_mac.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_mac.h @@ -201,7 +201,11 @@ enum ieee802154_status_e { IEEE802154_STATUS_SUCCESS = 0, - IEEE802154_STATUS_BEACON_LOSS = 0xE0, + IEEE802154_STATUS_FAILURE, /* This value is not outlined in the standard. It + * is a catch-all for any failures that are not + * outlined in the standard + */ + IEEE802154_STATUS_BEACON_LOSS, IEEE802154_STATUS_CHANNEL_ACCESS_FAILURE, IEEE802154_STATUS_DENIED, IEEE802154_STATUS_DISABLE_TRX_FAILURE, @@ -222,94 +226,119 @@ enum ieee802154_status_e IEEE802154_STATUS_TX_ACTIVE, IEEE802154_STATUS_UNAVAILABLE_KEY, IEEE802154_STATUS_UNSUPPORTED_ATTRIBUTE, - IEEE802154_STATUS_FAILED /* This value is not outlined in the standard. It is - * a catch-all for any failures that are not outlined - * in the standard */ +}; + +static const char *IEEE802154_STATUS_STRING[] = +{ + "Success", + "Failure", + "Beacon loss", + "Channel access failure", + "Denied", + "Disable TRX failure", + "Failed security check", + "Frame too long", + "Invalid GTS", + "Invalid handle", + "Invalid parameter", + "No ack", + "No beacon", + "No data", + "No short address", + "Out of cap", + "PAN ID conflict", + "Realignment", + "Transaction expired", + "Transaction overflow", + "Tx active", + "Unavailable key", + "Unsupported attribute", }; /* IEEE 802.15.4 PHY/MAC PIB attributes IDs */ -enum ieee802154_pib_attr_e +enum ieee802154_attr_e { /* PHY PIB Attributes */ - IEEE802154_PIB_PHY_CURRENT_CHANNEL = 0x00, - IEEE802154_PIB_PHY_CHANNELS_SUPPORTED, - IEEE802154_PIB_PHY_TX_POWER_TOLERANCE, - IEEE802154_PIB_PHY_TX_POWER, - IEEE802154_PIB_PHY_CCA_MODE, - IEEE802154_PIB_PHY_CURRENT_PAGE, - IEEE802154_PIB_PHY_MAX_FRAME_DURATION, - IEEE802154_PIB_PHY_SHR_DURATION, - IEEE802154_PIB_PHY_SYM_PER_OCTET, - IEEE802154_PIB_PHY_PREAMBLE_SYM_LEN, - IEEE802154_PIB_PHY_UWB_DATARATES_SUP, - IEEE802154_PIB_PHY_CSS_LOW_DATARATE_SUP, - IEEE802154_PIB_PHY_UWB_COU_PULSES_SUP, - IEEE802154_PIB_PHY_UWB_CS_PULSES_SUP, - IEEE802154_PIB_PHY_UWB_LCP_PULSES_SUP, - IEEE802154_PIB_PHY_UWB_CURR_PULSE_SHAPE, - IEEE802154_PIB_PHY_UWB_COU_PULSE, - IEEE802154_PIB_PHY_UWB_CS_PULSE, - IEEE802154_PIB_PHY_UWB_LCP_WEIGHT1, - IEEE802154_PIB_PHY_UWB_LCP_WEIGHT2, - IEEE802154_PIB_PHY_UWB_LCP_WEIGHT3, - IEEE802154_PIB_PHY_UWB_LCP_WEIGHT4, - IEEE802154_PIB_PHY_UWB_LCP_DELAY2, - IEEE802154_PIB_PHY_UWB_LCP_DELAY3, - IEEE802154_PIB_PHY_UWB_LCP_DELAY4, - IEEE802154_PIB_PHY_RANGING, - IEEE802154_PIB_PHY_RANGING_CRYSTAL_OFFSET, - IEEE802154_PIB_PHY_RANGING_DPS, - IEEE802154_PIB_PHY_CURRENT_CODE, - IEEE802154_PIB_PHY_NATIVE_PRF, - IEEE802154_PIB_PHY_UWB_SCAN_BINS_PER_CHAN, - IEEE802154_PIB_PHY_UWB_INS_PREAMBLE_INTERVAL, - IEEE802154_PIB_PHY_UWB_TX_RMARKER, - IEEE802154_PIB_PHY_UWB_RX_RMARKER, - IEEE802154_PIB_PHY_RFRAME_PROC_TIME, - IEEE802154_PIB_PHY_CCA_DURATION, - IEEE802154_PIB_PHY_SYMBOL_DURATION, /* Non-standard attribute */ + IEEE802154_ATTR_PHY_CURRENT_CHANNEL = 0x00, + IEEE802154_ATTR_PHY_CHANNELS_SUPPORTED, + IEEE802154_ATTR_PHY_TX_POWER_TOLERANCE, + IEEE802154_ATTR_PHY_TX_POWER, + IEEE802154_ATTR_PHY_CCA_MODE, + IEEE802154_ATTR_PHY_CURRENT_PAGE, + IEEE802154_ATTR_PHY_MAX_FRAME_DURATION, + IEEE802154_ATTR_PHY_SHR_DURATION, + IEEE802154_ATTR_PHY_SYM_PER_OCTET, + IEEE802154_ATTR_PHY_PREAMBLE_SYM_LEN, + IEEE802154_ATTR_PHY_UWB_DATARATES_SUP, + IEEE802154_ATTR_PHY_CSS_LOW_DATARATE_SUP, + IEEE802154_ATTR_PHY_UWB_COU_PULSES_SUP, + IEEE802154_ATTR_PHY_UWB_CS_PULSES_SUP, + IEEE802154_ATTR_PHY_UWB_LCP_PULSES_SUP, + IEEE802154_ATTR_PHY_UWB_CURR_PULSE_SHAPE, + IEEE802154_ATTR_PHY_UWB_COU_PULSE, + IEEE802154_ATTR_PHY_UWB_CS_PULSE, + IEEE802154_ATTR_PHY_UWB_LCP_WEIGHT1, + IEEE802154_ATTR_PHY_UWB_LCP_WEIGHT2, + IEEE802154_ATTR_PHY_UWB_LCP_WEIGHT3, + IEEE802154_ATTR_PHY_UWB_LCP_WEIGHT4, + IEEE802154_ATTR_PHY_UWB_LCP_DELAY2, + IEEE802154_ATTR_PHY_UWB_LCP_DELAY3, + IEEE802154_ATTR_PHY_UWB_LCP_DELAY4, + IEEE802154_ATTR_PHY_RANGING, + IEEE802154_ATTR_PHY_RANGING_CRYSTAL_OFFSET, + IEEE802154_ATTR_PHY_RANGING_DPS, + IEEE802154_ATTR_PHY_CURRENT_CODE, + IEEE802154_ATTR_PHY_NATIVE_PRF, + IEEE802154_ATTR_PHY_UWB_SCAN_BINS_PER_CHAN, + IEEE802154_ATTR_PHY_UWB_INS_PREAMBLE_INTERVAL, + IEEE802154_ATTR_PHY_UWB_TX_RMARKER, + IEEE802154_ATTR_PHY_UWB_RX_RMARKER, + IEEE802154_ATTR_PHY_RFRAME_PROC_TIME, + IEEE802154_ATTR_PHY_CCA_DURATION, + IEEE802154_ATTR_PHY_SYMBOL_DURATION, /* Non-standard attribute */ /* MAC PIB Attributes */ - IEEE802154_PIB_MAC_EXTENDED_ADDR = 0x40, - IEEE802154_PIB_MAC_ACK_WAIT_DUR, - IEEE802154_PIB_MAC_ASSOCIATED_PANCOORD, - IEEE802154_PIB_MAC_ASSOCIATION_PERMIT, - IEEE802154_PIB_MAC_AUTO_REQUEST, - IEEE802154_PIB_MAC_BATT_LIFE_EXT, - IEEE802154_PIB_MAC_BATT_LIFE_EXT_PERIODS, - IEEE802154_PIB_MAC_BEACON_PAYLOAD, - IEEE802154_PIB_MAC_BEACON_PAYLOAD_LEN, - IEEE802154_PIB_MAC_BEACON_ORDER, - IEEE802154_PIB_MAC_BEACON_TX_TIME, - IEEE802154_PIB_MAC_BSN, - IEEE802154_PIB_MAC_COORD_EXT_ADDR, - IEEE802154_PIB_MAC_COORD_SHORT_ADDR, - IEEE802154_PIB_MAC_DSN, - IEEE802154_PIB_MAC_GTS_PERMIT, - IEEE802154_PIB_MAC_MAX_BE, - IEEE802154_PIB_MAC_MAX_CSMA_BACKOFFS, - IEEE802154_PIB_MAC_FRAME_TOTAL_WAIT_TIME, - IEEE802154_PIB_MAC_MAX_FRAME_RETRIES, - IEEE802154_PIB_MAC_MIN_BE, - IEEE802154_PIB_MAC_LIFS_PERIOD, - IEEE802154_PIB_MAC_SIFS_PERIOD, - IEEE802154_PIB_MAC_PANID, - IEEE802154_PIB_MAC_PROMISCUOUS_MODE, - IEEE802154_PIB_MAC_RANGING_SUPPORT, - IEEE802154_PIB_MAC_RESPONSE_WAIT_TIME, - IEEE802154_PIB_MAC_RX_ON_WHEN_IDLE, - IEEE802154_PIB_MAC_SECURITY_ENABLED, - IEEE802154_PIB_MAC_SHORT_ADDRESS, - IEEE802154_PIB_MAC_SUPERFRAME_ORDER, - IEEE802154_PIB_MAC_SYNC_SYMBOL_OFFSET, + IEEE802154_ATTR_MAC_EXTENDED_ADDR = 0x40, + IEEE802154_ATTR_MAC_ACK_WAIT_DUR, + IEEE802154_ATTR_MAC_ASSOCIATED_PANCOORD, + IEEE802154_ATTR_MAC_ASSOCIATION_PERMIT, + IEEE802154_ATTR_MAC_AUTO_REQUEST, + IEEE802154_ATTR_MAC_BATT_LIFE_EXT, + IEEE802154_ATTR_MAC_BATT_LIFE_EXT_PERIODS, + IEEE802154_ATTR_MAC_BEACON_PAYLOAD, + IEEE802154_ATTR_MAC_BEACON_PAYLOAD_LEN, + IEEE802154_ATTR_MAC_BEACON_ORDER, + IEEE802154_ATTR_MAC_BEACON_TX_TIME, + IEEE802154_ATTR_MAC_BSN, + IEEE802154_ATTR_MAC_COORD_EXT_ADDR, + IEEE802154_ATTR_MAC_COORD_SHORT_ADDR, + IEEE802154_ATTR_MAC_DSN, + IEEE802154_ATTR_MAC_GTS_PERMIT, + IEEE802154_ATTR_MAC_MAX_BE, + IEEE802154_ATTR_MAC_MAX_CSMA_BACKOFFS, + IEEE802154_ATTR_MAC_MAX_FRAME_WAITTIME, + IEEE802154_ATTR_MAC_MAX_FRAME_RETRIES, + IEEE802154_ATTR_MAC_MIN_BE, + IEEE802154_ATTR_MAC_LIFS_PERIOD, + IEEE802154_ATTR_MAC_SIFS_PERIOD, + IEEE802154_ATTR_MAC_PANID, + IEEE802154_ATTR_MAC_PROMISCUOUS_MODE, + IEEE802154_ATTR_MAC_RANGING_SUPPORT, + IEEE802154_ATTR_MAC_RESPONSE_WAIT_TIME, + IEEE802154_ATTR_MAC_RX_ON_WHEN_IDLE, + IEEE802154_ATTR_MAC_SECURITY_ENABLED, + IEEE802154_ATTR_MAC_SHORT_ADDRESS, + IEEE802154_ATTR_MAC_SUPERFRAME_ORDER, + IEEE802154_ATTR_MAC_SYNC_SYMBOL_OFFSET, IEEE802154_PIB_MAC_TIMESTAMP_SUPPORT, IEEE802154_PIB_MAC_TRANSACTION_PERSIST_TIME, IEEE802154_PIB_MAC_TX_CTRL_ACTIVE_DUR, IEEE802154_PIB_MAC_TX_CTRL_PAUSE_DUR, IEEE802154_PIB_MAC_TX_TOTAL_DUR, + IEEE802154_ATTR_MAC_DEVMODE, /* Non-standard */ /* MAC Security Attributes */ @@ -337,6 +366,7 @@ enum ieee802154_frametype_e }; /* MAC command IDs */ +/* TODO: Change terminology to be "current primitive" */ enum ieee802154_cmdid_e { @@ -353,7 +383,7 @@ enum ieee802154_cmdid_e enum ieee802154_devmode_e { - IEEE802154_DEVMODE_ENDPOINT, + IEEE802154_DEVMODE_ENDPOINT = 0x00, IEEE802154_DEVMODE_COORD, IEEE802154_DEVMODE_PANCOORD }; @@ -372,6 +402,10 @@ enum ieee802154_addrmode_e IEEE802154_ADDRMODE_NONE = 0, IEEE802154_ADDRMODE_SHORT = 2, IEEE802154_ADDRMODE_EXTENDED + + /* TODO: Add a IEEE802154_ADDRMODE_ANY setting for structs where both the + * extended and short addresses are safe to use. + */ }; struct ieee802154_addr_s @@ -503,6 +537,8 @@ union ieee802154_macattr_u uint8_t coord_eaddr[IEEE802154_EADDR_LEN]; uint16_t coord_saddr; + enum ieee802154_devmode_e devmode; + bool is_assoc; bool assoc_permit; bool auto_req; @@ -510,7 +546,7 @@ union ieee802154_macattr_u bool gts_permit; bool promisc_mode; bool rng_support; - bool resp_wait_time; + bool resp_waittime; bool rxonidle; bool sec_enabled; bool timestamp_support; @@ -520,7 +556,7 @@ union ieee802154_macattr_u uint8_t max_csma_backoffs : 3; uint8_t max_be : 4; uint8_t min_be : 4; - uint32_t max_frame_wait_time; + uint32_t max_frame_waittime; uint8_t max_retries; uint8_t lifs_period; uint8_t sifs_period; @@ -530,7 +566,7 @@ union ieee802154_macattr_u uint32_t tx_ctrl_pause_dur; uint32_t tx_total_dur; - uint8_t beacon_payload[IEEE802154_PIB_MAC_BEACON_PAYLOAD_LEN]; + uint8_t beacon_payload[IEEE802154_ATTR_MAC_BEACON_PAYLOAD_LEN]; uint8_t beacon_payload_len; uint8_t beacon_order; uint32_t beacon_tx_time : 24; @@ -579,8 +615,8 @@ enum ieee802154_scantype_e struct ieee802154_frame_meta_s { - enum ieee802154_addrmode_e src_addrmode; /* Source Address Mode */ - struct ieee802154_addr_s dest_addr; /* Destination Address */ + enum ieee802154_addrmode_e srcaddr_mode; /* Source Address Mode */ + struct ieee802154_addr_s destaddr; /* Destination Address */ uint8_t msdu_handle; /* Handle assoc. with MSDU */ @@ -799,7 +835,7 @@ struct ieee802154_assoc_ind_s { /* Address of device requesting association. Always in extended mode */ - struct ieee802154_addr_s dev_addr; + uint8_t devaddr[IEEE802154_EADDR_LEN]; /* Capabilities of associating device */ @@ -824,7 +860,11 @@ struct ieee802154_assoc_resp_s { /* Address of device requesting association. Always in extended mode */ - struct ieee802154_addr_s dev_addr; + uint8_t devaddr[8]; + + /* Address assigned to the device. 0xFFFF if failure */ + + uint16_t assocsaddr; /* Status of association attempt */ @@ -1200,7 +1240,7 @@ struct ieee802154_scan_conf_s struct ieee802154_get_req_s { - enum ieee802154_pib_attr_e pib_attr; + enum ieee802154_attr_e attr; union ieee802154_attr_u attrval; }; @@ -1220,7 +1260,7 @@ struct ieee802154_get_req_s struct ieee802154_set_req_s { - enum ieee802154_pib_attr_e pib_attr; + enum ieee802154_attr_e attr; union ieee802154_attr_u attrval; }; @@ -1320,7 +1360,7 @@ struct ieee802154_syncloss_ind_s struct ieee802154_poll_req_s { - struct ieee802154_addr_s coord_addr; + struct ieee802154_addr_s coordaddr; #ifdef CONFIG_IEEE802154_SECURITY /* Security information if enabled */ diff --git a/include/nuttx/wireless/ieee802154/ieee802154_radio.h b/include/nuttx/wireless/ieee802154/ieee802154_radio.h index 90de13d40d..7e9cd14653 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_radio.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_radio.h @@ -66,6 +66,10 @@ struct ieee802154_txdesc_s FAR struct ieee802154_txdesc_s *flink; + /* Destination Address */ + + struct ieee802154_addr_s destaddr; /* Only used for indirect transactions */ + /* Pointer to the frame IOB */ FAR struct iob_s *frame; @@ -80,6 +84,7 @@ struct ieee802154_txdesc_s * control how tx done is handled */ bool framepending; /* Did the ACK have the frame pending bit * bit set */ + uint32_t purge_time; /* Time to purge transaction */ /* TODO: Add slotting information for GTS transactions */ }; @@ -104,11 +109,12 @@ struct ieee802154_radio_s CODE int (*txdelayed)(FAR struct ieee802154_radio_s *radio, FAR struct ieee802154_txdesc_s *txdesc, uint32_t symboldelay); + CODE int (*reset_attrs) (FAR struct ieee802154_radio_s *radio); CODE int (*get_attr) (FAR struct ieee802154_radio_s *radio, - enum ieee802154_pib_attr_e pib_attr, + enum ieee802154_attr_e , FAR union ieee802154_attr_u *attrval); CODE int (*set_attr) (FAR struct ieee802154_radio_s *radio, - enum ieee802154_pib_attr_e pib_attr, + enum ieee802154_attr_e , FAR const union ieee802154_attr_u *attrval); CODE int (*rxenable) (FAR struct ieee802154_radio_s *radio, bool enable); CODE int (*req_rxenable)(FAR struct ieee802154_radio_s *radio, diff --git a/net/sixlowpan/sixlowpan_framer.c b/net/sixlowpan/sixlowpan_framer.c index 2d8d54480a..c67ae2768b 100644 --- a/net/sixlowpan/sixlowpan_framer.c +++ b/net/sixlowpan/sixlowpan_framer.c @@ -163,7 +163,7 @@ int sixlowpan_meta_data(FAR struct ieee802154_driver_s *ieee, /* Source address mode */ - meta->src_addrmode = pktmeta->sextended != 0? + meta->srcaddr_mode = pktmeta->sextended != 0? IEEE802154_ADDRMODE_EXTENDED : IEEE802154_ADDRMODE_SHORT; @@ -197,25 +197,25 @@ int sixlowpan_meta_data(FAR struct ieee802154_driver_s *ieee, { /* Broadcast requires short address mode. */ - meta->dest_addr.mode = IEEE802154_ADDRMODE_SHORT; - meta->dest_addr.saddr = 0; + meta->destaddr.mode = IEEE802154_ADDRMODE_SHORT; + meta->destaddr.saddr = 0; } else if (pktmeta->dextended != 0) { /* Extended destination address mode */ - meta->dest_addr.mode = IEEE802154_ADDRMODE_EXTENDED; - sixlowpan_eaddrcopy(&meta->dest_addr.eaddr, pktmeta->dest.eaddr.u8); + meta->destaddr.mode = IEEE802154_ADDRMODE_EXTENDED; + sixlowpan_eaddrcopy(&meta->destaddr.eaddr, pktmeta->dest.eaddr.u8); } else { /* Short destination address mode */ - meta->dest_addr.mode = IEEE802154_ADDRMODE_SHORT; - sixlowpan_saddrcopy(&meta->dest_addr.saddr, pktmeta->dest.saddr.u8); + meta->destaddr.mode = IEEE802154_ADDRMODE_SHORT; + sixlowpan_saddrcopy(&meta->destaddr.saddr, pktmeta->dest.saddr.u8); } - meta->dest_addr.panid = pktmeta->dpanid; + meta->destaddr.panid = pktmeta->dpanid; /* Handle associated with MSDU. Will increment once per packet, not * necesarily per frame: The same MSDU handle will be used for each diff --git a/net/sixlowpan/sixlowpan_utils.c b/net/sixlowpan/sixlowpan_utils.c index 75da3ed556..822127f7f7 100644 --- a/net/sixlowpan/sixlowpan_utils.c +++ b/net/sixlowpan/sixlowpan_utils.c @@ -195,7 +195,7 @@ int sixlowpan_src_panid(FAR struct ieee802154_driver_s *ieee, int ret; memcpy(arg.ifr_name, ieee->i_dev.d_ifname, IFNAMSIZ); - arg.u.getreq.pib_attr = IEEE802154_PIB_MAC_PANID; + arg.u.getreq.attr = IEEE802154_ATTR_MAC_PANID; ret = dev->d_ioctl(dev, MAC802154IOC_MLME_GET_REQUEST, (unsigned long)((uintptr_t)&arg)); if (ret < 0) diff --git a/wireless/ieee802154/Make.defs b/wireless/ieee802154/Make.defs index eedec934eb..da1b1bc05e 100644 --- a/wireless/ieee802154/Make.defs +++ b/wireless/ieee802154/Make.defs @@ -37,7 +37,12 @@ ifeq ($(CONFIG_WIRELESS_IEEE802154),y) # Include IEEE 802.15.4 support -CSRCS += mac802154.c mac802154_indalloc.c +CSRCS += mac802154.c mac802154_indalloc.c mac802154_assoc.c mac802154_disassoc.c +CSRCS += mac802154_bind.c mac802154_data.c mac802154_get_mhrlen.c +CSRCS += mac802154_getset.c mac802154_gts.c mac802154_ioctl.c +CSRCS += mac802154_notif.c mac802154_orphan.c mac802154_poll.c mac802154_purge.c +CSRCS += mac802154_reset.c mac802154_rxenable.c mac802154_scan.c mac802154_start.c +CSRCS += mac802154_sync.c # Include wireless devices build support diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index 04fe802eeb..51395e531b 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -2,8 +2,11 @@ * wireless/ieee802154/mac802154.c * * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2017 Verge Inc. All rights reserved. + * * Author: Sebastien Lorquet + * Author: Gregory Nutt * Author: Anthony Merlino * * Redistribution and use in source and binary forms, with or without @@ -53,327 +56,22 @@ #include #include "mac802154.h" +#include "mac802154_notif.h" +#include "mac802154_internal.h" +#include "mac802154_assoc.h" +#include "mac802154_data.h" +#include "mac802154_poll.h" #include #include -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ -/* Configuration ************************************************************/ -/* If processing is not done at the interrupt level, then work queue support - * is required. - */ - -#if !defined(CONFIG_SCHED_WORKQUEUE) -# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_MAC802154_HPWORK) -# define MAC802154_WORK HPWORK -# elif defined(CONFIG_MAC802154_LPWORK) -# define MAC802154_WORK LPWORK -# else -# error Neither CONFIG_MAC802154_HPWORK nor CONFIG_MAC802154_LPWORK defined -# endif -#endif - -#if !defined(CONFIG_MAC802154_NNOTIF) || CONFIG_MAC802154_NNOTIF <= 0 -# undef CONFIG_MAC802154_NNOTIF -# define CONFIG_MAC802154_NNOTIF 6 -#endif - -#if !defined(CONFIG_MAC802154_NTXDESC) || CONFIG_MAC802154_NTXDESC <= 0 -# undef CONFIG_MAC802154_NTXDESC -# define CONFIG_MAC802154_NTXDESC 3 -#endif - -#if CONFIG_MAC802154_NTXDESC > CONFIG_MAC802154_NNOTIF -#error CONFIG_MAC802154_NNOTIF must be greater than CONFIG_MAC802154_NTXDESC -#endif - -#if !defined(CONFIG_IEEE802154_DEFAULT_EADDR) -#define CONFIG_IEEE802154_DEFAULT_EADDR 0xFFFFFFFFFFFFFFFF -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -struct mac802154_radiocb_s -{ - struct ieee802154_radiocb_s cb; - FAR struct ieee802154_privmac_s *priv; -}; - -/* Extend the public ieee802154_notif_s to include a private forward link to - * support a list to handle allocation - */ - -struct mac802154_notif_s -{ - struct ieee802154_notif_s pub; - FAR struct mac802154_notif_s *flink; -}; - -/* Enumeration for representing what operation the MAC layer is currently doing. - * There can only be one command being handled at any given time, but certain - * operations such as association requires more than one command to be sent. - * Therefore, the need to track not only what command is currently active, but - * also, what overall operation the command is apart of is necessary. - */ - -enum mac802154_operation_e -{ - MAC802154_OP_NONE, - MAC802154_OP_ASSOC, - MAC802154_OP_POLL -}; - -/* The privmac structure holds the internal state of the MAC and is the - * underlying represention of the opaque MACHANDLE. It contains storage for - * the IEEE802.15.4 MIB attributes. - */ - -struct ieee802154_privmac_s -{ - FAR struct ieee802154_radio_s *radio; /* Contained IEEE802.15.4 radio dev */ - FAR const struct mac802154_maccb_s *cb; /* Contained MAC callbacks */ - FAR struct mac802154_radiocb_s radiocb; /* Interface to bind to radio */ - - sem_t exclsem; /* Support exclusive access */ - - /* Only support a single command at any given time. As of now I see no - * condition where you need to have more than one command frame simultaneously - */ - - sem_t op_sem; /* Exclusive operations */ - enum mac802154_operation_e curr_op; /* The current overall operation */ - enum ieee802154_cmdid_e curr_cmd; /* Type of the current cmd */ - - /* Pre-allocated notifications to be passed to the registered callback. These - * need to be freed by the application using mac802154_xxxxnotif_free when - * the callee layer is finished with it's use. - */ - - FAR struct mac802154_notif_s *notif_free; - struct mac802154_notif_s notif_pool[CONFIG_MAC802154_NNOTIF]; - sem_t notif_sem; - sq_queue_t notif_queue; - - struct ieee802154_txdesc_s txdesc_pool[CONFIG_IEEE802154_NTXDESC]; - sem_t txdesc_sem; - sq_queue_t txdesc_queue; - sq_queue_t txdone_queue; - - /* Support a singly linked list of transactions that will be sent using the - * CSMA algorithm. On a non-beacon enabled PAN, these transactions will be - * sent whenever. On a beacon-enabled PAN, these transactions will be sent - * during the CAP of the Coordinator's superframe. - */ - - sq_queue_t csma_queue; - sq_queue_t gts_queue; - - /* Support a singly linked list of transactions that will be sent indirectly. - * This list should only be used by a MAC acting as a coordinator. These - * transactions will stay here until the data is extracted by the destination - * device sending a Data Request MAC command or if too much time passes. This - * list should also be used to populate the address list of the outgoing - * beacon frame. - */ - - sq_queue_t indirect_queue; - - /* Support a singly linked list of frames received */ - - sq_queue_t dataind_queue; - - /* Work structures for offloading aynchronous work */ - - struct work_s tx_work; - struct work_s rx_work; - struct work_s timeout_work; - - WDOG_ID timeout; /* Timeout watchdog */ - - /* MAC PIB attributes, grouped to save memory */ - - /* Holds all address information (Extended, Short, and PAN ID) for the MAC. */ - - struct ieee802154_addr_s addr; - - /* Holds all address information (Extended, Short) for Coordinator */ - - struct ieee802154_addr_s coordaddr; - - /* The maximum number of symbols to wait for an acknowledgement frame to - * arrive following a transmitted data frame. [1] pg. 126 - * - * NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't - * sure at the time what the range of reasonable values was. - */ - - uint32_t ack_waitdur; - - /* The maximum time to wait either for a frame intended as a response to a - * data request frame or for a broadcast frame following a beacon with the - * Frame Pending field set to one. [1] pg. 127 - * - * NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't - * sure at the time what the range of reasonable values was. - */ - - uint32_t max_frame_waittime; - - /* The maximum time (in unit periods) that a transaction is stored by a - * coordinator and indicated in its beacon. - */ - - uint16_t trans_persisttime; - - /* Contents of beacon payload */ - - uint8_t beacon_payload[IEEE802154_MAX_BEACON_PAYLOAD_LEN]; - uint8_t beacon_payload_len; /* Length of beacon payload */ - - uint8_t battlifeext_periods; /* # of backoff periods during which rx is - * enabled after the IFS following beacon */ - - uint8_t bsn; /* Seq. num added to tx beacon frame */ - uint8_t dsn; /* Seq. num added to tx data or MAC frame */ - uint8_t maxretries; /* Max # of retries alloed after tx failure */ - - /* The maximum time, in multiples of aBaseSuperframeDuration, a device shall - * wait for a response command frame to be available following a request - * command frame. [1] 128. - */ - - uint8_t resp_waittime; - - /* The total transmit duration (including PHY header and FCS) specified in - * symbols. [1] pg. 129. - */ - - uint32_t tx_totaldur; - - /* Start of 32-bit bitfield */ - - uint32_t trackingbeacon : 1; /* Are we tracking the beacon */ - uint32_t isassoc : 1; /* Are we associated to the PAN */ - uint32_t assocpermit : 1; /* Are we allowing assoc. as a coord. */ - uint32_t autoreq : 1; /* Automatically send data req. if addr - * addr is in the beacon frame */ - - uint32_t battlifeext : 1; /* Is BLE enabled */ - uint32_t gtspermit : 1; /* Is PAN Coord. accepting GTS reqs. */ - uint32_t promisc : 1; /* Is promiscuous mode on? */ - uint32_t rngsupport : 1; /* Does MAC sublayer support ranging */ - uint32_t sec_enabled : 1; /* Does MAC sublayer have security en. */ - uint32_t timestamp_support : 1; /* Does MAC layer supports timestamping */ - - /* 2 available bits */ - - uint32_t beaconorder : 4; /* Freq. that beacon is transmitted */ - - uint32_t superframeorder : 4; /* Length of active portion of outgoing - * superframe, including the beacon */ - - /* The offset, measured is symbols, between the symbol boundary at which the - * MLME captures the timestamp of each transmitted and received frame, and - * the onset of the first symbol past the SFD, namely the first symbol of - * the frames [1] pg. 129. - */ - - uint32_t sync_symboffset : 12; - - /* End of 32-bit bitfield */ - - /* Start of 32-bit bitfield */ - - uint32_t beacon_txtime : 24; /* Time of last beacon transmit */ - uint32_t minbe : 4; /* Min value of backoff exponent (BE) */ - uint32_t maxbe : 4; /* Max value of backoff exponent (BE) */ - - /* End of 32-bit bitfield */ - - /* Start of 32-bit bitfield */ - - uint32_t txctrl_activedur : 17; /* Duration for which tx is permitted to - * be active */ - uint32_t txctrl_pausedur : 1; /* Duration after tx before another tx is - * permitted. 0=2000, 1= 10000 */ - - /* What type of device is this node acting as */ - - enum ieee802154_devmode_e devmode : 2; - - uint32_t max_csmabackoffs : 3; /* Max num backoffs for CSMA algorithm - * before declaring ch access failure */ - - /* 9-bits remaining */ - - /* End of 32-bit bitfield. */ - - /* TODO: Add Security-related MAC PIB attributes */ -}; - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ -/* Internal Functions */ - -static inline int mac802154_takesem(sem_t *sem, bool allow_interrupt); -#define mac802154_givesem(s) sem_post(s); - /* Data structure pools and allocation helpers */ static void mac802154_resetqueues(FAR struct ieee802154_privmac_s *priv); -static void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv); - -static int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_notif_s **notif, - bool allow_interrupt); - -static inline int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s **txdesc, - bool allow_interrupt); -static void mac802154_txdesc_free(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc); - -static int mac802154_defaultmib(FAR struct ieee802154_privmac_s *priv); -static int mac802154_applymib(FAR struct ieee802154_privmac_s *priv); - -/* Watchdog Timeout Functions */ - -static void mac802154_timeout_expiry(int argc, uint32_t arg, ...); - -/* Worker functions */ - -static void mac802154_txdone_worker(FAR void *arg); -static void mac802154_rxframe_worker(FAR void *arg); -static void mac802154_timeout_worker(FAR void *arg); - -/* Functions for handling tx done for different types of frames */ - -static void mac802154_datareq_txdone(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc); - -static void mac802154_assocreq_txdone(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc); - -/* Functions for processing incoming frames */ - -static void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_data_ind_s *ind); - -/* Helper Functions for sequencing different operations */ - -static FAR struct ieee802154_txdesc_s * - mac802154_assoc_getresp(FAR struct ieee802154_privmac_s *priv); /* IEEE 802.15.4 PHY Interface OPs */ @@ -382,55 +80,30 @@ static int mac802154_poll(FAR const struct ieee802154_radiocb_s *radiocb, static void mac802154_txdone(FAR const struct ieee802154_radiocb_s *radiocb, FAR struct ieee802154_txdesc_s *tx_desc); +static void mac802154_txdone_worker(FAR void *arg); static void mac802154_rxframe(FAR const struct ieee802154_radiocb_s *radiocb, FAR struct ieee802154_data_ind_s *ind); +static void mac802154_rxframe_worker(FAR void *arg); + +static void mac802154_rx_datareq(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind); +static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind); + +static void mac802154_purge_worker(FAR void *arg); + +/* Watchdog Timeout Functions */ + +static void mac802154_timeout_expiry(int argc, uint32_t arg, ...); -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* Map between ieee802154_addrmode_e enum and actual address length */ - -static const uint8_t mac802154_addr_length[4] = {0, 0, 2, 8}; +static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, + uint32_t symbols); /**************************************************************************** * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: mac802154_semtake - * - * Description: - * Acquire the semaphore used for access serialization. - * - ****************************************************************************/ - -static inline int mac802154_takesem(sem_t *sem, bool allowinterrupt) -{ - int ret; - do - { - /* Take a count from the semaphore, possibly waiting */ - - ret = sem_wait(sem); - if (ret < 0) - { - /* EINTR is the only error that we expect */ - - DEBUGASSERT(get_errno() == EINTR); - - if (allowinterrupt) - { - return -EINTR; - } - } - } - while (ret != OK); - - return OK; -} - /**************************************************************************** * Name: mac802154_resetqueues * @@ -464,120 +137,6 @@ static void mac802154_resetqueues(FAR struct ieee802154_privmac_s *priv) mac802154_notifpool_init(priv); } -/**************************************************************************** - * Name: mac802154_notifpool_init - * - * Description: - * This function initializes the notification structure pool. It allows the - * MAC to pass notifications and for the callee to free them when they are - * done using them, saving copying the data when passing. - * - ****************************************************************************/ - -static void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv) -{ - FAR struct mac802154_notif_s *pool = priv->notif_pool; - int remaining = CONFIG_MAC802154_NNOTIF; - - priv->notif_free = NULL; - while (remaining > 0) - { - FAR struct mac802154_notif_s *notif = pool; - - /* Add the next meta data structure from the pool to the list of - * general structures. - */ - - notif->flink = priv->notif_free; - priv->notif_free = notif; - - /* Set up for the next structure from the pool */ - - pool++; - remaining--; - } - sem_init(&priv->notif_sem, 0, CONFIG_MAC802154_NNOTIF); -} - -/**************************************************************************** - * Name: mac802154_notif_alloc - * - * Description: - * This function allocates a free notification structure from the free list - * to be used for passing to the registered notify callback. The callee software - * is responsible for freeing the notification structure after it is done using - * it via mac802154_notif_free. - * - * Assumptions: - * priv MAC struct is locked when calling. - * - * Notes: - * If any of the semaphore waits inside this function get interrupted, the - * function will release the MAC layer. If this function returns -EINTR, the - * calling code should NOT release the MAC semaphore. - * - ****************************************************************************/ - -static int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_notif_s **notif, - bool allow_interrupt) -{ - int ret; - FAR struct mac802154_notif_s *privnotif; - - /* Try and take a count from the semaphore. If this succeeds, we have - * "reserved" the structure, but still need to unlink it from the free list. - * The MAC is already locked, so there shouldn't be any other conflicting calls - */ - - ret = sem_trywait(&priv->notif_sem); - - if (ret == OK) - { - privnotif = priv->notif_free; - priv->notif_free = privnotif->flink; - } - else - { - /* Unlock MAC so that other work can be done to free a notification */ - - mac802154_givesem(&priv->exclsem); - - /* Take a count from the notification semaphore, waiting if necessary. We - * only return from here with an error if we are allowing interruptions - * and we received a signal */ - - ret = mac802154_takesem(&priv->notif_sem, allow_interrupt); - if (ret < 0) - { - /* MAC sem is already released */ - - return -EINTR; - } - - /* If we've taken a count from the semaphore, we have "reserved" the struct - * but now we need to pop it off of the free list. We need to re-lock the - * MAC in order to ensure this happens correctly. - */ - - ret = mac802154_takesem(&priv->exclsem, allow_interrupt); - if (ret < 0) - { - mac802154_givesem(&priv->notif_sem); - return -EINTR; - } - - /* We can now safely unlink the next free structure from the free list */ - - privnotif = priv->notif_free; - priv->notif_free = privnotif->flink; - } - - *notif = (FAR struct ieee802154_notif_s *)privnotif; - - return OK; -} - /**************************************************************************** * Name: mac802154_txdesc_pool * @@ -597,9 +156,9 @@ static int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, * ****************************************************************************/ -static inline int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s **txdesc, - bool allow_interrupt) +int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s **txdesc, + bool allow_interrupt) { int ret; FAR struct ieee802154_notif_s *notif; @@ -674,152 +233,133 @@ static inline int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, } /**************************************************************************** - * Name: mac802154_txdesc_free + * Name: mac802154_setupindirect * * Description: - * This function frees a tx descriptor. + * Internal function used by various parts of the MAC layer. This function + * places the provided tx descriptor in the indirect list and manages the + * scheduling for purging the transaction if it does not get extracted in + * time. * * Assumptions: - * priv MAC struct is locked when calling. - * - ****************************************************************************/ -static void mac802154_txdesc_free(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc) -{ - - sq_addlast((FAR sq_entry_t *)txdesc, &priv->txdesc_queue); - mac802154_givesem(&priv->txdesc_sem); -} - -/**************************************************************************** - * Name: mac802154_symtoticks - * - * Description: - * Helper function for converting symbols to system clock ticks - * - * Assumptions: - * priv MAC struct is locked when calling. + * Called with the MAC locked * ****************************************************************************/ -static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, - uint32_t symbols) +void mac802154_setupindirect(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) { - union ieee802154_attr_u attrval; - uint32_t ret; + uint32_t ticks; + uint32_t symbols; - /* First, get the symbol duration from the radio layer. Symbol duration is - * returned in picoseconds to ensure precision is kept when multiplying to - * get overall times. + /* Link the tx descriptor into the list */ + + sq_addlast((FAR sq_entry_t *)txdesc, &priv->indirect_queue); + + /* Update the timestamp for purging the transaction */ + + /* The maximum time (in unit periods) that a transaction is stored by a + * coordinator and indicated in its beacon. The unit period is governed by + * macBeaconOrder, BO, as follows: For 0 ≤ BO ≤ 14, the unit period will be + * aBaseSuperframeDuration × 2 BO . For BO = 15, the unit period will be + * aBaseSuperframeDuration. [1] pg. 129 */ - priv->radio->get_attr(priv->radio, IEEE802154_PIB_PHY_SYMBOL_DURATION, - &attrval); - - /* After this step, ret represents microseconds */ - - ret = (attrval.phy.symdur_picosec * symbols) / (1000 * 1000); - - /* This method should only be used for things that can be late. For instance, - * it's always okay to wait a little longer before disabling your receiver. - * Therefore, we force the tick count to round up. - */ - - if (ret % USEC_PER_TICK == 0) + if (priv->beaconorder < 15) { - ret = ret/USEC_PER_TICK; + symbols = priv->trans_persisttime * + (IEEE802154_BASE_SUPERFRAME_DURATION * (1 << priv->beaconorder)); } else { - ret = ret/USEC_PER_TICK; - ret++; + symbols = priv->trans_persisttime * IEEE802154_BASE_SUPERFRAME_DURATION; } - - return ret; -} -/**************************************************************************** - * Name: mac802154_defaultmib - * - * Description: - * Set the MIB to its default values. - * - ****************************************************************************/ + ticks = mac802154_symtoticks(priv, symbols); -static int mac802154_defaultmib(FAR struct ieee802154_privmac_s *priv) -{ - priv->isassoc = false; /* Not associated with a PAN */ - priv->trackingbeacon = false; /* Not tracking beacon by default */ - priv->assocpermit = false; /* Device (if coord) not accepting ssociation */ - priv->autoreq = true; /* Auto send data req if addr. in beacon */ - priv->battlifeext = false; /* BLE disabled */ - priv->beacon_payload_len = 0; /* Beacon payload NULL */ - priv->beaconorder = 15; /* Non-beacon enabled network */ - priv->superframeorder = 15; /* Length of active portion of outgoing SF */ - priv->beacon_txtime = 0; /* Device never sent a beacon */ -#warning Set BSN and DSN to random values! - priv->bsn = 0; - priv->dsn = 0; - priv->gtspermit = true; /* PAN Coord accepting GTS requests */ - priv->minbe = 3; /* Min value of backoff exponent (BE) */ - priv->maxbe = 5; /* Max value of backoff exponent (BE) */ - priv->max_csmabackoffs = 4; /* Max # of backoffs before failure */ - priv->maxretries = 3; /* Max # of retries allowed after failure */ - priv->promisc = false; /* Device not in promiscuous mode */ - priv->rngsupport = false; /* Ranging not yet supported */ - priv->resp_waittime = 32; /* 32 SF durations */ - priv->sec_enabled = false; /* Security disabled by default */ - priv->tx_totaldur = 0; /* 0 transmit duration */ + txdesc->purge_time = clock_systimer() + ticks; - priv->trans_persisttime = 0x01F4; - - /* Reset the Coordinator address */ - - priv->coordaddr.mode = IEEE802154_ADDRMODE_NONE; - priv->coordaddr.saddr = IEEE802154_SADDR_UNSPEC; - memcpy(&priv->coordaddr.eaddr[0], IEEE802154_EADDR_UNSPEC, - IEEE802154_EADDR_LEN); - - /* Reset the device's address */ - - priv->addr.mode = IEEE802154_ADDRMODE_NONE; - priv->addr.panid = IEEE802154_PAN_UNSPEC; - priv->addr.saddr = IEEE802154_SADDR_UNSPEC; - memcpy(&priv->addr.eaddr[0], IEEE802154_EADDR_UNSPEC, IEEE802154_EADDR_LEN); - - - /* These attributes are effected and determined based on the PHY. Need to - * figure out how to "share" attributes between the radio driver and this - * MAC layer + /* Check to see if the purge indirect timer is scheduled. If it is, when the + * timer fires, it will schedule the next purge timer event. Inherently, the + * queue will be in order of which transaction needs to be purged next. * - * macAckWaitDuration - * macBattLifeExtPeriods - * macMaxFrameTotalWaitTime - * macLIFSPeriod - * macSIFSPeriod - * macSyncSymbolOffset - * macTimestampSupported - * macTxControlActiveDuration - * macTxControlPauseDuration - * macRxOnWhenIdle + * If the purge indirect timer has not been scheduled, schedule it for when + * this transaction should expire. */ - return OK; + if (work_available(&priv->purge_work)) + { + //work_queue(MAC802154_WORK, &priv->purge_work, mac802154_purge_worker, + // (FAR void *)priv, ticks); + } } /**************************************************************************** - * Name: mac802154_applymib + * Name: mac802154_purge_worker * * Description: - * Some parts of the MIB must be sent to the radio device. This routine - * calls the radio device routines to store the related parameters in the - * radio driver. It must be called each time a MIB parameter is changed. + * Worker function scheduled in order to purge expired indirect transactions. + * The first element in the list should always be removed. The list is searched + * and transactions are removed until a transaction has not yet expired. Then + * if there are any remaining transactions, the work function is rescheduled + * for the next expiring transaction. * ****************************************************************************/ -static int mac802154_applymib(FAR struct ieee802154_privmac_s *priv) +static void mac802154_purge_worker(FAR void *arg) { - return OK; + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)arg; + FAR struct ieee802154_txdesc_s *txdesc; + + /* Get exclusive access to the driver structure. We don't care about any + * signals so don't allow interruptions + */ + + mac802154_takesem(&priv->exclsem, false); + + while (1) + { + /* Pop transactions off indirect queue until the transaction timeout has not + * passed. + */ + + txdesc = (FAR struct ieee802154_txdesc_s *)sq_peek(&priv->indirect_queue); + + if (txdesc == NULL) + { + break; + } + + /* Should probably check a little ahead and remove the transaction if it is within + * a certain number of clock ticks away. There is no since in scheduling the + * timer to expire in only a few ticks. + */ + + if (clock_systimer() >= txdesc->purge_time) + { + /* Unlink the transaction */ + + sq_remfirst(&priv->indirect_queue); + + /* Free the IOB, the notification, and the tx descriptor */ + + iob_free(txdesc->frame); + ((FAR struct mac802154_notif_s *)txdesc->conf)->flink = priv->notif_free; + priv->notif_free = ((FAR struct mac802154_notif_s *)txdesc->conf); + mac802154_txdesc_free(priv, txdesc); + + wlinfo("Indirect TX purged"); + } + else + { + /* Reschedule the transaction for the next timeout */ + + work_queue(MAC802154_WORK, &priv->purge_work, mac802154_purge_worker, + (FAR void *)priv, txdesc->purge_time - clock_systimer()); + break; + } + } } /**************************************************************************** @@ -969,14 +509,37 @@ static void mac802154_txdone_worker(FAR void *arg) switch (priv->curr_cmd) { case IEEE802154_CMD_ASSOC_REQ: - mac802154_assocreq_txdone(priv, txdesc); + mac802154_txdone_assocreq(priv, txdesc); break; case IEEE802154_CMD_ASSOC_RESP: break; case IEEE802154_CMD_DISASSOC_NOT: break; case IEEE802154_CMD_DATA_REQ: - mac802154_datareq_txdone(priv, txdesc); + /* Data requests can be sent for 3 different reasons. + * + * 1. On a beacon-enabled PAN, this command shall be sent + * by a device when macAutoRequest is equal to TRUE and + * a beacon frame indicating that data are pending for + * that device is received from its coordinator. + * 2. when instructed to do so by the next higher layer on + * reception of the MLME-POLL.request primitive. + * 3. a device may send this command to the coordinator + * macResponseWaitTime after the acknowledgment to an + * association request command. + */ + + switch (priv->curr_op) + { + case MAC802154_OP_ASSOC: + mac802154_txdone_datareq_assoc(priv, txdesc); + break; + case MAC802154_OP_POLL: + mac802154_txdone_datareq_poll(priv, txdesc); + break; + default: + break; + } break; case IEEE802154_CMD_PANID_CONF_NOT: break; @@ -996,7 +559,6 @@ static void mac802154_txdone_worker(FAR void *arg) privnotif->flink = priv->notif_free; priv->notif_free = privnotif; - mac802154_givesem(&priv->notif_sem); break; } } @@ -1010,7 +572,6 @@ static void mac802154_txdone_worker(FAR void *arg) privnotif->flink = priv->notif_free; priv->notif_free = privnotif; - mac802154_givesem(&priv->notif_sem); } break; } @@ -1024,433 +585,6 @@ static void mac802154_txdone_worker(FAR void *arg) mac802154_givesem(&priv->exclsem); } -/**************************************************************************** - * Name: mac802154_assocreq_txdone - * - * Description: - * Handle the completion (success/failure) of transmitting an association - * request command. - * - * Assumptions: - * Called with the MAC locked. - * - ****************************************************************************/ - -static void mac802154_assocreq_txdone(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc) -{ - enum ieee802154_status_e status; - FAR struct mac802154_notif_s *privnotif = - (FAR struct mac802154_notif_s *)txdesc->conf; - FAR struct ieee802154_notif_s *notif = &privnotif->pub; - FAR struct ieee802154_txdesc_s *respdesc; - - if(txdesc->conf->status != IEEE802154_STATUS_SUCCESS) - { - /* if the association request command cannot be sent due to a - * channel access failure, the MAC sublayer shall notify the next - * higher layer. [1] pg. 33 - */ - - /* We can actually high-jack the data conf notification since it - * is allocated as an ieee80215_notif_s anyway. Before we overwrite - * any data though, we need to get the status from the data - * confirmation as that is the method we use to get the reason - * why the tx failed from the radio layer. - */ - - status = txdesc->conf->status; - notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; - - notif->u.assocconf.status = status; - - /* The short device address allocated by the coordinator on - * successful association. This parameter will be equal to 0xffff - * if the association attempt was unsuccessful. [1] pg. 81 - */ - - notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; - - /* We are now done the operation, unlock the semaphore */ - - priv->curr_op = MAC802154_OP_NONE; - mac802154_givesem(&priv->op_sem); - - /* Release the MAC, call the callback, get exclusive access again */ - - mac802154_givesem(&priv->exclsem); - priv->cb->notify(priv->cb, notif); - mac802154_takesem(&priv->exclsem, false); - } - else - { - /* On receipt of the acknowledgment to the association request - * command, the device shall wait for at most macResponseWaitTime - * for the coordinator to make its association decision; the PIB - * attribute macResponseWaitTime is a network-topology-dependent - * parameter and may be set to match the specific requirements of - * the network that a device is trying to join. If the device is - * tracking the beacon, it shall attempt to extract the association - * response command from the coordinator whenever it is indicated in - * the beacon frame. If the device is not tracking the beacon, it - * shall attempt to extract the association response command from - * the coordinator after macResponseWaitTime. [1] pg. 34 - */ - - if (priv->trackingbeacon) - { - /* We are tracking the beacon, so we should see our address in the - * beacon frame within macResponseWaitTime if the coordinator is going - * to respond. Setup a timeout for macResponseWaitTime so that we - * can inform the next highest layer if the association attempt fails - * due to NO_DATA. - */ - - uint32_t ticks = mac802154_symtoticks(priv, - priv->resp_waittime*IEEE802154_BASE_SUPERFRAME_DURATION); - - wd_start(priv->timeout, ticks, mac802154_timeout_expiry, (uint32_t)priv); - } - else - { - /* Send the Data Request MAC command after macResponseWaitTime to - * extract the data from the coordinator. - */ - - respdesc = mac802154_assoc_getresp(priv); - priv->radio->txdelayed(priv->radio, respdesc, - (priv->resp_waittime*IEEE802154_BASE_SUPERFRAME_DURATION)); - } - - /* We can deallocate the data conf notification as it is no longer - * needed. We can't use the public function here since we already - * have the MAC locked. - */ - - privnotif->flink = priv->notif_free; - priv->notif_free = privnotif; - mac802154_givesem(&priv->notif_sem); - } -} - -/**************************************************************************** - * Name: mac802154_datareq_txdone - * - * Description: - * Handle the completion (success/failure) of transmitting a data request - * command. - * - * Assumptions: - * Called with the MAC locked. - * - ****************************************************************************/ - -static void mac802154_datareq_txdone(FAR struct ieee802154_privmac_s *priv, - FAR struct ieee802154_txdesc_s *txdesc) -{ - enum ieee802154_status_e status; - FAR struct mac802154_notif_s *privnotif = - (FAR struct mac802154_notif_s *)txdesc->conf; - FAR struct ieee802154_notif_s *notif = &privnotif->pub; - - /* Data requests can be sent for 3 different reasons. - * - * 1. On a beacon-enabled PAN, this command shall be sent by a device when - * macAutoRequest is equal to TRUE and a beacon frame indicating that - * data are pending for that device is received from its coordinator. - * 2. when instructed to do so by the next higher layer on reception of the - * MLME-POLL.request primitive. - * 3. a device may send this command to the coordinator macResponseWaitTime - * after the acknowledgment to an association request command. - */ - - switch (priv->curr_op) - { - case MAC802154_OP_ASSOC: - { - /* If the data request failed to be sent, notify the next layer - * that the association has failed. - * OR - * On receipt of the Ack frame with the Frame Pending field set - * to zero, the device shall conclude that there are no data - * pending at the coordinator. [1] pg. 43 - */ - - if(notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS || - txdesc->framepending == 0) - { - if (notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS) - { - status = notif->u.dataconf.status; - } - else - { - /* If the device does not extract an association response - * command frame from the coordinator within macResponseWaitTime, - * the MLME shall issue the MLME-ASSOCIATE.confirm primitive, - * as described in 6.2.2.4, with a status of NO_DATA, and the - * association attempt shall be deemed a failure. [1] pg. 34 - */ - - status = IEEE802154_STATUS_NO_DATA; - } - - notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; - notif->u.assocconf.status = status; - - /* The short device address allocated by the coordinator on - * successful association. This parameter will be equal to 0xffff - * if the association attempt was unsuccessful. [1] pg. 81 - */ - - notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; - - /* We are now done the operation, and can release the command */ - - priv->curr_op = MAC802154_OP_NONE; - mac802154_givesem(&priv->op_sem); - - /* Release the MAC, call the callback, get exclusive access again */ - - mac802154_givesem(&priv->exclsem); - priv->cb->notify(priv->cb, notif); - mac802154_takesem(&priv->exclsem, false); - - /* Return here so that the notification doesn't get freed */ - - return; - } - else - { - /* On receipt of the acknowledgment frame with the Frame - * Pending field set to one, a device shall enable its - * receiver for at most macMaxFrameTotalWaitTime to receive - * the corresponding data frame from the coordinator. [1] pg.43 - */ - - priv->radio->rxenable(priv->radio, true); - - /* Start a watchdog, if we receive the data frame, we will cancel - * the timer, otherwise it will expire and we will notify the - * next highest layer of the failure. - */ - - wd_start(priv->timeout, - mac802154_symtoticks(priv, priv->max_frame_waittime), - mac802154_timeout_expiry, 1, (uint32_t)priv); - } - } - break; - case MAC802154_OP_POLL: - break; - default: - break; - } - - /* We can deallocate the data conf notification as it is no longer - * needed. We can't use the public function here since we already - * have the MAC locked. - */ - - privnotif->flink = priv->notif_free; - priv->notif_free = privnotif; - mac802154_givesem(&priv->notif_sem); -} - -/**************************************************************************** - * Function: mac802154_timeout_expiry - * - * Description: - * The watchdog timed out. Called from the timer interrupt handler. - * - * Parameters: - * argc - The number of available arguments - * arg - The first argument - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static void mac802154_timeout_expiry(int argc, uint32_t arg, ...) -{ - FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)arg; - - /* There should never be a case where the timeout is used twice at the same - * time. */ - - DEBUGASSERT(work_available(&priv->timeout_work)); - - work_queue(MAC802154_WORK, &priv->timeout_work, mac802154_timeout_worker, priv, 0); -} - -/**************************************************************************** - * Name: mac802154_timeout_worker - * - * Description: - * Worker function scheduled from mac802154_timeout_expiry. This function - * handles any timeouts that occur during various MAC operations. - * - ****************************************************************************/ - -static void mac802154_timeout_worker(FAR void *arg) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)arg; - FAR struct ieee802154_notif_s *notif; - - switch (priv->curr_op) - { - case MAC802154_OP_ASSOC: - { - /* If the device does not extract an association response command - * frame from the coordinator within macResponseWaitTime, the MLME - * shall issue the MLME-ASSOCIATE.confirm primitive, as described - * in 6.2.2.4, with a status of NO_DATA, and the association attempt - * shall be deemed a failure. [1] pg. 33 - */ - - /* Allocate a notification struct to pass to the next highest layer. - * Don't allow EINTR to interrupt. - */ - - mac802154_takesem(&priv->exclsem, false); - mac802154_notif_alloc(priv, ¬if, false); - - /* We are no longer performing the association operation */ - priv->curr_op = MAC802154_OP_NONE; - mac802154_givesem(&priv->op_sem); - - /* Release the MAC */ - - mac802154_givesem(&priv->exclsem); - - notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; - notif->u.assocconf.status = IEEE802154_STATUS_NO_DATA; - notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; - - priv->cb->notify(priv->cb, notif); - } - break; - default: - wlwarn("Timeout occured for unknown reason!"); - break; - } -} - -/**************************************************************************** - * Name: mac802154_assoc_getresp - * - * Description: - * Send a data request to the coordinator to extract the association response. - * - * Assumptions: - * MAC is locked when called. - * - * TODO: Can this be used for general data extraction? - * - ****************************************************************************/ - -static FAR struct ieee802154_txdesc_s * - mac802154_assoc_getresp(FAR struct ieee802154_privmac_s *priv) -{ - FAR struct iob_s *iob; - FAR struct ieee802154_txdesc_s *txdesc; - FAR uint16_t *u16; - - /* Allocate an IOB to put the frame in */ - - iob = iob_alloc(false); - DEBUGASSERT(iob != NULL); - - iob->io_flink = NULL; - iob->io_len = 0; - iob->io_offset = 0; - iob->io_pktlen = 0; - - /* Allocate a tx descriptor */ - - mac802154_txdesc_alloc(priv, &txdesc, false); - - priv->curr_cmd = IEEE802154_CMD_DATA_REQ; - - /* Get a uin16_t reference to the first two bytes. ie frame control field */ - - u16 = (FAR uint16_t *)&iob->io_data[0]; - - *u16 = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); - *u16 |= IEEE802154_FRAMECTRL_ACKREQ; - *u16 |= (priv->coordaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); - *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); - - /* If the Destination Addressing Mode field is set to indicate that - * destination addressing information is not present, the PAN ID Compression - * field shall be set to zero and the source PAN identifier shall contain the - * value of macPANId. Otherwise, the PAN ID Compression field shall be set to - * one. In this case and in accordance with the PAN ID Compression field, the - * Destination PAN Identifier field shall contain the value of macPANId, while - * the Source PAN Identifier field shall be omitted. [1] pg. 72 - * - * The destination address for a data request to extract an assoication request - * should never be set to none. So we always set the PAN ID compression field - */ - - DEBUGASSERT(priv->coordaddr.mode != IEEE802154_ADDRMODE_NONE); - - *u16 |= IEEE802154_FRAMECTRL_PANIDCOMP; - - iob->io_len = 2; - - /* Each time a data or a MAC command frame is generated, the MAC sublayer - * shall copy the value of macDSN into the Sequence Number field of the - * MHR of the outgoing frame and then increment it by one. [1] pg. 40. - */ - - iob->io_data[iob->io_len++] = priv->dsn++; - - /* The Destination PAN Identifier field shall contain the identifier of - * the PAN to which to associate. [1] pg. 68 - */ - - memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.panid, 2); - - /* The Destination Address field shall contain the address from the - * beacon frame that was transmitted by the coordinator to which the - * association request command is being sent. [1] pg. 68 - */ - - if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) - { - memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.saddr, 2); - iob->io_len += 2; - } - else if (priv->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) - { - memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.eaddr[0], - IEEE802154_EADDR_LEN); - iob->io_len += IEEE802154_EADDR_LEN; - } - - /* The Source Address field shall contain the value of macExtendedAddress. */ - - memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], - IEEE802154_EADDR_LEN); - iob->io_len += IEEE802154_EADDR_LEN; - - /* Copy in the Command Frame Identifier */ - - iob->io_data[iob->io_len++] = IEEE802154_CMD_DATA_REQ; - - /* Copy the IOB reference to the descriptor */ - - txdesc->frame = iob; - - return txdesc; -} - /**************************************************************************** * Name: mac802154_rxframe * @@ -1485,6 +619,8 @@ static void mac802154_rxframe(FAR const struct ieee802154_radiocb_s *radiocb, sq_addlast((FAR sq_entry_t *)ind, &priv->dataind_queue); + wlinfo("frame received\n"); + mac802154_givesem(&priv->exclsem); /* Schedule work with the work queue to process the completion further */ @@ -1525,7 +661,7 @@ static void mac802154_rxframe_worker(FAR void *arg) mac802154_takesem(&priv->exclsem, false); - /* Push the iob onto the tail of the frame list for processing */ + /* Pop the iob from the head of the frame list for processing */ ind = (FAR struct ieee802154_data_ind_s *)sq_remfirst(&priv->dataind_queue); @@ -1570,19 +706,19 @@ static void mac802154_rxframe_worker(FAR void *arg) { /* Get the destination PAN ID */ - ind->dest.panid = frame->io_data[frame->io_offset]; + memcpy(&ind->dest.panid, &frame->io_data[frame->io_offset], 2); frame->io_offset += 2; if (ind->dest.mode == IEEE802154_ADDRMODE_SHORT) { - ind->dest.saddr = frame->io_data[frame->io_offset]; + memcpy(&ind->dest.saddr, &frame->io_data[frame->io_offset], 2); frame->io_offset += 2; } else if (ind->dest.mode == IEEE802154_ADDRMODE_EXTENDED) { memcpy(&ind->dest.eaddr[0], &frame->io_data[frame->io_offset], IEEE802154_EADDR_LEN); - frame->io_offset += 8; + frame->io_offset += IEEE802154_EADDR_LEN; } } @@ -1592,24 +728,21 @@ static void mac802154_rxframe_worker(FAR void *arg) * is set, get the PAN ID from the header. */ - if (!panid_comp) + if (panid_comp) { - ind->src.panid = frame->io_data[frame->io_offset]; + /* The source PAN ID is equal to the destination PAN ID */ + + ind->src.panid = ind->dest.panid; + } + else + { + memcpy(&ind->src.panid, &frame->io_data[frame->io_offset], 2); frame->io_offset += 2; } - /* If the source address is included, and the PAN ID compression field - * is set, the source PAN ID is the same as the destination PAN ID - */ - - else - { - ind->src.panid = ind->dest.panid; - } - if (ind->src.mode == IEEE802154_ADDRMODE_SHORT) { - ind->src.saddr = frame->io_data[frame->io_offset]; + memcpy(&ind->src.saddr, &frame->io_data[frame->io_offset], 2); frame->io_offset += 2; } else if (ind->src.mode == IEEE802154_ADDRMODE_EXTENDED) @@ -1623,393 +756,361 @@ static void mac802154_rxframe_worker(FAR void *arg) ftype = (*frame_ctrl & IEEE802154_FRAMECTRL_FTYPE) >> IEEE802154_FRAMECTRL_SHIFT_FTYPE; - if (ftype == IEEE802154_FRAME_DATA) + switch (ftype) { - /* If there is a registered MCPS callback receiver registered, send - * the frame, otherwise, throw it out. - */ - - if (priv->cb->rxframe != NULL) + case IEEE802154_FRAME_DATA: { - priv->cb->rxframe(priv->cb, ind); + mac802154_rx_dataframe(priv, ind); } - else + break; + + case IEEE802154_FRAME_COMMAND: { + /* Get the command type. The command type is always the first + * field after the MHR. Consu;me the byte by increasing offset so that + * subsequent functions can start from the byte after the command ID. + */ + + uint8_t cmdtype = frame->io_data[frame->io_offset++]; + + switch (cmdtype) + { + case IEEE802154_CMD_ASSOC_REQ: + mac802154_rx_assocreq(priv, ind); + break; + case IEEE802154_CMD_ASSOC_RESP: + mac802154_rx_assocresp(priv, ind); + break; + case IEEE802154_CMD_DISASSOC_NOT: + break; + case IEEE802154_CMD_DATA_REQ: + mac802154_rx_datareq(priv, ind); + break; + case IEEE802154_CMD_PANID_CONF_NOT: + break; + case IEEE802154_CMD_ORPHAN_NOT: + break; + case IEEE802154_CMD_BEACON_REQ: + break; + case IEEE802154_CMD_COORD_REALIGN: + break; + case IEEE802154_CMD_GTS_REQ: + break; + } + /* Free the data indication struct from the pool */ ieee802154_ind_free(ind); } - } - else if (ftype == IEEE802154_FRAME_COMMAND) - { - /* Get the command type. The command type is always the first - * field after the MHR. Consume the byte by increasing offset so that - * subsequent functions can start from the byte after the command ID. - */ + break; - uint8_t cmdtype = frame->io_data[frame->io_offset++]; - - switch (cmdtype) + case IEEE802154_FRAME_BEACON: { - case IEEE802154_CMD_ASSOC_REQ: - break; - case IEEE802154_CMD_ASSOC_RESP: - { - mac802154_rx_assocresp(priv, ind); - } - break; - case IEEE802154_CMD_DISASSOC_NOT: - break; - case IEEE802154_CMD_DATA_REQ: - break; - case IEEE802154_CMD_PANID_CONF_NOT: - break; - case IEEE802154_CMD_ORPHAN_NOT: - break; - case IEEE802154_CMD_BEACON_REQ: - break; - case IEEE802154_CMD_COORD_REALIGN: - break; - case IEEE802154_CMD_GTS_REQ: - break; + /* TODO: Add logic here to handle extracting association response from + * coordinator if beacon tracking was enabled during the Association + * operation. + * + * txdesc = mac802154_assoc_getresp(priv); + * sq_addlast((FAR sq_entry_t *)txdesc, &priv->csma_queue); + */ } - - /* Free the data indication struct from the pool */ + break; - ieee802154_ind_free(ind); - } - else if (ftype == IEEE802154_FRAME_BEACON) - { - /* TODO: Add logic here to handle extracting association response from - * coordinator if beacon tracking was enabled during the Association - * operation. - * - * txdesc = mac802154_assoc_getresp(priv); - * sq_addlast((FAR sq_entry_t *)txdesc, &priv->csma_queue); - */ + case IEEE802154_FRAME_ACK: + { + /* The radio layer is responsible for handling all ACKs and retries. + * If for some reason an ACK gets here, just throw it out. + */ - } - else - { - /* The radio layer is responsible for handling all ACKs and retries. - * If for some reason an ACK gets here, just throw it out. - */ + wlinfo("ACK received\n"); + ieee802154_ind_free(ind); + } + break; } } } /**************************************************************************** - * Name: mac802154_rxframe_worker + * Name: mac802154_rx_dataframe * * Description: - * Worker function scheduled from mac802154_rxframe. This function processes - * any frames in the list. Frames intended to be consumed by the MAC layer - * will not produce any callbacks to the next highest layer. Frames intended - * for the application layer will be forwarded to them. - * - * Assumptions: - * Called with the MAC unlocked + * Function called from the generic RX Frame worker to parse and handle the + * reception of a data frame. * ****************************************************************************/ -static void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, +static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, FAR struct ieee802154_data_ind_s *ind) { - FAR struct iob_s *frame = ind->frame; FAR struct ieee802154_notif_s *notif; - /* Check if we are performing an Association operation, if not, we will just - * ignore the frame. - */ - - if (priv->curr_op != MAC802154_OP_ASSOC) - { - return; - } - - /* Cancel the timeout used if we didn't get a response */ - - wd_cancel(priv->timeout); - /* Get exclusive access to the MAC */ mac802154_takesem(&priv->exclsem, false); - /* Allocate a notification to pass to the next highest layer */ + /* If we are currently performing a POLL operation and we've + * received a data response, use the addressing information + * to determine if it is extracted data. If the addressing info + * matches, notify the next highest layer using POLL.confirm + * primitive. If the addressing information does not match, + * handle the transaction like any other data transaction. + * + * Note: We can't receive frames without addressing information + * unless we are the PAN coordinator. And in that situation, we + * wouldn't be performing a POLL operation. Meaning: + * + * If the current operation is POLL, we aren't the PAN coordinator + * so the incoming frame CAN'T + * + * FIXME: Fix documentation + */ - mac802154_notif_alloc(priv, ¬if, false); - notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; - - /* Parse the short address from the response */ - - priv->addr.saddr = (uint16_t)(frame->io_data[frame->io_offset]); - frame->io_offset += 2; - - /* A Short Address field value equal to 0xfffe shall indicate that the device - * has been successfully associated with a PAN but has not been allocated a - * short address. In this case, the device shall communicate on the PAN using - * only its extended address. [1] pg. 70 - */ - - if (priv->addr.saddr == IEEE802154_SADDR_BCAST) + if (priv->curr_op == MAC802154_OP_POLL || priv->curr_op == MAC802154_OP_ASSOC) { - /* TODO: Figure out if this is sufficient */ + /* If we are in promiscuous mode, we need to check if the + * frame is even for us first. If the address is not ours, + * then handle the frame like a normal transaction. + */ - priv->addr.mode = IEEE802154_ADDRMODE_SHORT; - } - - /* Parse the status from the response */ + if (priv->promisc) + { + if (ind->dest.panid != priv->addr.panid) + { + goto notify_with_lock; + } - notif->u.assocconf.status = frame->io_data[frame->io_offset++]; + if (ind->dest.mode == IEEE802154_ADDRMODE_SHORT && + ind->dest.saddr != priv->addr.saddr) + { + goto notify_with_lock; + } + else if (ind->dest.mode == IEEE802154_ADDRMODE_EXTENDED && + (memcmp(&ind->dest.eaddr[0], &priv->addr.eaddr[0], + IEEE802154_EADDR_LEN) != 0)) + { + goto notify_with_lock; + } + else + { + goto notify_with_lock; + } + } - if (notif->u.assocconf.status == IEEE802154_STATUS_SUCCESS) - { - priv->isassoc = true; + /* If this was our extracted data, the source addressing field can only + * be NONE if we are trying to extract data from the PAN coordinator. + * A PAN coordinator shouldn't be sending us a frame if it wasn't + * our extracted data. Therefore just assume if the address mode is set + * to NONE, we process it as our extracted frame + */ + + if (ind->src.mode != priv->cmd_desc->destaddr.mode) + { + goto notify_with_lock; + } + + if (ind->src.mode == IEEE802154_ADDRMODE_SHORT && + ind->src.saddr != priv->cmd_desc->destaddr.saddr) + { + goto notify_with_lock; + } + else if (ind->src.mode == IEEE802154_ADDRMODE_EXTENDED && + (memcmp(&ind->src.eaddr[0], &priv->cmd_desc->destaddr.eaddr[0], + IEEE802154_EADDR_LEN) != 0)) + { + goto notify_with_lock; + } + + /* If we've gotten this far, the frame is our extracted data. Cancel the + * timeout */ + + mac802154_timercancel(priv); + + /* If a frame is received from the coordinator with a zero length payload + * or if the frame is a MAC command frame, the MLME will issue the + * MLME-POLL.confirm primitive with a status of NO_DATA. [1] pg. 111 + */ + + mac802154_notif_alloc(priv, ¬if, false); + + if (priv->curr_op == MAC802154_OP_POLL) + { + notif->notiftype = IEEE802154_NOTIFY_CONF_POLL; + + if (ind->frame->io_offset == ind->frame->io_len) + { + ieee802154_ind_free(ind); + notif->u.pollconf.status = IEEE802154_STATUS_NO_DATA; + } + else + { + notif->u.pollconf.status = IEEE802154_STATUS_SUCCESS; + } + } + else if (priv->curr_op == MAC802154_OP_ASSOC) + { + /* If we ever receive a data frame back as a response to the + * association request, we assume it means there wasn't any data. + */ + + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + notif->u.assocconf.status = IEEE802154_STATUS_NO_DATA; + } + + /* We are no longer performing the association operation */ + + priv->curr_op = MAC802154_OP_NONE; + priv->cmd_desc = NULL; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC */ + + mac802154_givesem(&priv->exclsem); + + priv->cb->notify(priv->cb, notif); + + /* If there was data, pass it along */ + + if (ind->frame->io_len > ind->frame->io_offset) + { + goto notify_without_lock; + } } else { - priv->isassoc = false; +notify_with_lock: + + mac802154_givesem(&priv->exclsem); + +notify_without_lock: + + /* If there is a registered MCPS callback receiver registered, + * send the frame, otherwise, throw it out. + */ + + if (priv->cb->rxframe != NULL) + { + priv->cb->rxframe(priv->cb, ind); + } + else + { + /* Free the data indication struct from the pool */ + + ieee802154_ind_free(ind); + } + } +} + +/**************************************************************************** + * Name: mac802154_rx_datareq + * + * Description: + * Function called from the generic RX Frame worker to parse and handle the + * reception of an Data Request MAC command frame. + * + ****************************************************************************/ + +static void mac802154_rx_datareq(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind) +{ + FAR struct ieee802154_txdesc_s *txdesc; + FAR struct iob_s *iob; + uint16_t *frame_ctrl; + + /* Get exclusive access to the MAC */ + + mac802154_takesem(&priv->exclsem, false); + + /* Search the list of indirect transactions to see if there are any waiting + * for the requesting device. + */ + + /* TODO: I believe there is an issue here. If there is for some reason a + * outgoing data frame to a device who is currently requesting association, + * we will send the data frame as a response to an association request. We + * need to check for this condition. + */ + + txdesc = (FAR struct ieee802154_txdesc_s *)sq_peek(&priv->indirect_queue); + + if (txdesc == NULL) + { + goto no_data; } - notif->u.assocconf.saddr = priv->addr.saddr; + do + { + if (txdesc->destaddr.mode == ind->src.mode) + { + if (txdesc->destaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + if (txdesc->destaddr.saddr == ind->src.saddr) + { + /* Remove the transaction from the queue */ - /* Unlock the MAC */ + sq_rem((FAR sq_entry_t *)txdesc, &priv->indirect_queue); + + /* The addresses match, send the transaction immediately */ + + priv->radio->txdelayed(priv->radio, txdesc, 0); + break; + } + } + else if (txdesc->destaddr.mode == IEEE802154_ADDRMODE_EXTENDED) + { + if (memcmp(&txdesc->destaddr.eaddr[0], &ind->src.eaddr[0], + sizeof(IEEE802154_EADDR_LEN)) == 0) + { + /* Remove the transaction from the queue */ + + sq_rem((FAR sq_entry_t *)txdesc, &priv->indirect_queue); + + /* The addresses match, send the transaction immediately */ + + priv->radio->txdelayed(priv->radio, txdesc, 0); + break; + } + } + else + { + DEBUGASSERT(false); + } + } + + txdesc = (FAR struct ieee802154_txdesc_s *)sq_next((FAR sq_entry_t *)txdesc); + + if (txdesc == NULL) + { + goto no_data; + } + } + while (1); mac802154_givesem(&priv->exclsem); + return; - /* Notify the next highest layer of the association status */ +no_data: - priv->cb->notify(priv->cb, notif); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: mac802154_ioctl - * - * Description: - * Handle MAC and radio IOCTL commands directed to the MAC. - * - * Parameters: - * mac - Reference to the MAC driver state structure - * cmd - The IOCTL command - * arg - The argument for the IOCTL command - * - * Returned Value: - * OK on success; Negated errno on failure. - * - ****************************************************************************/ - -int mac802154_ioctl(MACHANDLE mac, int cmd, unsigned long arg) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - int ret = -EINVAL; - - FAR union ieee802154_macarg_u *macarg = - (FAR union ieee802154_macarg_u *)((uintptr_t)arg); - - DEBUGASSERT(priv != NULL); - - /* Check for IOCTLs aimed at the IEEE802.15.4 MAC layer */ - - if (_MAC802154IOCVALID(cmd)) - { - /* Handle the MAC IOCTL command */ - - switch (cmd) - { - case MAC802154IOC_MLME_ASSOC_REQUEST: - { - ret = mac802154_req_associate(mac, &macarg->assocreq); - } - break; - case MAC802154IOC_MLME_ASSOC_RESPONSE: - { - ret = mac802154_resp_associate(mac, &macarg->assocresp); - } - break; - case MAC802154IOC_MLME_DISASSOC_REQUEST: - { - ret = mac802154_req_disassociate(mac, &macarg->disassocreq); - } - break; - case MAC802154IOC_MLME_GET_REQUEST: - { - ret = mac802154_req_get(mac, macarg->getreq.pib_attr, - &macarg->getreq.attrval); - } - break; - case MAC802154IOC_MLME_GTS_REQUEST: - { - ret = mac802154_req_gts(mac, &macarg->gtsreq); - } - break; - case MAC802154IOC_MLME_ORPHAN_RESPONSE: - { - ret = mac802154_resp_orphan(mac, &macarg->orphanresp); - } - break; - case MAC802154IOC_MLME_RESET_REQUEST: - { - ret = mac802154_req_reset(mac, macarg->resetreq.rst_pibattr); - } - break; - case MAC802154IOC_MLME_RXENABLE_REQUEST: - { - ret = mac802154_req_rxenable(mac, &macarg->rxenabreq); - } - break; - case MAC802154IOC_MLME_SCAN_REQUEST: - { - ret = mac802154_req_scan(mac, &macarg->scanreq); - } - break; - case MAC802154IOC_MLME_SET_REQUEST: - { - ret = mac802154_req_set(mac, macarg->setreq.pib_attr, - &macarg->setreq.attrval); - } - break; - case MAC802154IOC_MLME_START_REQUEST: - { - ret = mac802154_req_start(mac, &macarg->startreq); - } - break; - case MAC802154IOC_MLME_SYNC_REQUEST: - { - ret = mac802154_req_sync(mac, &macarg->syncreq); - } - break; - case MAC802154IOC_MLME_POLL_REQUEST: - { - ret = mac802154_req_poll(mac, &macarg->pollreq); - } - break; - default: - wlerr("ERROR: Unrecognized cmd: %d\n", cmd); - ret = -ENOTTY; - break; - } - } - return ret; -} - -/**************************************************************************** - * MAC Interface Operations - ****************************************************************************/ - -/**************************************************************************** - * Name: mac802154_get_mhrlen - * - * Description: - * Calculate the MAC header length given the frame meta-data. - * - ****************************************************************************/ - -int mac802154_get_mhrlen(MACHANDLE mac, - FAR const struct ieee802154_frame_meta_s *meta) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - int ret = 3; /* Always frame control (2 bytes) and seq. num (1 byte) */ - - /* Check to make sure both the dest address and the source address are not set - * to NONE */ - - if (meta->dest_addr.mode == IEEE802154_ADDRMODE_NONE && - meta->src_addrmode == IEEE802154_ADDRMODE_NONE) - { - return -EINVAL; - } - - /* The source address can only be set to NONE if the device is the PAN coord */ - - if (meta->src_addrmode == IEEE802154_ADDRMODE_NONE && - priv->devmode != IEEE802154_DEVMODE_PANCOORD) - { - return -EINVAL; - } - - /* Add the destination address length */ - - ret += mac802154_addr_length[meta->dest_addr.mode]; - - /* Add the source address length */ - - ret += mac802154_addr_length[ meta->src_addrmode]; - - /* If both destination and source addressing information is present, the MAC - * sublayer shall compare the destination and source PAN identifiers. - * [1] pg. 41. + /* If there is no data frame pending for the requesting device, the coordinator + * shall send a data frame without requesting acknowledgment to the device + * containing a zero length payload, indicating that no data are present, using + * one of the mechanisms described in this subclause. [1] pg. 43 */ - if (meta->src_addrmode != IEEE802154_ADDRMODE_NONE && - meta->dest_addr.mode != IEEE802154_ADDRMODE_NONE) - { - /* If the PAN identifiers are identical, the PAN ID Compression field - * shall be set to one, and the source PAN identifier shall be omitted - * from the transmitted frame. [1] pg. 41. - */ + /* Allocate an IOB to put the frame in */ + + iob = iob_alloc(false); + DEBUGASSERT(iob != NULL); + + iob->io_flink = NULL; + iob->io_len = 0; + iob->io_offset = 0; + iob->io_pktlen = 0; - if (meta->dest_addr.panid == priv->addr.panid) - { - ret += 2; /* 2 bytes for destination PAN ID */ - return ret; - } - } - - /* If we are here, PAN ID compression is off, so include the dest and source - * PAN ID if the respective address is included - */ - - if (meta->src_addrmode != IEEE802154_ADDRMODE_NONE) - { - ret += 2; /* 2 bytes for source PAN ID */ - } - - if (meta->dest_addr.mode != IEEE802154_ADDRMODE_NONE) - { - ret += 2; /* 2 bytes for destination PAN ID */ - } - - return ret; -} - -/**************************************************************************** - * Name: mac802154_req_data - * - * Description: - * The MCPS-DATA.request primitive requests the transfer of a data SPDU - * (i.e., MSDU) from a local SSCS entity to a single peer SSCS entity. - * Confirmation is returned via the - * struct mac802154_maccb_s->conf_data callback. - * - ****************************************************************************/ - -int mac802154_req_data(MACHANDLE mac, - FAR const struct ieee802154_frame_meta_s *meta, - FAR struct iob_s *frame) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - FAR struct ieee802154_txdesc_s *txdesc; - uint16_t *frame_ctrl; - uint8_t mhr_len = 3; /* Start assuming frame control and seq. num */ - int ret; - - /* Check the required frame size */ - - if (frame->io_len > IEEE802154_MAX_PHY_PACKET_SIZE) - { - return -E2BIG; - } + iob->io_len += 2; /* Cast the first two bytes of the IOB to a uint16_t frame control field */ - frame_ctrl = (FAR uint16_t *)&frame->io_data[0]; + frame_ctrl = (FAR uint16_t *)&iob->io_data[0]; /* Ensure we start with a clear frame control field */ @@ -2019,372 +1120,6 @@ int mac802154_req_data(MACHANDLE mac, *frame_ctrl |= IEEE802154_FRAME_DATA << IEEE802154_FRAMECTRL_SHIFT_FTYPE; - /* If the msduLength is greater than aMaxMACSafePayloadSize, the MAC - * sublayer will set the Frame Version to one. [1] pg. 118. - */ - - if ((frame->io_len - frame->io_offset) > IEEE802154_MAX_SAFE_MAC_PAYLOAD_SIZE) - { - *frame_ctrl |= IEEE802154_FRAMECTRL_VERSION; - } - - /* If the TXOptions parameter specifies that an acknowledged transmission - * is required, the AR field will be set appropriately, as described in - * 5.1.6.4 [1] pg. 118. - */ - - *frame_ctrl |= (meta->msdu_flags.ack_tx << IEEE802154_FRAMECTRL_SHIFT_ACKREQ); - - /* If the destination address is present, copy the PAN ID and one of the - * addresses, depending on mode, into the MHR. - */ - - if (meta->dest_addr.mode != IEEE802154_ADDRMODE_NONE) - { - memcpy(&frame->io_data[mhr_len], &meta->dest_addr.panid, 2); - mhr_len += 2; - - if (meta->dest_addr.mode == IEEE802154_ADDRMODE_SHORT) - { - memcpy(&frame->io_data[mhr_len], &meta->dest_addr.saddr, 2); - mhr_len += 2; - } - else if (meta->dest_addr.mode == IEEE802154_ADDRMODE_EXTENDED) - { - memcpy(&frame->io_data[mhr_len], &meta->dest_addr.eaddr, - IEEE802154_EADDR_LEN); - - mhr_len += IEEE802154_EADDR_LEN; - } - } - - /* Set the destination addr mode inside the frame control field */ - - *frame_ctrl |= (meta->dest_addr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); - - /* From this point on, we need exclusive access to the privmac struct */ - - ret = mac802154_takesem(&priv->exclsem, true); - if (ret < 0) - { - return ret; - } - - /* If both destination and source addressing information is present, the MAC - * sublayer shall compare the destination and source PAN identifiers. - * [1] pg. 41. - */ - - if (meta->src_addrmode != IEEE802154_ADDRMODE_NONE && - meta->dest_addr.mode != IEEE802154_ADDRMODE_NONE) - { - /* If the PAN identifiers are identical, the PAN ID Compression field - * shall be set to one, and the source PAN identifier shall be omitted - * from the transmitted frame. [1] pg. 41. - */ - - if (meta->dest_addr.panid == priv->addr.panid) - { - *frame_ctrl |= IEEE802154_FRAMECTRL_PANIDCOMP; - } - } - - if (meta->src_addrmode != IEEE802154_ADDRMODE_NONE) - { - /* If the destination address is not included, or if PAN ID Compression - * is off, we need to include the Source PAN ID. - */ - - if ((meta->dest_addr.mode == IEEE802154_ADDRMODE_NONE) || - (!(*frame_ctrl & IEEE802154_FRAMECTRL_PANIDCOMP))) - { - memcpy(&frame->io_data[mhr_len], &priv->addr.panid, 2); - mhr_len += 2; - } - - if (meta->src_addrmode == IEEE802154_ADDRMODE_SHORT) - { - memcpy(&frame->io_data[mhr_len], &priv->addr.saddr, 2); - mhr_len += 2; - } - else if (meta->src_addrmode == IEEE802154_ADDRMODE_EXTENDED) - { - memcpy(&frame->io_data[mhr_len], &priv->addr.eaddr, - IEEE802154_EADDR_LEN); - - mhr_len += IEEE802154_EADDR_LEN; - } - } - - /* Set the source addr mode inside the frame control field */ - - *frame_ctrl |= (meta->src_addrmode << IEEE802154_FRAMECTRL_SHIFT_SADDR); - - /* Each time a data or a MAC command frame is generated, the MAC sublayer - * shall copy the value of macDSN into the Sequence Number field of the MHR - * of the outgoing frame and then increment it by one. [1] pg. 40. - */ - - frame->io_data[2] = priv->dsn++; - - /* The MAC header we just created must never have exceeded where the app - * data starts. This should never happen since the offset should have - * been set via the same logic to calculate the header length as the logic - * here that created the header - */ - - DEBUGASSERT(mhr_len == frame->io_offset); - - frame->io_offset = 0; /* Set the offset to 0 to include the header */ - - /* Allocate the txdesc, waiting if necessary, allow interruptions */ - - ret = mac802154_txdesc_alloc(priv, &txdesc, true); - if (ret < 0) - { - return ret; - } - - txdesc->conf->handle = meta->msdu_handle; - txdesc->frame = frame; - txdesc->frametype = IEEE802154_FRAME_DATA; - - /* If the TxOptions parameter specifies that a GTS transmission is required, - * the MAC sublayer will determine whether it has a valid GTS as described - * 5.1.7.3. If a valid GTS could not be found, the MAC sublayer will discard - * the MSDU. If a valid GTS was found, the MAC sublayer will defer, if - * necessary, until the GTS. If the TxOptions parameter specifies that a GTS - * transmission is not required, the MAC sublayer will transmit the MSDU using - * either slotted CSMA-CA in the CAP for a beacon-enabled PAN or unslotted - * CSMA-CA for a nonbeacon-enabled PAN. Specifying a GTS transmission in the - * TxOptions parameter overrides an indirect transmission request. - * [1] pg. 118. - */ - - if (meta->msdu_flags.gts_tx) - { - /* TODO: Support GTS transmission. This should just change where we link - * the transaction. Instead of going in the CSMA transaction list, it - * should be linked to the GTS' transaction list. We'll need to check if - * the GTS is valid, and then find the GTS, before linking. Note, we also - * don't have to try and kick-off any transmission here. - */ - - /* We no longer need to have the MAC layer locked. */ - - mac802154_givesem(&priv->exclsem); - - return -ENOTSUP; - } - else - { - /* If the TxOptions parameter specifies that an indirect transmission is - * required and this primitive is received by the MAC sublayer of a - * coordinator, the data frame is sent using indirect transmission, as - * described in 5.1.5 and 5.1.6.3. [1] - */ - - if (meta->msdu_flags.indirect_tx) - { - /* If the TxOptions parameter specifies that an indirect transmission - * is required and if the device receiving this primitive is not a - * coordinator, the destination address is not present, or the - * TxOptions parameter also specifies a GTS transmission, the indirect - * transmission option will be ignored. [1] - * - * NOTE: We don't just ignore the parameter. Instead, we throw an - * error, since this really shouldn't be happening. - */ - - if (priv->devmode == IEEE802154_DEVMODE_COORD && - meta->dest_addr.mode != IEEE802154_ADDRMODE_NONE) - { - /* Link the transaction into the indirect_trans list */ - - mac802154_givesem(&priv->exclsem); - } - else - { - mac802154_givesem(&priv->exclsem); - return -EINVAL; - } - } - else - { - /* Link the transaction into the CSMA transaction list */ - - sq_addlast((FAR sq_entry_t *)txdesc, &priv->csma_queue); - - /* We no longer need to have the MAC layer locked. */ - - mac802154_givesem(&priv->exclsem); - - /* Notify the radio driver that there is data available */ - - priv->radio->txnotify(priv->radio, false); - } - } - - return OK; -} - -/**************************************************************************** - * Name: mac802154_req_purge - * - * Description: - * The MCPS-PURGE.request primitive allows the next higher layer to purge - * an MSDU from the transaction queue. Confirmation is returned via - * the struct mac802154_maccb_s->conf_purge callback. - * - * NOTE: The standard specifies that confirmation should be indicated via - * the asynchronous MLME-PURGE.confirm primitve. However, in our - * implementation we synchronously return the status from the request. - * Therefore, we merge the functionality of the MLME-PURGE.request and - * MLME-PURGE.confirm primitives together. - * - ****************************************************************************/ - -int mac802154_req_purge(MACHANDLE mac, uint8_t msdu_handle) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_req_associate - * - * Description: - * The MLME-ASSOCIATE.request primitive allows a device to request an - * association with a coordinator. Confirmation is returned via the - * struct mac802154_maccb_s->conf_associate callback. - * - * On receipt of the MLME-ASSOCIATE.request primitive, the MLME of an - * unassociated device first updates the appropriate PHY and MAC PIB - * attributes, as described in 5.1.3.1, and then generates an association - * request command, as defined in 5.3.1 [1] pg.80 - * - ****************************************************************************/ - -int mac802154_req_associate(MACHANDLE mac, - FAR struct ieee802154_assoc_req_s *req) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - FAR struct ieee802154_txdesc_s *txdesc; - FAR struct iob_s *iob; - FAR uint16_t *u16; - bool rxonidle; - int ret; - - /* Get exlusive access to the operation sempaphore. This must happen before - * getting exclusive access to the MAC struct or else there could be a lockup - * condition. This would occur if another thread is using the cmdtrans but - * needs access to the MAC in order to unlock it. - */ - - ret = mac802154_takesem(&priv->op_sem, true); - if (ret < 0) - { - return ret; - } - - priv->curr_op = MAC802154_OP_ASSOC; - priv->curr_cmd = IEEE802154_CMD_ASSOC_REQ; - - /* Get exclusive access to the MAC */ - - ret = mac802154_takesem(&priv->exclsem, true); - if (ret < 0) - { - mac802154_givesem(&priv->op_sem); - return ret; - } - - /* Set the channel and channel page of the PHY layer */ - - priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_CHANNEL, - (FAR const union ieee802154_attr_u *)&req->chnum); - - priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_PAGE, - (FAR const union ieee802154_attr_u *)&req->chpage); - - /* Set the PANID attribute */ - - priv->addr.panid = req->coordaddr.panid; - priv->coordaddr.panid = req->coordaddr.panid; - priv->radio->set_attr(priv->radio, IEEE802154_PIB_MAC_PANID, - (FAR const union ieee802154_attr_u *)&req->coordaddr.panid); - - /* Set the coordinator address attributes */ - - priv->coordaddr.mode = req->coordaddr.mode; - - if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) - { - priv->coordaddr.saddr = req->coordaddr.saddr; - memcpy(&priv->coordaddr.eaddr[0], IEEE802154_EADDR_UNSPEC, - IEEE802154_EADDR_LEN); - } - else if (priv->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) - { - priv->coordaddr.saddr = IEEE802154_SADDR_UNSPEC; - memcpy(&priv->coordaddr.eaddr[0], &req->coordaddr.eaddr[0], - IEEE802154_EADDR_LEN); - } - else - { - ret = -EINVAL; - goto errout; - } - - /* Copy in the capabilities information bitfield */ - - priv->devmode = (req->capabilities.devtype) ? - IEEE802154_DEVMODE_COORD : IEEE802154_DEVMODE_ENDPOINT; - - /* Unlike other attributes, we can't simply cast this one since it is a bit - * in a bitfield. Casting it will give us unpredicatble results. Instead - * of creating a ieee802154_attr_u, we use a local bool. Allocating the - * ieee802154_attr_u value would take up more room on the stack since it is - * as large as the largest attribute type. - */ - - rxonidle = req->capabilities.rxonidle; - priv->radio->set_attr(priv->radio, IEEE802154_PIB_MAC_RX_ON_WHEN_IDLE, - (FAR const union ieee802154_attr_u *)&rxonidle); - - /* Allocate an IOB to put the frame in */ - - iob = iob_alloc(false); - DEBUGASSERT(iob != NULL); - - iob->io_flink = NULL; - iob->io_len = 0; - iob->io_offset = 0; - iob->io_pktlen = 0; - - /* Allocate the txdesc, waiting if necessary */ - - ret = mac802154_txdesc_alloc(priv, &txdesc, true); - if (ret < 0) - { - mac802154_givesem(&priv->exclsem); - mac802154_givesem(&priv->op_sem); - return ret; - } - - /* Get a uin16_t reference to the first two bytes. ie frame control field */ - - u16 = (FAR uint16_t *)&iob->io_data[0]; - - *u16 = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); - *u16 |= IEEE802154_FRAMECTRL_ACKREQ; - *u16 |= (priv->coordaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); - *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); - - iob->io_len = 2; - /* Each time a data or a MAC command frame is generated, the MAC sublayer * shall copy the value of macDSN into the Sequence Number field of the MHR * of the outgoing frame and then increment it by one. [1] pg. 40. @@ -2392,465 +1127,196 @@ int mac802154_req_associate(MACHANDLE mac, iob->io_data[iob->io_len++] = priv->dsn++; - /* The Destination PAN Identifier field shall contain the identifier of the - * PAN to which to associate. [1] pg. 68 + /* Use the source address information from the received data request to + * respond. */ - memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.panid, 2); - - /* The Destination Address field shall contain the address from the beacon - * frame that was transmitted by the coordinator to which the association - * request command is being sent. [1] pg. 68 - */ - - if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) - { - memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.saddr, 2); - iob->io_len += 2; - } - else if (priv->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) - { - memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.eaddr[0], - IEEE802154_EADDR_LEN); - iob->io_len += IEEE802154_EADDR_LEN; - } - - /* The Source PAN Identifier field shall contain the broadcast PAN identifier.*/ - - u16 = (uint16_t *)&iob->io_data[iob->io_len]; - *u16 = IEEE802154_SADDR_BCAST; + *((uint16_t *)&iob->io_data[iob->io_len]) = ind->src.panid; iob->io_len += 2; - /* The Source Address field shall contain the value of macExtendedAddress. */ - - memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], - IEEE802154_EADDR_LEN); - iob->io_len += IEEE802154_EADDR_LEN; - - /* Copy in the Command Frame Identifier */ - - iob->io_data[iob->io_len++] = IEEE802154_CMD_ASSOC_REQ; - - /* Copy in the capability information bits */ - - iob->io_data[iob->io_len] = 0; - iob->io_data[iob->io_len] |= (req->capabilities.devtype << - IEEE802154_CAPABILITY_SHIFT_DEVTYPE); - iob->io_data[iob->io_len] |= (req->capabilities.powersource << - IEEE802154_CAPABILITY_SHIFT_PWRSRC); - iob->io_data[iob->io_len] |= (req->capabilities.rxonidle << - IEEE802154_CAPABILITY_SHIFT_RXONIDLE); - iob->io_data[iob->io_len] |= (req->capabilities.security << - IEEE802154_CAPABILITY_SHIFT_SECURITY); - iob->io_data[iob->io_len] |= (req->capabilities.allocaddr << - IEEE802154_CAPABILITY_SHIFT_ALLOCADDR); - - iob->io_len++; - - txdesc->frame = iob; - txdesc->frametype = IEEE802154_FRAME_COMMAND; - - /* We no longer need to have the MAC layer locked. */ - - mac802154_givesem(&priv->exclsem); - - /* Association Request commands get sent out immediately */ - - priv->radio->txdelayed(priv->radio, txdesc, 0); - - return OK; - -errout: - mac802154_givesem(&priv->exclsem); - return ret; -} - -/**************************************************************************** - * Name: mac802154_req_disassociate - * - * Description: - * The MLME-DISASSOCIATE.request primitive is used by an associated device to - * notify the coordinator of its intent to leave the PAN. It is also used by - * the coordinator to instruct an associated device to leave the PAN. - * Confirmation is returned via the - * struct mac802154_maccb_s->conf_disassociate callback. - * - ****************************************************************************/ - -int mac802154_req_disassociate(MACHANDLE mac, - FAR struct ieee802154_disassoc_req_s *req) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_req_gts - * - * Description: - * The MLME-GTS.request primitive allows a device to send a request to the PAN - * coordinator to allocate a new GTS or to deallocate an existing GTS. - * Confirmation is returned via the - * struct mac802154_maccb_s->conf_gts callback. - * - ****************************************************************************/ - -int mac802154_req_gts(MACHANDLE mac, FAR struct ieee802154_gts_req_s *req) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_req_reset - * - * Description: - * The MLME-RESET.request primitive allows the next higher layer to request - * that the MLME performs a reset operation. - * - * NOTE: The standard specifies that confirmation should be provided via - * via the asynchronous MLME-RESET.confirm primitve. However, in our - * implementation we synchronously return the value immediately. Therefore, - * we merge the functionality of the MLME-RESET.request and MLME-RESET.confirm - * primitives together. - * - * Input Parameters: - * mac - Handle to the MAC layer instance - * rst_pibattr - Whether or not to reset the MAC PIB attributes to defaults - * - ****************************************************************************/ - -int mac802154_req_reset(MACHANDLE mac, bool rst_pibattr) -{ - FAR struct ieee802154_privmac_s * priv = - (FAR struct ieee802154_privmac_s *) mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_req_rxenable - * - * Description: - * The MLME-RX-ENABLE.request primitive allows the next higher layer to - * request that the receiver is enable for a finite period of time. - * Confirmation is returned via the - * struct mac802154_maccb_s->conf_rxenable callback. - * - ****************************************************************************/ - -int mac802154_req_rxenable(MACHANDLE mac, - FAR struct ieee802154_rxenable_req_s *req) -{ - FAR struct ieee802154_privmac_s * priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_req_scan - * - * Description: - * The MLME-SCAN.request primitive is used to initiate a channel scan over a - * given list of channels. A device can use a channel scan to measure the - * energy on the channel, search for the coordinator with which it associated, - * or search for all coordinators transmitting beacon frames within the POS of - * the scanning device. Scan results are returned - * via MULTIPLE calls to the struct mac802154_maccb_s->conf_scan callback. - * This is a difference with the official 802.15.4 specification, implemented - * here to save memory. - * - ****************************************************************************/ - -int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_req_get - * - * Description: - * The MLME-GET.request primitive requests information about a given PIB - * attribute. - * - * NOTE: The standard specifies that the attribute value should be returned - * via the asynchronous MLME-GET.confirm primitve. However, in our - * implementation, we synchronously return the value immediately.Therefore, we - * merge the functionality of the MLME-GET.request and MLME-GET.confirm - * primitives together. - * - ****************************************************************************/ - -int mac802154_req_get(MACHANDLE mac, enum ieee802154_pib_attr_e pib_attr, - FAR union ieee802154_attr_u *attrval) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_req_set - * - * Description: - * The MLME-SET.request primitive attempts to write the given value to the - * indicated MAC PIB attribute. - * - * NOTE: The standard specifies that confirmation should be indicated via - * the asynchronous MLME-SET.confirm primitve. However, in our implementation - * we synchronously return the status from the request. Therefore, we do merge - * the functionality of the MLME-SET.request and MLME-SET.confirm primitives - * together. - * - ****************************************************************************/ - -int mac802154_req_set(MACHANDLE mac, enum ieee802154_pib_attr_e pib_attr, - FAR const union ieee802154_attr_u *attrval) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - int ret; - - switch (pib_attr) + if (ind->src.mode == IEEE802154_ADDRMODE_SHORT) { - case IEEE802154_PIB_MAC_EXTENDED_ADDR: - { - /* Set the MAC copy of the address in the table */ - - memcpy(&priv->addr.eaddr[0], &attrval->mac.eaddr[0], - IEEE802154_EADDR_LEN); - - /* Tell the radio about the attribute */ - - priv->radio->set_attr(priv->radio, pib_attr, attrval); - - ret = IEEE802154_STATUS_SUCCESS; - } - break; - default: - { - /* The attribute may be handled soley in the radio driver, so pass - * it along. - */ - - ret = priv->radio->set_attr(priv->radio, pib_attr, attrval); - } - break; + memcpy(&iob->io_data[iob->io_len], &ind->src.saddr, 2); + iob->io_len += 2; } - return ret; -} - -/**************************************************************************** - * Name: mac802154_req_start - * - * Description: - * The MLME-START.request primitive makes a request for the device to start - * using a new superframe configuration. Confirmation is returned - * via the struct mac802154_maccb_s->conf_start callback. - * - ****************************************************************************/ - -int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - int ret; - - /* Get exclusive access to the MAC */ - - ret = mac802154_takesem(&priv->exclsem, true); - if (ret < 0) + else if (ind->src.mode == IEEE802154_ADDRMODE_EXTENDED) { - return ret; - } - - /* When the CoordRealignment parameter is set to TRUE, the coordinator - * attempts to transmit a coordinator realignment command frame as described - * in 5.1.2.3.2. If the transmission of the coordinator realignment command - * fails due to a channel access failure, the MLME will not make any changes - * to the superframe configuration. (i.e., no PIB attributes will be changed). - * If the coordinator realignment command is successfully transmitted, the - * MLME updates the PIB attributes BeaconOrder, SuperframeOrder, PANId, - * ChannelPage, and ChannelNumber parameters. [1] pg. 106 - */ - - if (req->coordrealign) - { - /* TODO: Finish the realignment functionality */ - - return -ENOTTY; - } - - /* Set the PANID attribute */ - - priv->addr.panid = req->panid; - priv->radio->set_attr(priv->radio, IEEE802154_PIB_MAC_PANID, - (FAR const union ieee802154_attr_u *)&req->panid); - - /* Set the radio attributes */ - priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_CHANNEL, - (FAR const union ieee802154_attr_u *)&req->chnum); - - priv->radio->set_attr(priv->radio, IEEE802154_PIB_PHY_CURRENT_PAGE, - (FAR const union ieee802154_attr_u *)&req->chpage); - - /* Set the superframe order */ - - if(req->superframeorder > 15) - { - ret = -EINVAL; - goto errout; - } - - priv->superframeorder = req->superframeorder; - - /* Set the beacon order */ - - if(req->beaconorder > 15) - { - ret = -EINVAL; - goto errout; - } - - priv->beaconorder = req->beaconorder; - - if (req->pancoord) - { - priv->devmode = IEEE802154_DEVMODE_PANCOORD; + memcpy(&iob->io_data[iob->io_len], &ind->src.eaddr, IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; } else { - priv->devmode = IEEE802154_DEVMODE_COORD; + DEBUGASSERT(false); } - /* If the BeaconOrder parameter is less than 15, the MLME sets macBattLifeExt to - * the value of the BatteryLifeExtension parameter. If the BeaconOrder parameter - * equals 15, the value of the BatteryLifeExtension parameter is ignored. - * [1] pg. 106 - */ + /* Set the destination addr mode inside the frame control field */ - if (priv->beaconorder < 15) + *frame_ctrl |= (ind->src.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); + + /* Check if the source PAN ID of the incoming request is the same as ours. */ + + if (ind->src.panid == priv->addr.panid) { - priv->battlifeext = req->battlifeext; + *frame_ctrl |= IEEE802154_FRAMECTRL_PANIDCOMP; + } + else + { + /* Copy in our PAN ID */ - /* TODO: Finish starting beacon enabled network */ - return -ENOTTY; + memcpy(&iob->io_data[iob->io_len], &priv->addr.panid, 2); + iob->io_len += 2; } + /* Copy in our address using the mode that the device used to address us */ + + if (ind->dest.mode == IEEE802154_ADDRMODE_SHORT) + { + memcpy(&iob->io_data[iob->io_len], &priv->addr.saddr, 2); + iob->io_len += 2; + + *frame_ctrl |= (IEEE802154_ADDRMODE_SHORT << IEEE802154_FRAMECTRL_SHIFT_SADDR); + } + else + { + memcpy(&iob->io_data[iob->io_len], &ind->dest.eaddr, IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + *frame_ctrl |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); + } + + /* Allocate the txdesc, waiting if necessary, allow interruptions */ + + mac802154_txdesc_alloc(priv, &txdesc, false); + + txdesc->frame = iob; + txdesc->frametype = IEEE802154_FRAME_DATA; + mac802154_givesem(&priv->exclsem); - return OK; + priv->radio->txdelayed(priv->radio, txdesc, 0); +} -errout: - mac802154_givesem(&priv->exclsem); +/**************************************************************************** + * Name: mac802154_symtoticks + * + * Description: + * Helper function for converting symbols to system clock ticks + * + * Assumptions: + * priv MAC struct is locked when calling. + * + ****************************************************************************/ + +static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, + uint32_t symbols) +{ + union ieee802154_attr_u attrval; + uint32_t ret; + + /* First, get the symbol duration from the radio layer. Symbol duration is + * returned in picoseconds to ensure precision is kept when multiplying to + * get overall times. + */ + + priv->radio->get_attr(priv->radio, IEEE802154_ATTR_PHY_SYMBOL_DURATION, + &attrval); + + /* After this step, ret represents microseconds */ + + ret = ((uint64_t)attrval.phy.symdur_picosec * symbols) / (1000 * 1000); + + /* This method should only be used for things that can be late. For instance, + * it's always okay to wait a little longer before disabling your receiver. + * Therefore, we force the tick count to round up. + */ + + if (ret % USEC_PER_TICK == 0) + { + ret = ret/USEC_PER_TICK; + } + else + { + ret = ret/USEC_PER_TICK; + ret++; + } + return ret; } /**************************************************************************** - * Name: mac802154_req_sync + * Name: mac802154_timerstart * * Description: - * The MLME-SYNC.request primitive requests to synchronize with the - * coordinator by acquiring and, if specified, tracking its beacons. - * Confirmation is returned via the - * struct mac802154_maccb_s->int_commstatus callback. TOCHECK. + * Helper function wrapping the watchdog timer interface. Helps isolate + * different operations from having to worry about work queues and watchdog + * timers. + * + * Assumptions: + * priv MAC struct is locked when calling. * ****************************************************************************/ -int mac802154_req_sync(MACHANDLE mac, FAR struct ieee802154_sync_req_s *req) +int mac802154_timerstart(FAR struct ieee802154_privmac_s *priv, + uint32_t numsymbols, mac802154_worker_t worker) { - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; + /* TODO: Add check to make sure timer is not already being used. I'd like to + * design this so that it absolutely never happens */ + + /* Convert the number of symbols to the number of CPU ticks */ + + uint32_t ticks = mac802154_symtoticks(priv, numsymbols); + + /* Save the function pointer to call if the timeout expires */ + + priv->timeout_worker = worker; + + /* Start the watchdog */ + + wd_start(priv->timeout, (int32_t)ticks, mac802154_timeout_expiry, 1, (uint32_t)priv); + + return OK; } /**************************************************************************** - * Name: mac802154_req_poll + * Function: mac802154_timeout_expiry * * Description: - * The MLME-POLL.request primitive prompts the device to request data from - * the coordinator. Confirmation is returned via the - * struct mac802154_maccb_s->conf_poll callback, followed by a - * struct mac802154_maccb_s->ind_data callback. + * The watchdog timed out. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. * ****************************************************************************/ -int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) +static void mac802154_timeout_expiry(int argc, uint32_t arg, ...) { - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; + FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)arg; + + /* There should never be a case where the timeout is used twice at the same + * time. */ + + DEBUGASSERT(work_available(&priv->timeout_work)); + + /* Check to make sure the function pointer is still valid */ + + DEBUGASSERT(priv->timeout_worker != NULL); + + work_queue(MAC802154_WORK, &priv->timeout_work, (worker_t)priv->timeout_worker, + priv, 0); } /**************************************************************************** - * Name: mac802154_resp_associate - * - * Description: - * The MLME-ASSOCIATE.response primitive is used to initiate a response to - * an MLME-ASSOCIATE.indication primitive. - * + * Public Functions ****************************************************************************/ -int mac802154_resp_associate(MACHANDLE mac, - FAR struct ieee802154_assoc_resp_s *resp) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - /**************************************************************************** - * Name: mac802154_resp_orphan - * - * Description: - * The MLME-ORPHAN.response primitive allows the next higher layer of a - * coordinator to respond to the MLME-ORPHAN.indication primitive. - * - ****************************************************************************/ -int mac802154_resp_orphan(MACHANDLE mac, - FAR struct ieee802154_orphan_resp_s *resp) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - return -ENOTTY; -} - -/**************************************************************************** - * Name: mac802154_notif_free - * - * Description: - * When the MAC calls the registered callback, it passes a reference - * to a mac802154_notify_s structure. This structure needs to be freed - * after the callback handler is done using it. - * - ****************************************************************************/ - -int mac802154_notif_free(MACHANDLE mac, - FAR struct ieee802154_notif_s *notif) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - FAR struct mac802154_notif_s *privnotif = (FAR struct mac802154_notif_s *)notif; - - /* Get exclusive access to the MAC */ - - mac802154_takesem(&priv->exclsem, false); - - privnotif->flink = priv->notif_free; - priv->notif_free = privnotif; - mac802154_givesem(&priv->notif_sem); - - mac802154_givesem(&priv->exclsem); - - return -ENOTTY; -} - -/**************************************************************************** * Name: mac802154_create * * Description: @@ -2907,8 +1373,7 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev) mac->radio = radiodev; - mac802154_defaultmib(mac); - mac802154_applymib(mac); + mac802154_req_reset((MACHANDLE)mac, true); /* Initialize the Radio callbacks */ @@ -2936,34 +1401,8 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev) } memcpy(&mac->addr.eaddr, &eaddr[0], IEEE802154_EADDR_LEN); - mac->radio->set_attr(mac->radio, IEEE802154_PIB_MAC_EXTENDED_ADDR, + mac->radio->set_attr(mac->radio, IEEE802154_ATTR_MAC_EXTENDED_ADDR, (union ieee802154_attr_u *)&eaddr[0]); return (MACHANDLE)mac; } - -/**************************************************************************** - * Name: mac802154_bind - * - * Description: - * Bind the MAC callback table to the MAC state. - * - * Parameters: - * mac - Reference to the MAC driver state structure - * cb - MAC callback operations - * - * Returned Value: - * OK on success; Negated errno on failure. - * - ****************************************************************************/ - -int mac802154_bind(MACHANDLE mac, FAR const struct mac802154_maccb_s *cb) -{ - FAR struct ieee802154_privmac_s *priv = - (FAR struct ieee802154_privmac_s *)mac; - - priv->cb = cb; - return OK; -} - - diff --git a/wireless/ieee802154/mac802154.h b/wireless/ieee802154/mac802154.h index 724b80482c..8eb104d5d3 100644 --- a/wireless/ieee802154/mac802154.h +++ b/wireless/ieee802154/mac802154.h @@ -271,7 +271,7 @@ int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req); * ****************************************************************************/ -int mac802154_req_get(MACHANDLE mac, enum ieee802154_pib_attr_e pib_attr, +int mac802154_req_get(MACHANDLE mac, enum ieee802154_attr_e , FAR union ieee802154_attr_u *attrval); /**************************************************************************** @@ -289,7 +289,7 @@ int mac802154_req_get(MACHANDLE mac, enum ieee802154_pib_attr_e pib_attr, * ****************************************************************************/ -int mac802154_req_set(MACHANDLE mac, enum ieee802154_pib_attr_e pib_attr, +int mac802154_req_set(MACHANDLE mac, enum ieee802154_attr_e , FAR const union ieee802154_attr_u *attrval); /**************************************************************************** diff --git a/wireless/ieee802154/mac802154_assoc.c b/wireless/ieee802154/mac802154_assoc.c new file mode 100644 index 0000000000..0e4eee7238 --- /dev/null +++ b/wireless/ieee802154/mac802154_assoc.c @@ -0,0 +1,949 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_assoc.c + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "mac802154.h" +#include "mac802154_internal.h" +#include "mac802154_assoc.h" + +#include + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void mac802154_timeout_assoc(FAR struct ieee802154_privmac_s *priv); +static FAR struct ieee802154_txdesc_s * + mac802154_assoc_getresp(FAR struct ieee802154_privmac_s *priv); + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_associate + * + * Description: + * The MLME-ASSOCIATE.request primitive allows a device to request an + * association with a coordinator. Confirmation is returned via the + * struct mac802154_maccb_s->conf_associate callback. + * + * On receipt of the MLME-ASSOCIATE.request primitive, the MLME of an + * unassociated device first updates the appropriate PHY and MAC PIB + * attributes, as described in 5.1.3.1, and then generates an association + * request command, as defined in 5.3.1 [1] pg.80 + * + ****************************************************************************/ + +int mac802154_req_associate(MACHANDLE mac, + FAR struct ieee802154_assoc_req_s *req) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + FAR struct ieee802154_txdesc_s *txdesc; + FAR struct iob_s *iob; + FAR uint16_t *u16; + bool rxonidle; + int ret; + + /* Get exlusive access to the operation sempaphore. This must happen before + * getting exclusive access to the MAC struct or else there could be a lockup + * condition. This would occur if another thread is using the cmdtrans but + * needs access to the MAC in order to unlock it. + */ + + ret = mac802154_takesem(&priv->op_sem, true); + if (ret < 0) + { + return ret; + } + + priv->curr_op = MAC802154_OP_ASSOC; + priv->curr_cmd = IEEE802154_CMD_ASSOC_REQ; + + /* Get exclusive access to the MAC */ + + ret = mac802154_takesem(&priv->exclsem, true); + if (ret < 0) + { + mac802154_givesem(&priv->op_sem); + return ret; + } + + /* Set the channel and channel page of the PHY layer */ + + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_CHANNEL, + (FAR const union ieee802154_attr_u *)&req->chnum); + + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_PAGE, + (FAR const union ieee802154_attr_u *)&req->chpage); + + /* Set the PANID attribute */ + + priv->addr.panid = req->coordaddr.panid; + priv->coordaddr.panid = req->coordaddr.panid; + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_PANID, + (FAR const union ieee802154_attr_u *)&req->coordaddr.panid); + + /* Set the coordinator address attributes */ + + priv->coordaddr.mode = req->coordaddr.mode; + + if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + priv->coordaddr.saddr = req->coordaddr.saddr; + memcpy(&priv->coordaddr.eaddr[0], IEEE802154_EADDR_UNSPEC, + IEEE802154_EADDR_LEN); + } + else if (priv->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) + { + priv->coordaddr.saddr = IEEE802154_SADDR_UNSPEC; + memcpy(&priv->coordaddr.eaddr[0], &req->coordaddr.eaddr[0], + IEEE802154_EADDR_LEN); + } + else + { + ret = -EINVAL; + goto errout; + } + + /* Copy in the capabilities information bitfield */ + + priv->devmode = (req->capabilities.devtype) ? + IEEE802154_DEVMODE_COORD : IEEE802154_DEVMODE_ENDPOINT; + + /* Unlike other attributes, we can't simply cast this one since it is a bit + * in a bitfield. Casting it will give us unpredicatble results. Instead + * of creating a ieee802154_attr_u, we use a local bool. Allocating the + * ieee802154_attr_u value would take up more room on the stack since it is + * as large as the largest attribute type. + */ + + rxonidle = req->capabilities.rxonidle; + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_RX_ON_WHEN_IDLE, + (FAR const union ieee802154_attr_u *)&rxonidle); + + /* Allocate an IOB to put the frame in */ + + iob = iob_alloc(false); + DEBUGASSERT(iob != NULL); + + iob->io_flink = NULL; + iob->io_len = 0; + iob->io_offset = 0; + iob->io_pktlen = 0; + + /* Allocate the txdesc, waiting if necessary */ + + ret = mac802154_txdesc_alloc(priv, &txdesc, true); + if (ret < 0) + { + iob_free(iob); + mac802154_givesem(&priv->exclsem); + mac802154_givesem(&priv->op_sem); + return ret; + } + + /* Get a uin16_t reference to the first two bytes. ie frame control field */ + + u16 = (FAR uint16_t *)&iob->io_data[0]; + + *u16 = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); + *u16 |= IEEE802154_FRAMECTRL_ACKREQ; + *u16 |= (priv->coordaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); + *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); + + iob->io_len = 2; + + /* Each time a data or a MAC command frame is generated, the MAC sublayer + * shall copy the value of macDSN into the Sequence Number field of the MHR + * of the outgoing frame and then increment it by one. [1] pg. 40. + */ + + iob->io_data[iob->io_len++] = priv->dsn++; + + /* The Destination PAN Identifier field shall contain the identifier of the + * PAN to which to associate. [1] pg. 68 + */ + + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.panid, 2); + iob->io_len += 2; + + /* The Destination Address field shall contain the address from the beacon + * frame that was transmitted by the coordinator to which the association + * request command is being sent. [1] pg. 68 + */ + + if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.saddr, 2); + iob->io_len += 2; + } + else if (priv->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) + { + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.eaddr[0], + IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + } + + /* The Source PAN Identifier field shall contain the broadcast PAN identifier.*/ + + u16 = (uint16_t *)&iob->io_data[iob->io_len]; + *u16 = IEEE802154_SADDR_BCAST; + iob->io_len += 2; + + /* The Source Address field shall contain the value of macExtendedAddress. */ + + memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], + IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + + /* Copy in the Command Frame Identifier */ + + iob->io_data[iob->io_len++] = IEEE802154_CMD_ASSOC_REQ; + + /* Copy in the capability information bits */ + + iob->io_data[iob->io_len] = 0; + iob->io_data[iob->io_len] |= (req->capabilities.devtype << + IEEE802154_CAPABILITY_SHIFT_DEVTYPE); + iob->io_data[iob->io_len] |= (req->capabilities.powersource << + IEEE802154_CAPABILITY_SHIFT_PWRSRC); + iob->io_data[iob->io_len] |= (req->capabilities.rxonidle << + IEEE802154_CAPABILITY_SHIFT_RXONIDLE); + iob->io_data[iob->io_len] |= (req->capabilities.security << + IEEE802154_CAPABILITY_SHIFT_SECURITY); + iob->io_data[iob->io_len] |= (req->capabilities.allocaddr << + IEEE802154_CAPABILITY_SHIFT_ALLOCADDR); + + iob->io_len++; + + txdesc->frame = iob; + txdesc->frametype = IEEE802154_FRAME_COMMAND; + + /* Save a copy of the destination addressing infromation into the tx descriptor. + * We only do this for commands to help with handling their progession. + */ + + memcpy(&txdesc->destaddr, &req->coordaddr, sizeof(struct ieee802154_addr_s)); + + /* Save a reference of the tx descriptor */ + + priv->cmd_desc = txdesc; + + /* We no longer need to have the MAC layer locked. */ + + mac802154_givesem(&priv->exclsem); + + /* Association Request commands get sent out immediately */ + + priv->radio->txdelayed(priv->radio, txdesc, 0); + + return OK; + +errout: + mac802154_givesem(&priv->exclsem); + return ret; +} + +/**************************************************************************** + * Name: mac802154_resp_associate + * + * Description: + * The MLME-ASSOCIATE.response primitive is used to initiate a response to + * an MLME-ASSOCIATE.indication primitive. + * + ****************************************************************************/ + +int mac802154_resp_associate(MACHANDLE mac, + FAR struct ieee802154_assoc_resp_s *resp) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + FAR struct ieee802154_txdesc_s *txdesc; + FAR struct iob_s *iob; + FAR uint16_t *u16; + int ret; + + /* Allocate an IOB to put the frame in */ + + iob = iob_alloc(false); + DEBUGASSERT(iob != NULL); + + iob->io_flink = NULL; + iob->io_len = 0; + iob->io_offset = 0; + iob->io_pktlen = 0; + + /* Get a uin16_t reference to the first two bytes. ie frame control field */ + + u16 = (FAR uint16_t *)&iob->io_data[0]; + + /* The Destination Addressing Mode and Source Addressing Mode fields shall + * each be set to indicate extended addressing. + * + * The Frame Pending field shall be set to zero and ignored upon reception, + * and the AR field shall be set to one. + * + * The PAN ID Compression field shall be set to one. [1] pg. 69 + */ + + *u16 = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); + *u16 |= IEEE802154_FRAMECTRL_ACKREQ; + *u16 |= IEEE802154_FRAMECTRL_PANIDCOMP; + *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_DADDR); + *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); + + iob->io_len = 2; + + /* Each time a data or a MAC command frame is generated, the MAC sublayer + * shall copy the value of macDSN into the Sequence Number field of the MHR + * of the outgoing frame and then increment it by one. [1] pg. 40. + */ + + iob->io_data[iob->io_len++] = priv->dsn++; + + /* In accordance with this value of the PAN ID Compression field, the + * Destination PAN Identifier field shall contain the value of macPANId, while + * the Source PAN Identifier field shall be omitted. [1] pg. 69 + */ + + memcpy(&iob->io_data[iob->io_len], &priv->addr.panid, 2); + iob->io_len += 2; + + /* The Destination Address field shall contain the extended address of the + * device requesting association. [1] pg. 69 */ + + memcpy(&iob->io_data[iob->io_len], &resp->devaddr[0], IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + + /* The Source Address field shall contain the value of macExtendedAddress. */ + + memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + + /* Copy in the Command Frame Identifier */ + + iob->io_data[iob->io_len++] = IEEE802154_CMD_ASSOC_RESP; + + /* Copy in the assigned short address */ + + memcpy(&iob->io_data[iob->io_len], &resp->assocsaddr, 2); + iob->io_len += 2; + + /* Copy in the association status */ + + iob->io_data[iob->io_len++] = resp->status; + + /* Get exclusive access to the MAC */ + + ret = mac802154_takesem(&priv->exclsem, true); + if (ret < 0) + { + iob_free(iob); + return ret; + } + + /* Allocate the txdesc, waiting if necessary */ + + ret = mac802154_txdesc_alloc(priv, &txdesc, true); + if (ret < 0) + { + iob_free(iob); + mac802154_givesem(&priv->exclsem); + return ret; + } + + txdesc->frame = iob; + txdesc->frametype = IEEE802154_FRAME_COMMAND; + + txdesc->destaddr.panid = priv->addr.panid; + txdesc->destaddr.mode = IEEE802154_ADDRMODE_EXTENDED; + memcpy(&txdesc->destaddr.eaddr[0], &resp->devaddr[0], IEEE802154_EADDR_LEN); + + mac802154_setupindirect(priv, txdesc); + + mac802154_givesem(&priv->exclsem); + + return OK; +} + +/**************************************************************************** + * Internal MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_txdone_assocreq + * + * Description: + * Handle the completion (success/failure) of transmitting an association + * request command. + * + * Assumptions: + * Called with the MAC locked. + * + ****************************************************************************/ + +void mac802154_txdone_assocreq(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) +{ + enum ieee802154_status_e status; + FAR struct mac802154_notif_s *privnotif = + (FAR struct mac802154_notif_s *)txdesc->conf; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; + FAR struct ieee802154_txdesc_s *respdesc; + + if(txdesc->conf->status != IEEE802154_STATUS_SUCCESS) + { + /* if the association request command cannot be sent due to a + * channel access failure, the MAC sublayer shall notify the next + * higher layer. [1] pg. 33 + */ + + /* We can actually high-jack the data conf notification since it + * is allocated as an ieee80215_notif_s anyway. Before we overwrite + * any data though, we need to get the status from the data + * confirmation as that is the method we use to get the reason + * why the tx failed from the radio layer. + */ + + status = txdesc->conf->status; + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + + notif->u.assocconf.status = status; + + /* The short device address allocated by the coordinator on + * successful association. This parameter will be equal to 0xffff + * if the association attempt was unsuccessful. [1] pg. 81 + */ + + notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; + + /* We are now done the operation, unlock the semaphore */ + + priv->curr_op = MAC802154_OP_NONE; + priv->cmd_desc = NULL; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC, call the callback, get exclusive access again */ + + mac802154_givesem(&priv->exclsem); + priv->cb->notify(priv->cb, notif); + mac802154_takesem(&priv->exclsem, false); + } + else + { + /* On receipt of the acknowledgment to the association request + * command, the device shall wait for at most macResponseWaitTime + * for the coordinator to make its association decision; the PIB + * attribute macResponseWaitTime is a network-topology-dependent + * parameter and may be set to match the specific requirements of + * the network that a device is trying to join. If the device is + * tracking the beacon, it shall attempt to extract the association + * response command from the coordinator whenever it is indicated in + * the beacon frame. If the device is not tracking the beacon, it + * shall attempt to extract the association response command from + * the coordinator after macResponseWaitTime. [1] pg. 34 + */ + + if (priv->trackingbeacon) + { + /* We are tracking the beacon, so we should see our address in the + * beacon frame within macResponseWaitTime if the coordinator is going + * to respond. Setup a timeout for macResponseWaitTime so that we + * can inform the next highest layer if the association attempt fails + * due to NO_DATA. + */ + + mac802154_timerstart(priv, + priv->resp_waittime*IEEE802154_BASE_SUPERFRAME_DURATION, + mac802154_timeout_assoc); + } + else + { + /* Send the Data Request MAC command after macResponseWaitTime to + * extract the data from the coordinator. + */ + + respdesc = mac802154_assoc_getresp(priv); + priv->radio->txdelayed(priv->radio, respdesc, + (priv->resp_waittime*IEEE802154_BASE_SUPERFRAME_DURATION)); + } + + /* We can deallocate the data conf notification as it is no longer + * needed. We can't use the public function here since we already + * have the MAC locked. + */ + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + } +} + +/**************************************************************************** + * Name: mac802154_txdone_datareq_assoc + * + * Description: + * Handle the completion (success/failure) of transmitting a data request + * command in an effort to extract the association response from the + * coordinator. + * + * Assumptions: + * Called with the MAC locked. + * + ****************************************************************************/ + +void mac802154_txdone_datareq_assoc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) +{ + enum ieee802154_status_e status; + FAR struct mac802154_notif_s *privnotif = + (FAR struct mac802154_notif_s *)txdesc->conf; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; + + /* If the data request failed to be sent, notify the next layer + * that the association has failed. + * OR + * On receipt of the Ack frame with the Frame Pending field set + * to zero, the device shall conclude that there are no data + * pending at the coordinator. [1] pg. 43 + */ + + if (notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS || + txdesc->framepending == 0) + { + if (notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS) + { + status = notif->u.dataconf.status; + } + else + { + /* If the device does not extract an association response + * command frame from the coordinator within macResponseWaitTime, + * the MLME shall issue the MLME-ASSOCIATE.confirm primitive, + * as described in 6.2.2.4, with a status of NO_DATA, and the + * association attempt shall be deemed a failure. [1] pg. 34 + */ + + status = IEEE802154_STATUS_NO_DATA; + } + + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + notif->u.assocconf.status = status; + + /* The short device address allocated by the coordinator on + * successful association. This parameter will be equal to 0xffff + * if the association attempt was unsuccessful. [1] pg. 81 + */ + + notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; + + /* We are now done the operation, and can release the command */ + + priv->curr_op = MAC802154_OP_NONE; + priv->cmd_desc = NULL; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC, call the callback, get exclusive access again */ + + mac802154_givesem(&priv->exclsem); + priv->cb->notify(priv->cb, notif); + mac802154_takesem(&priv->exclsem, false); + } + else + { + /* On receipt of the acknowledgment frame with the Frame + * Pending field set to one, a device shall enable its + * receiver for at most macMaxFrameTotalWaitTime to receive + * the corresponding data frame from the coordinator. [1] pg.43 + */ + + priv->radio->rxenable(priv->radio, true); + + /* Start a timer, if we receive the data frame, we will cancel + * the timer, otherwise it will expire and we will notify the + * next highest layer of the failure. + */ + + mac802154_timerstart(priv, priv->max_frame_waittime, + mac802154_timeout_assoc); + + /* We can deallocate the data conf notification as it is no longer + * needed. We can't use the public function here since we already + * have the MAC locked. + */ + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + mac802154_givesem(&priv->notif_sem); + } +} + +/**************************************************************************** + * Name: mac802154_rx_assocreq + * + * Description: + * Function called from the generic RX Frame worker to parse and handle the + * reception of an Association Request MAC command frame. + * + ****************************************************************************/ + +void mac802154_rx_assocreq(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind) +{ + FAR struct iob_s *frame = ind->frame; + FAR struct ieee802154_notif_s *notif; + uint8_t cap; + + /* Get exclusive access to the MAC */ + + mac802154_takesem(&priv->exclsem, false); + + /* Allocate a notification to pass to the next highest layer */ + + mac802154_notif_alloc(priv, ¬if, false); + notif->notiftype = IEEE802154_NOTIFY_IND_ASSOC; + + /* Association Requests should always be sent from a device with source + * addressing mode set to extended mode. Throw out any request received + * without addressing set to extended + */ + + if (ind->src.mode != IEEE802154_ADDRMODE_EXTENDED) + { + goto errout_with_sem; + } + + /* Copy the extended address of the requesting device */ + + memcpy(¬if->u.assocind.devaddr[0], &ind->src.eaddr[0], + sizeof(struct ieee802154_addr_s)); + + /* Copy in the capability information from the frame to the notification */ + + cap = frame->io_data[frame->io_offset++]; + notif->u.assocind.capabilities.devtype = + (cap >> IEEE802154_CAPABILITY_SHIFT_DEVTYPE) & 0x01; + notif->u.assocind.capabilities.powersource = + (cap >> IEEE802154_CAPABILITY_SHIFT_PWRSRC) & 0x01; + notif->u.assocind.capabilities.rxonidle = + (cap >> IEEE802154_CAPABILITY_SHIFT_RXONIDLE) & 0x01; + notif->u.assocind.capabilities.security = + (cap >> IEEE802154_CAPABILITY_SHIFT_SECURITY) & 0x01; + notif->u.assocind.capabilities.allocaddr = + (cap >> IEEE802154_CAPABILITY_SHIFT_ALLOCADDR) & 0x01; + +#ifdef CONFIG_IEEE802154_SECURITY +#error Missing security logic +#endif + + /* Unlock the MAC */ + + mac802154_givesem(&priv->exclsem); + + /* Notify the next highest layer of the association status */ + + priv->cb->notify(priv->cb, notif); + + return; + +errout_with_sem: + mac802154_givesem(&priv->exclsem); + return; +} + +/**************************************************************************** + * Name: mac802154_rx_assocresp + * + * Description: + * Function called from the generic RX Frame worker to parse and handle the + * reception of an Association Response MAC command frame. + * + ****************************************************************************/ + +void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind) +{ + FAR struct iob_s *frame = ind->frame; + FAR struct ieee802154_notif_s *notif; + + /* Check if we are performing an Association operation, if not, we will just + * ignore the frame. + */ + + if (priv->curr_op != MAC802154_OP_ASSOC) + { + return; + } + + /* Cancel the timeout used if we didn't get a response */ + + mac802154_timercancel(priv); + + /* Get exclusive access to the MAC */ + + mac802154_takesem(&priv->exclsem, false); + + /* Allocate a notification to pass to the next highest layer */ + + mac802154_notif_alloc(priv, ¬if, false); + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + + /* Parse the short address from the response */ + + priv->addr.saddr = (uint16_t)(frame->io_data[frame->io_offset]); + frame->io_offset += 2; + + /* Inform the radio of the address change */ + + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_SHORT_ADDRESS, + (FAR union ieee802154_attr_u *)&priv->addr.saddr); + + /* A Short Address field value equal to 0xfffe shall indicate that the device + * has been successfully associated with a PAN but has not been allocated a + * short address. In this case, the device shall communicate on the PAN using + * only its extended address. [1] pg. 70 + */ + + if (priv->addr.saddr == IEEE802154_SADDR_BCAST) + { + /* TODO: Figure out if this is sufficient */ + + priv->addr.mode = IEEE802154_ADDRMODE_SHORT; + } + + /* Parse the status from the response */ + + notif->u.assocconf.status = frame->io_data[frame->io_offset++]; + + if (notif->u.assocconf.status == IEEE802154_STATUS_SUCCESS) + { + priv->isassoc = true; + } + else + { + priv->isassoc = false; + } + + notif->u.assocconf.saddr = priv->addr.saddr; + + /* Unlock the MAC */ + + mac802154_givesem(&priv->exclsem); + + /* We are no longer performing the association operation */ + + priv->curr_op = MAC802154_OP_NONE; + priv->cmd_desc = NULL; + mac802154_givesem(&priv->op_sem); + + /* Notify the next highest layer of the association status */ + + priv->cb->notify(priv->cb, notif); +} + +/**************************************************************************** + * Private Function + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_timeout_assoc + * + * Description: + * Function registered with MAC timer that gets called via the work queue to + * handle a timeout for extracting the Association Response from the Coordinator. + * + ****************************************************************************/ + +static void mac802154_timeout_assoc(FAR struct ieee802154_privmac_s *priv) +{ + FAR struct ieee802154_notif_s *notif; + + DEBUGASSERT(priv->curr_op == MAC802154_OP_ASSOC); + + /* If the device does not extract an association response command + * frame from the coordinator within macResponseWaitTime, the MLME + * shall issue the MLME-ASSOCIATE.confirm primitive, as described + * in 6.2.2.4, with a status of NO_DATA, and the association attempt + * shall be deemed a failure. [1] pg. 33 + */ + + /* Allocate a notification struct to pass to the next highest layer. + * Don't allow EINTR to interrupt. + */ + + mac802154_takesem(&priv->exclsem, false); + mac802154_notif_alloc(priv, ¬if, false); + + /* We are no longer performing the association operation */ + priv->curr_op = MAC802154_OP_NONE; + priv->cmd_desc = NULL; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC */ + + mac802154_givesem(&priv->exclsem); + + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; + notif->u.assocconf.status = IEEE802154_STATUS_NO_DATA; + notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; + + priv->cb->notify(priv->cb, notif); +} + +/**************************************************************************** + * Name: mac802154_assoc_getresp + * + * Description: + * Send a data request to the coordinator to extract the association response. + * + * Assumptions: + * MAC is locked when called. + * + * TODO: Can this be used for general data extraction? + * + ****************************************************************************/ + +static FAR struct ieee802154_txdesc_s * + mac802154_assoc_getresp(FAR struct ieee802154_privmac_s *priv) +{ + FAR struct iob_s *iob; + FAR struct ieee802154_txdesc_s *txdesc; + FAR uint16_t *u16; + + /* Allocate an IOB to put the frame in */ + + iob = iob_alloc(false); + DEBUGASSERT(iob != NULL); + + iob->io_flink = NULL; + iob->io_len = 0; + iob->io_offset = 0; + iob->io_pktlen = 0; + + /* Allocate a tx descriptor */ + + mac802154_txdesc_alloc(priv, &txdesc, false); + + priv->curr_cmd = IEEE802154_CMD_DATA_REQ; + + /* Get a uin16_t reference to the first two bytes. ie frame control field */ + + u16 = (FAR uint16_t *)&iob->io_data[0]; + + *u16 = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); + *u16 |= IEEE802154_FRAMECTRL_ACKREQ; + *u16 |= (priv->coordaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); + *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); + + /* If the Destination Addressing Mode field is set to indicate that + * destination addressing information is not present, the PAN ID Compression + * field shall be set to zero and the source PAN identifier shall contain the + * value of macPANId. Otherwise, the PAN ID Compression field shall be set to + * one. In this case and in accordance with the PAN ID Compression field, the + * Destination PAN Identifier field shall contain the value of macPANId, while + * the Source PAN Identifier field shall be omitted. [1] pg. 72 + * + * The destination address for a data request to extract an assoication request + * should never be set to none. So we always set the PAN ID compression field + */ + + DEBUGASSERT(priv->coordaddr.mode != IEEE802154_ADDRMODE_NONE); + + *u16 |= IEEE802154_FRAMECTRL_PANIDCOMP; + + iob->io_len = 2; + + /* Each time a data or a MAC command frame is generated, the MAC sublayer + * shall copy the value of macDSN into the Sequence Number field of the + * MHR of the outgoing frame and then increment it by one. [1] pg. 40. + */ + + iob->io_data[iob->io_len++] = priv->dsn++; + + /* The Destination PAN Identifier field shall contain the identifier of + * the PAN to which to associate. [1] pg. 68 + */ + + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.panid, 2); + iob->io_len += 2; + + /* The Destination Address field shall contain the address from the + * beacon frame that was transmitted by the coordinator to which the + * association request command is being sent. [1] pg. 68 + */ + + if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.saddr, 2); + iob->io_len += 2; + } + else if (priv->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) + { + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.eaddr[0], + IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + } + + /* The Source Address field shall contain the value of macExtendedAddress. */ + + memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], + IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + + /* Copy in the Command Frame Identifier */ + + iob->io_data[iob->io_len++] = IEEE802154_CMD_DATA_REQ; + + /* Copy the IOB reference to the descriptor */ + + txdesc->frame = iob; + + return txdesc; +} diff --git a/wireless/ieee802154/mac802154_assoc.h b/wireless/ieee802154/mac802154_assoc.h new file mode 100644 index 0000000000..e1e7d1d352 --- /dev/null +++ b/wireless/ieee802154/mac802154_assoc.h @@ -0,0 +1,75 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_assoc.h + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * + * Author: Anthony Merlino + * Author: Gregory Nutt + * + * The naming and comments for various fields are taken directly + * from the IEEE 802.15.4 2011 standard. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __WIRELESS_IEEE802154__MAC802154_ASSOC_H +#define __WIRELESS_IEEE802154__MAC802154_ASSOC_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +/**************************************************************************** + * Function Prototypes + ****************************************************************************/ + +struct ieee802154_privmac_s; /* Forward Reference */ + +void mac802154_txdone_assocreq(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc); + +void mac802154_txdone_datareq_assoc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc); + +void mac802154_rx_assocreq(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind); + +void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_data_ind_s *ind); + +#endif /* __WIRELESS_IEEE802154__MAC802154_ASSOC_H */ \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_bind.c b/wireless/ieee802154/mac802154_bind.c new file mode 100644 index 0000000000..c173aef477 --- /dev/null +++ b/wireless/ieee802154/mac802154_bind.c @@ -0,0 +1,80 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_bind.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "mac802154.h" +#include "mac802154_internal.h" + +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_bind + * + * Description: + * Bind the MAC callback table to the MAC state. + * + * Parameters: + * mac - Reference to the MAC driver state structure + * cb - MAC callback operations + * + * Returned Value: + * OK on success; Negated errno on failure. + * + ****************************************************************************/ + +int mac802154_bind(MACHANDLE mac, FAR const struct mac802154_maccb_s *cb) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + + priv->cb = cb; + return OK; +} + diff --git a/wireless/ieee802154/mac802154_data.c b/wireless/ieee802154/mac802154_data.c new file mode 100644 index 0000000000..fb89d1858d --- /dev/null +++ b/wireless/ieee802154/mac802154_data.c @@ -0,0 +1,331 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_data.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include + +#include "mac802154.h" +#include "mac802154_internal.h" +#include "mac802154_data.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_data + * + * Description: + * The MCPS-DATA.request primitive requests the transfer of a data SPDU + * (i.e., MSDU) from a local SSCS entity to a single peer SSCS entity. + * Confirmation is returned via the + * struct mac802154_maccb_s->conf_data callback. + * + ****************************************************************************/ + +int mac802154_req_data(MACHANDLE mac, + FAR const struct ieee802154_frame_meta_s *meta, + FAR struct iob_s *frame) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + FAR struct ieee802154_txdesc_s *txdesc; + uint16_t *frame_ctrl; + uint8_t mhr_len = 3; /* Start assuming frame control and seq. num */ + int ret; + + /* Check the required frame size */ + + if (frame->io_len > IEEE802154_MAX_PHY_PACKET_SIZE) + { + return -E2BIG; + } + + /* Cast the first two bytes of the IOB to a uint16_t frame control field */ + + frame_ctrl = (FAR uint16_t *)&frame->io_data[0]; + + /* Ensure we start with a clear frame control field */ + + *frame_ctrl = 0; + + /* Set the frame type to Data */ + + *frame_ctrl |= IEEE802154_FRAME_DATA << IEEE802154_FRAMECTRL_SHIFT_FTYPE; + + /* If the msduLength is greater than aMaxMACSafePayloadSize, the MAC + * sublayer will set the Frame Version to one. [1] pg. 118. + */ + + if ((frame->io_len - frame->io_offset) > IEEE802154_MAX_SAFE_MAC_PAYLOAD_SIZE) + { + *frame_ctrl |= IEEE802154_FRAMECTRL_VERSION; + } + + /* If the TXOptions parameter specifies that an acknowledged transmission + * is required, the AR field will be set appropriately, as described in + * 5.1.6.4 [1] pg. 118. + */ + + *frame_ctrl |= (meta->msdu_flags.ack_tx << IEEE802154_FRAMECTRL_SHIFT_ACKREQ); + + /* If the destination address is present, copy the PAN ID and one of the + * addresses, depending on mode, into the MHR. + */ + + if (meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) + { + memcpy(&frame->io_data[mhr_len], &meta->destaddr.panid, 2); + mhr_len += 2; + + if (meta->destaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + memcpy(&frame->io_data[mhr_len], &meta->destaddr.saddr, 2); + mhr_len += 2; + } + else if (meta->destaddr.mode == IEEE802154_ADDRMODE_EXTENDED) + { + memcpy(&frame->io_data[mhr_len], &meta->destaddr.eaddr, + IEEE802154_EADDR_LEN); + + mhr_len += IEEE802154_EADDR_LEN; + } + } + + /* Set the destination addr mode inside the frame control field */ + + *frame_ctrl |= (meta->destaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); + + /* From this point on, we need exclusive access to the privmac struct */ + + ret = mac802154_takesem(&priv->exclsem, true); + if (ret < 0) + { + return ret; + } + + /* If both destination and source addressing information is present, the MAC + * sublayer shall compare the destination and source PAN identifiers. + * [1] pg. 41. + */ + + if (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE && + meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) + { + /* If the PAN identifiers are identical, the PAN ID Compression field + * shall be set to one, and the source PAN identifier shall be omitted + * from the transmitted frame. [1] pg. 41. + */ + + if (meta->destaddr.panid == priv->addr.panid) + { + *frame_ctrl |= IEEE802154_FRAMECTRL_PANIDCOMP; + } + } + + if (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE) + { + /* If the destination address is not included, or if PAN ID Compression + * is off, we need to include the Source PAN ID. + */ + + if ((meta->destaddr.mode == IEEE802154_ADDRMODE_NONE) || + (!(*frame_ctrl & IEEE802154_FRAMECTRL_PANIDCOMP))) + { + memcpy(&frame->io_data[mhr_len], &priv->addr.panid, 2); + mhr_len += 2; + } + + if (meta->srcaddr_mode == IEEE802154_ADDRMODE_SHORT) + { + memcpy(&frame->io_data[mhr_len], &priv->addr.saddr, 2); + mhr_len += 2; + } + else if (meta->srcaddr_mode == IEEE802154_ADDRMODE_EXTENDED) + { + memcpy(&frame->io_data[mhr_len], &priv->addr.eaddr, + IEEE802154_EADDR_LEN); + + mhr_len += IEEE802154_EADDR_LEN; + } + } + else + { + /* If this device is not the PAN coordinator, it shouldn't be sending + * frames with a source address mode of NONE + */ + + if (priv->devmode != IEEE802154_DEVMODE_PANCOORD) + { + return -EINVAL; + } + } + + /* Set the source addr mode inside the frame control field */ + + *frame_ctrl |= (meta->srcaddr_mode << IEEE802154_FRAMECTRL_SHIFT_SADDR); + + /* Each time a data or a MAC command frame is generated, the MAC sublayer + * shall copy the value of macDSN into the Sequence Number field of the MHR + * of the outgoing frame and then increment it by one. [1] pg. 40. + */ + + frame->io_data[2] = priv->dsn++; + + /* The MAC header we just created must never have exceeded where the app + * data starts. This should never happen since the offset should have + * been set via the same logic to calculate the header length as the logic + * here that created the header + */ + + DEBUGASSERT(mhr_len == frame->io_offset); + + frame->io_offset = 0; /* Set the offset to 0 to include the header */ + + /* Allocate the txdesc, waiting if necessary, allow interruptions */ + + ret = mac802154_txdesc_alloc(priv, &txdesc, true); + if (ret < 0) + { + return ret; + } + + txdesc->conf->handle = meta->msdu_handle; + txdesc->frame = frame; + txdesc->frametype = IEEE802154_FRAME_DATA; + + /* If the TxOptions parameter specifies that a GTS transmission is required, + * the MAC sublayer will determine whether it has a valid GTS as described + * 5.1.7.3. If a valid GTS could not be found, the MAC sublayer will discard + * the MSDU. If a valid GTS was found, the MAC sublayer will defer, if + * necessary, until the GTS. If the TxOptions parameter specifies that a GTS + * transmission is not required, the MAC sublayer will transmit the MSDU using + * either slotted CSMA-CA in the CAP for a beacon-enabled PAN or unslotted + * CSMA-CA for a nonbeacon-enabled PAN. Specifying a GTS transmission in the + * TxOptions parameter overrides an indirect transmission request. + * [1] pg. 118. + */ + + if (meta->msdu_flags.gts_tx) + { + /* TODO: Support GTS transmission. This should just change where we link + * the transaction. Instead of going in the CSMA transaction list, it + * should be linked to the GTS' transaction list. We'll need to check if + * the GTS is valid, and then find the GTS, before linking. Note, we also + * don't have to try and kick-off any transmission here. + */ + + /* We no longer need to have the MAC layer locked. */ + + mac802154_givesem(&priv->exclsem); + + return -ENOTSUP; + } + else + { + /* If the TxOptions parameter specifies that an indirect transmission is + * required and this primitive is received by the MAC sublayer of a + * coordinator, the data frame is sent using indirect transmission, as + * described in 5.1.5 and 5.1.6.3. [1] + */ + + if (meta->msdu_flags.indirect_tx) + { + /* If the TxOptions parameter specifies that an indirect transmission + * is required and if the device receiving this primitive is not a + * coordinator, the destination address is not present, or the + * TxOptions parameter also specifies a GTS transmission, the indirect + * transmission option will be ignored. [1] + * + * NOTE: We don't just ignore the parameter. Instead, we throw an + * error, since this really shouldn't be happening. + */ + + if (priv->devmode >= IEEE802154_DEVMODE_COORD && + meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) + { + /* Copy in a reference to the destination address to assist in + * searching when data is requested. + */ + + memcpy(&txdesc->destaddr, &meta->destaddr, + sizeof(struct ieee802154_addr_s)); + mac802154_setupindirect(priv, txdesc); + mac802154_givesem(&priv->exclsem); + } + else + { + mac802154_givesem(&priv->exclsem); + return -EINVAL; + } + } + else + { + /* Link the transaction into the CSMA transaction list */ + + sq_addlast((FAR sq_entry_t *)txdesc, &priv->csma_queue); + + /* We no longer need to have the MAC layer locked. */ + + mac802154_givesem(&priv->exclsem); + + /* Notify the radio driver that there is data available */ + + priv->radio->txnotify(priv->radio, false); + } + } + + return OK; +} + +/**************************************************************************** + * Internal MAC Functions + ****************************************************************************/ diff --git a/wireless/ieee802154/mac802154_data.h b/wireless/ieee802154/mac802154_data.h new file mode 100644 index 0000000000..c1514a6e14 --- /dev/null +++ b/wireless/ieee802154/mac802154_data.h @@ -0,0 +1,64 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_data.h + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * + * Author: Anthony Merlino + * Author: Gregory Nutt + * + * The naming and comments for various fields are taken directly + * from the IEEE 802.15.4 2011 standard. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __WIRELESS_IEEE802154__MAC802154_DATA_H +#define __WIRELESS_IEEE802154__MAC802154_DATA_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Function Prototypes + ****************************************************************************/ + +#endif /* __WIRELESS_IEEE802154__MAC802154_DATA_H */ \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_device.c b/wireless/ieee802154/mac802154_device.c index b1bcd749fb..85a52c0051 100644 --- a/wireless/ieee802154/mac802154_device.c +++ b/wireless/ieee802154/mac802154_device.c @@ -600,8 +600,7 @@ static ssize_t mac802154dev_write(FAR struct file *filep, ret = mac802154_req_data(dev->md_mac, &tx->meta, iob); if (ret < 0) { - /* TODO: Should the IOB be freed here? */ - + iob_free(iob); wlerr("ERROR: req_data failed %d\n", ret); return ret; } @@ -699,7 +698,6 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd, /* Free the notification */ mac802154_notif_free(dev->md_mac, notif); - ret = OK; break; } diff --git a/wireless/ieee802154/mac802154_disassoc.c b/wireless/ieee802154/mac802154_disassoc.c new file mode 100644 index 0000000000..ab5a745068 --- /dev/null +++ b/wireless/ieee802154/mac802154_disassoc.c @@ -0,0 +1,79 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_disassoc.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_disassociate + * + * Description: + * The MLME-DISASSOCIATE.request primitive is used by an associated device to + * notify the coordinator of its intent to leave the PAN. It is also used by + * the coordinator to instruct an associated device to leave the PAN. + * Confirmation is returned via the + * struct mac802154_maccb_s->conf_disassociate callback. + * + ****************************************************************************/ + +int mac802154_req_disassociate(MACHANDLE mac, + FAR struct ieee802154_disassoc_req_s *req) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + return -ENOTTY; +} \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_get_mhrlen.c b/wireless/ieee802154/mac802154_get_mhrlen.c new file mode 100644 index 0000000000..608acd8067 --- /dev/null +++ b/wireless/ieee802154/mac802154_get_mhrlen.c @@ -0,0 +1,135 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_get_mhrlen.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" +#include "mac802154_internal.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_get_mhrlen + * + * Description: + * Calculate the MAC header length given the frame meta-data. + * + ****************************************************************************/ + +int mac802154_get_mhrlen(MACHANDLE mac, + FAR const struct ieee802154_frame_meta_s *meta) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + int ret = 3; /* Always frame control (2 bytes) and seq. num (1 byte) */ + + /* Check to make sure both the dest address and the source address are not set + * to NONE */ + + if (meta->destaddr.mode == IEEE802154_ADDRMODE_NONE && + meta->srcaddr_mode == IEEE802154_ADDRMODE_NONE) + { + return -EINVAL; + } + + /* The source address can only be set to NONE if the device is the PAN coord */ + + if (meta->srcaddr_mode == IEEE802154_ADDRMODE_NONE && + priv->devmode != IEEE802154_DEVMODE_PANCOORD) + { + return -EINVAL; + } + + /* Add the destination address length */ + + ret += mac802154_addr_length[meta->destaddr.mode]; + + /* Add the source address length */ + + ret += mac802154_addr_length[ meta->srcaddr_mode]; + + /* If both destination and source addressing information is present, the MAC + * sublayer shall compare the destination and source PAN identifiers. + * [1] pg. 41. + */ + + if (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE && + meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) + { + /* If the PAN identifiers are identical, the PAN ID Compression field + * shall be set to one, and the source PAN identifier shall be omitted + * from the transmitted frame. [1] pg. 41. + */ + + if (meta->destaddr.panid == priv->addr.panid) + { + ret += 2; /* 2 bytes for destination PAN ID */ + return ret; + } + } + + /* If we are here, PAN ID compression is off, so include the dest and source + * PAN ID if the respective address is included + */ + + if (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE) + { + ret += 2; /* 2 bytes for source PAN ID */ + } + + if (meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) + { + ret += 2; /* 2 bytes for destination PAN ID */ + } + + return ret; +} diff --git a/wireless/ieee802154/mac802154_getset.c b/wireless/ieee802154/mac802154_getset.c new file mode 100644 index 0000000000..f32559b9ab --- /dev/null +++ b/wireless/ieee802154/mac802154_getset.c @@ -0,0 +1,181 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_getset.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" +#include "mac802154_internal.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_get + * + * Description: + * The MLME-GET.request primitive requests information about a given PIB + * attribute. + * + * NOTE: The standard specifies that the attribute value should be returned + * via the asynchronous MLME-GET.confirm primitve. However, in our + * implementation, we synchronously return the value immediately.Therefore, we + * merge the functionality of the MLME-GET.request and MLME-GET.confirm + * primitives together. + * + ****************************************************************************/ + +int mac802154_req_get(MACHANDLE mac, enum ieee802154_attr_e attr, + FAR union ieee802154_attr_u *attrval) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + int ret = IEEE802154_STATUS_SUCCESS; + + switch (attr) + { + case IEEE802154_ATTR_MAC_PANID: + attrval->mac.panid = priv->addr.panid; + break; + case IEEE802154_ATTR_MAC_SHORT_ADDRESS: + attrval->mac.saddr = priv->addr.saddr; + break; + case IEEE802154_ATTR_MAC_EXTENDED_ADDR: + memcpy(&attrval->mac.eaddr[0], &priv->addr.eaddr[0], IEEE802154_EADDR_LEN); + break; + case IEEE802154_ATTR_MAC_DEVMODE: + attrval->mac.devmode = priv->devmode; + break; + default: + /* The attribute may be handled soley in the radio driver, so pass + * it along. + */ + + ret = priv->radio->set_attr(priv->radio, attr, attrval); + break; + } + + return ret; +} + +/**************************************************************************** + * Name: mac802154_req_set + * + * Description: + * The MLME-SET.request primitive attempts to write the given value to the + * indicated MAC PIB attribute. + * + * NOTE: The standard specifies that confirmation should be indicated via + * the asynchronous MLME-SET.confirm primitve. However, in our implementation + * we synchronously return the status from the request. Therefore, we do merge + * the functionality of the MLME-SET.request and MLME-SET.confirm primitives + * together. + * + ****************************************************************************/ + +int mac802154_req_set(MACHANDLE mac, enum ieee802154_attr_e attr, + FAR const union ieee802154_attr_u *attrval) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + int ret; + + switch (attr) + { + case IEEE802154_ATTR_MAC_PANID: + { + priv->addr.panid = attrval->mac.panid; + + /* Tell the radio about the attribute */ + + priv->radio->set_attr(priv->radio, attr, attrval); + + ret = IEEE802154_STATUS_SUCCESS; + } + break; + case IEEE802154_ATTR_MAC_SHORT_ADDRESS: + { + priv->addr.saddr = attrval->mac.saddr; + + /* Tell the radio about the attribute */ + + priv->radio->set_attr(priv->radio, attr, attrval); + + ret = IEEE802154_STATUS_SUCCESS; + } + break; + case IEEE802154_ATTR_MAC_EXTENDED_ADDR: + { + /* Set the MAC copy of the address in the table */ + + memcpy(&priv->addr.eaddr[0], &attrval->mac.eaddr[0], + IEEE802154_EADDR_LEN); + + /* Tell the radio about the attribute */ + + priv->radio->set_attr(priv->radio, attr, attrval); + + ret = IEEE802154_STATUS_SUCCESS; + } + break; + default: + { + /* The attribute may be handled soley in the radio driver, so pass + * it along. + */ + + ret = priv->radio->set_attr(priv->radio, attr, attrval); + } + break; + } + return ret; +} \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_gts.c b/wireless/ieee802154/mac802154_gts.c new file mode 100644 index 0000000000..e24e409f81 --- /dev/null +++ b/wireless/ieee802154/mac802154_gts.c @@ -0,0 +1,72 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_gts.c + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_gts + * + * Description: + * The MLME-GTS.request primitive allows a device to send a request to the PAN + * coordinator to allocate a new GTS or to deallocate an existing GTS. + * Confirmation is returned via the + * struct mac802154_maccb_s->conf_gts callback. + * + ****************************************************************************/ + +int mac802154_req_gts(MACHANDLE mac, FAR struct ieee802154_gts_req_s *req) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + return -ENOTTY; +} \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_internal.h b/wireless/ieee802154/mac802154_internal.h new file mode 100644 index 0000000000..0e49c4654d --- /dev/null +++ b/wireless/ieee802154/mac802154_internal.h @@ -0,0 +1,405 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_internal.h + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Anthony Merlino + * + * The naming and comments for various fields are taken directly + * from the IEEE 802.15.4 2011 standard. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __WIRELESS_IEEE802154__MAC802154_INTERNAL_H +#define __WIRELESS_IEEE802154__MAC802154_INTERNAL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "mac802154_notif.h" + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) +#else + + /* Use the low priority work queue if possible */ + +# if defined(CONFIG_MAC802154_HPWORK) +# define MAC802154_WORK HPWORK +# elif defined(CONFIG_MAC802154_LPWORK) +# define MAC802154_WORK LPWORK +# else +# error Neither CONFIG_MAC802154_HPWORK nor CONFIG_MAC802154_LPWORK defined +# endif +#endif + +#if !defined(CONFIG_MAC802154_NNOTIF) || CONFIG_MAC802154_NNOTIF <= 0 +# undef CONFIG_MAC802154_NNOTIF +# define CONFIG_MAC802154_NNOTIF 6 +#endif + +#if !defined(CONFIG_MAC802154_NTXDESC) || CONFIG_MAC802154_NTXDESC <= 0 +# undef CONFIG_MAC802154_NTXDESC +# define CONFIG_MAC802154_NTXDESC 3 +#endif + +#if CONFIG_MAC802154_NTXDESC > CONFIG_MAC802154_NNOTIF +#error CONFIG_MAC802154_NNOTIF must be greater than CONFIG_MAC802154_NTXDESC +#endif + +#if !defined(CONFIG_IEEE802154_DEFAULT_EADDR) +#define CONFIG_IEEE802154_DEFAULT_EADDR 0xFFFFFFFFFFFFFFFF +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Map between ieee802154_addrmode_e enum and actual address length */ + +static const uint8_t mac802154_addr_length[4] = {0, 0, 2, 8}; + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct mac802154_radiocb_s +{ + struct ieee802154_radiocb_s cb; + FAR struct ieee802154_privmac_s *priv; +}; + +/* Enumeration for representing what operation the MAC layer is currently doing. + * There can only be one command being handled at any given time, but certain + * operations such as association requires more than one command to be sent. + * Therefore, the need to track not only what command is currently active, but + * also, what overall operation the command is apart of is necessary. + */ + +enum mac802154_operation_e +{ + MAC802154_OP_NONE, + MAC802154_OP_ASSOC, + MAC802154_OP_POLL +}; + +struct ieee802154_privmac_s; /* Forward Reference */ +typedef void (*mac802154_worker_t)(FAR struct ieee802154_privmac_s *priv); + +/* The privmac structure holds the internal state of the MAC and is the + * underlying represention of the opaque MACHANDLE. It contains storage for + * the IEEE802.15.4 MIB attributes. + */ + +struct ieee802154_privmac_s +{ + FAR struct ieee802154_radio_s *radio; /* Contained IEEE802.15.4 radio dev */ + FAR const struct mac802154_maccb_s *cb; /* Contained MAC callbacks */ + FAR struct mac802154_radiocb_s radiocb; /* Interface to bind to radio */ + + sem_t exclsem; /* Support exclusive access */ + + /* Only support a single command at any given time. As of now I see no + * condition where you need to have more than one command frame simultaneously + */ + + sem_t op_sem; /* Exclusive operations */ + enum mac802154_operation_e curr_op; /* The current overall operation */ + enum ieee802154_cmdid_e curr_cmd; /* Type of the current cmd */ + FAR struct ieee802154_txdesc_s *cmd_desc; /* TX descriptor for current cmd */ + + /* Pre-allocated notifications to be passed to the registered callback. These + * need to be freed by the application using mac802154_xxxxnotif_free when + * the callee layer is finished with it's use. + */ + + FAR struct mac802154_notif_s *notif_free; + struct mac802154_notif_s notif_pool[CONFIG_MAC802154_NNOTIF]; + sem_t notif_sem; + + struct ieee802154_txdesc_s txdesc_pool[CONFIG_IEEE802154_NTXDESC]; + sem_t txdesc_sem; + sq_queue_t txdesc_queue; + sq_queue_t txdone_queue; + + + /* Support a singly linked list of transactions that will be sent using the + * CSMA algorithm. On a non-beacon enabled PAN, these transactions will be + * sent whenever. On a beacon-enabled PAN, these transactions will be sent + * during the CAP of the Coordinator's superframe. + */ + + sq_queue_t csma_queue; + sq_queue_t gts_queue; + + /* Support a singly linked list of transactions that will be sent indirectly. + * This list should only be used by a MAC acting as a coordinator. These + * transactions will stay here until the data is extracted by the destination + * device sending a Data Request MAC command or if too much time passes. This + * list should also be used to populate the address list of the outgoing + * beacon frame. + */ + + sq_queue_t indirect_queue; + + /* Support a singly linked list of frames received */ + + sq_queue_t dataind_queue; + + /* Work structures for offloading aynchronous work */ + + struct work_s tx_work; + struct work_s rx_work; + + struct work_s timeout_work; + WDOG_ID timeout; /* Timeout watchdog */ + mac802154_worker_t timeout_worker; + + struct work_s purge_work; + + /* MAC PIB attributes, grouped to save memory */ + + /* Holds all address information (Extended, Short, and PAN ID) for the MAC. */ + + struct ieee802154_addr_s addr; + + /* Holds all address information (Extended, Short) for Coordinator */ + + struct ieee802154_addr_s coordaddr; + + /* The maximum number of symbols to wait for an acknowledgement frame to + * arrive following a transmitted data frame. [1] pg. 126 + * + * NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't + * sure at the time what the range of reasonable values was. + */ + + uint32_t ack_waitdur; + + /* The maximum time to wait either for a frame intended as a response to a + * data request frame or for a broadcast frame following a beacon with the + * Frame Pending field set to one. [1] pg. 127 + * + * NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't + * sure at the time what the range of reasonable values was. + */ + + uint32_t max_frame_waittime; + + /* The maximum time (in unit periods) that a transaction is stored by a + * coordinator and indicated in its beacon. + */ + + uint16_t trans_persisttime; + + /* Contents of beacon payload */ + + uint8_t beacon_payload[IEEE802154_MAX_BEACON_PAYLOAD_LEN]; + uint8_t beacon_payload_len; /* Length of beacon payload */ + + uint8_t battlifeext_periods; /* # of backoff periods during which rx is + * enabled after the IFS following beacon */ + + uint8_t bsn; /* Seq. num added to tx beacon frame */ + uint8_t dsn; /* Seq. num added to tx data or MAC frame */ + uint8_t maxretries; /* Max # of retries alloed after tx failure */ + + /* The maximum time, in multiples of aBaseSuperframeDuration, a device shall + * wait for a response command frame to be available following a request + * command frame. [1] 128. + */ + + uint8_t resp_waittime; + + /* The total transmit duration (including PHY header and FCS) specified in + * symbols. [1] pg. 129. + */ + + uint32_t tx_totaldur; + + /* Start of 32-bit bitfield */ + + uint32_t trackingbeacon : 1; /* Are we tracking the beacon */ + uint32_t isassoc : 1; /* Are we associated to the PAN */ + uint32_t assocpermit : 1; /* Are we allowing assoc. as a coord. */ + uint32_t autoreq : 1; /* Automatically send data req. if addr + * addr is in the beacon frame */ + + uint32_t battlifeext : 1; /* Is BLE enabled */ + uint32_t gtspermit : 1; /* Is PAN Coord. accepting GTS reqs. */ + uint32_t promisc : 1; /* Is promiscuous mode on? */ + uint32_t rngsupport : 1; /* Does MAC sublayer support ranging */ + uint32_t sec_enabled : 1; /* Does MAC sublayer have security en. */ + uint32_t timestamp_support : 1; /* Does MAC layer supports timestamping */ + + /* 2 available bits */ + + uint32_t beaconorder : 4; /* Freq. that beacon is transmitted */ + + uint32_t superframeorder : 4; /* Length of active portion of outgoing + * superframe, including the beacon */ + + /* The offset, measured is symbols, between the symbol boundary at which the + * MLME captures the timestamp of each transmitted and received frame, and + * the onset of the first symbol past the SFD, namely the first symbol of + * the frames [1] pg. 129. + */ + + uint32_t sync_symboffset : 12; + + /* End of 32-bit bitfield */ + + /* Start of 32-bit bitfield */ + + uint32_t beacon_txtime : 24; /* Time of last beacon transmit */ + uint32_t minbe : 4; /* Min value of backoff exponent (BE) */ + uint32_t maxbe : 4; /* Max value of backoff exponent (BE) */ + + /* End of 32-bit bitfield */ + + /* Start of 32-bit bitfield */ + + uint32_t txctrl_activedur : 17; /* Duration for which tx is permitted to + * be active */ + uint32_t txctrl_pausedur : 1; /* Duration after tx before another tx is + * permitted. 0=2000, 1= 10000 */ + + /* What type of device is this node acting as */ + + enum ieee802154_devmode_e devmode : 2; + + uint32_t max_csmabackoffs : 3; /* Max num backoffs for CSMA algorithm + * before declaring ch access failure */ + + /* 9-bits remaining */ + + /* End of 32-bit bitfield. */ + + /* TODO: Add Security-related MAC PIB attributes */ +}; + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +#define mac802154_givesem(s) sem_post(s); + +static inline int mac802154_takesem(sem_t *sem, bool allowinterrupt) +{ + int ret; + do + { + /* Take a count from the semaphore, possibly waiting */ + + ret = sem_wait(sem); + if (ret < 0) + { + /* EINTR is the only error that we expect */ + + DEBUGASSERT(get_errno() == EINTR); + + if (allowinterrupt) + { + return -EINTR; + } + } + } + while (ret != OK); + + return OK; +} + +static inline void mac802154_txdesc_free(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) +{ + sq_addlast((FAR sq_entry_t *)txdesc, &priv->txdesc_queue); + mac802154_givesem(&priv->txdesc_sem); +} + +/**************************************************************************** + * Name: mac802154_timercancel + * + * Description: + * Cancel timer and remove reference to callback function + * + * Assumptions: + * priv MAC struct is locked when calling. + * + ****************************************************************************/ + +static inline int mac802154_timercancel(FAR struct ieee802154_privmac_s *priv) +{ + wd_cancel(priv->timeout); + priv->timeout_worker = NULL; + return OK; +} + +/**************************************************************************** + * Function Prototypes + ****************************************************************************/ + + +int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s **txdesc, + bool allow_interrupt); + +int mac802154_timerstart(FAR struct ieee802154_privmac_s *priv, + uint32_t numsymbols, mac802154_worker_t); + +void mac802154_setupindirect(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc); + +#endif /* __WIRELESS_IEEE802154__MAC802154_INTERNAL_H */ diff --git a/wireless/ieee802154/mac802154_ioctl.c b/wireless/ieee802154/mac802154_ioctl.c new file mode 100644 index 0000000000..35093f6936 --- /dev/null +++ b/wireless/ieee802154/mac802154_ioctl.c @@ -0,0 +1,169 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_ioctl.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_ioctl + * + * Description: + * Handle MAC and radio IOCTL commands directed to the MAC. + * + * Parameters: + * mac - Reference to the MAC driver state structure + * cmd - The IOCTL command + * arg - The argument for the IOCTL command + * + * Returned Value: + * OK on success; Negated errno on failure. + * + ****************************************************************************/ + +int mac802154_ioctl(MACHANDLE mac, int cmd, unsigned long arg) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + int ret = -EINVAL; + + FAR union ieee802154_macarg_u *macarg = + (FAR union ieee802154_macarg_u *)((uintptr_t)arg); + + DEBUGASSERT(priv != NULL); + + /* Check for IOCTLs aimed at the IEEE802.15.4 MAC layer */ + + if (_MAC802154IOCVALID(cmd)) + { + /* Handle the MAC IOCTL command */ + + switch (cmd) + { + case MAC802154IOC_MLME_ASSOC_REQUEST: + { + ret = mac802154_req_associate(mac, &macarg->assocreq); + } + break; + case MAC802154IOC_MLME_ASSOC_RESPONSE: + { + ret = mac802154_resp_associate(mac, &macarg->assocresp); + } + break; + case MAC802154IOC_MLME_DISASSOC_REQUEST: + { + ret = mac802154_req_disassociate(mac, &macarg->disassocreq); + } + break; + case MAC802154IOC_MLME_GET_REQUEST: + { + ret = mac802154_req_get(mac, macarg->getreq.attr, + &macarg->getreq.attrval); + } + break; + case MAC802154IOC_MLME_GTS_REQUEST: + { + ret = mac802154_req_gts(mac, &macarg->gtsreq); + } + break; + case MAC802154IOC_MLME_ORPHAN_RESPONSE: + { + ret = mac802154_resp_orphan(mac, &macarg->orphanresp); + } + break; + case MAC802154IOC_MLME_RESET_REQUEST: + { + ret = mac802154_req_reset(mac, macarg->resetreq.rst_pibattr); + } + break; + case MAC802154IOC_MLME_RXENABLE_REQUEST: + { + ret = mac802154_req_rxenable(mac, &macarg->rxenabreq); + } + break; + case MAC802154IOC_MLME_SCAN_REQUEST: + { + ret = mac802154_req_scan(mac, &macarg->scanreq); + } + break; + case MAC802154IOC_MLME_SET_REQUEST: + { + ret = mac802154_req_set(mac, macarg->setreq.attr, + &macarg->setreq.attrval); + } + break; + case MAC802154IOC_MLME_START_REQUEST: + { + ret = mac802154_req_start(mac, &macarg->startreq); + } + break; + case MAC802154IOC_MLME_SYNC_REQUEST: + { + ret = mac802154_req_sync(mac, &macarg->syncreq); + } + break; + case MAC802154IOC_MLME_POLL_REQUEST: + { + ret = mac802154_req_poll(mac, &macarg->pollreq); + } + break; + default: + wlerr("ERROR: Unrecognized cmd: %d\n", cmd); + ret = -ENOTTY; + break; + } + } + return ret; +} + diff --git a/wireless/ieee802154/mac802154_notif.c b/wireless/ieee802154/mac802154_notif.c new file mode 100644 index 0000000000..314e6bf5f3 --- /dev/null +++ b/wireless/ieee802154/mac802154_notif.c @@ -0,0 +1,208 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_notif.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" +#include "mac802154_internal.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_notif_free + * + * Description: + * When the MAC calls the registered callback, it passes a reference + * to a mac802154_notify_s structure. This structure needs to be freed + * after the callback handler is done using it. + * + ****************************************************************************/ + +int mac802154_notif_free(MACHANDLE mac, + FAR struct ieee802154_notif_s *notif) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + FAR struct mac802154_notif_s *privnotif = (FAR struct mac802154_notif_s *)notif; + + /* Get exclusive access to the MAC */ + + mac802154_takesem(&priv->exclsem, false); + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + mac802154_givesem(&priv->notif_sem); + + mac802154_givesem(&priv->exclsem); + + return -ENOTTY; +} + +/**************************************************************************** + * Internal MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_notifpool_init + * + * Description: + * This function initializes the notification structure pool. It allows the + * MAC to pass notifications and for the callee to free them when they are + * done using them, saving copying the data when passing. + * + ****************************************************************************/ + +void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv) +{ + FAR struct mac802154_notif_s *pool = priv->notif_pool; + int remaining = CONFIG_MAC802154_NNOTIF; + + priv->notif_free = NULL; + while (remaining > 0) + { + FAR struct mac802154_notif_s *notif = pool; + + /* Add the next meta data structure from the pool to the list of + * general structures. + */ + + notif->flink = priv->notif_free; + priv->notif_free = notif; + + /* Set up for the next structure from the pool */ + + pool++; + remaining--; + } + sem_init(&priv->notif_sem, 0, CONFIG_MAC802154_NNOTIF); +} + +/**************************************************************************** + * Name: mac802154_notif_alloc + * + * Description: + * This function allocates a free notification structure from the free list + * to be used for passing to the registered notify callback. The callee software + * is responsible for freeing the notification structure after it is done using + * it via mac802154_notif_free. + * + * Assumptions: + * priv MAC struct is locked when calling. + * + * Notes: + * If any of the semaphore waits inside this function get interrupted, the + * function will release the MAC layer. If this function returns -EINTR, the + * calling code should NOT release the MAC semaphore. + * + ****************************************************************************/ + +int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_notif_s **notif, + bool allow_interrupt) +{ + int ret; + FAR struct mac802154_notif_s *privnotif; + + /* Try and take a count from the semaphore. If this succeeds, we have + * "reserved" the structure, but still need to unlink it from the free list. + * The MAC is already locked, so there shouldn't be any other conflicting calls + */ + + ret = sem_trywait(&priv->notif_sem); + + if (ret == OK) + { + privnotif = priv->notif_free; + priv->notif_free = privnotif->flink; + } + else + { + /* Unlock MAC so that other work can be done to free a notification */ + + mac802154_givesem(&priv->exclsem); + + /* Take a count from the notification semaphore, waiting if necessary. We + * only return from here with an error if we are allowing interruptions + * and we received a signal */ + + ret = mac802154_takesem(&priv->notif_sem, allow_interrupt); + if (ret < 0) + { + /* MAC sem is already released */ + + return -EINTR; + } + + /* If we've taken a count from the semaphore, we have "reserved" the struct + * but now we need to pop it off of the free list. We need to re-lock the + * MAC in order to ensure this happens correctly. + */ + + ret = mac802154_takesem(&priv->exclsem, allow_interrupt); + if (ret < 0) + { + mac802154_givesem(&priv->notif_sem); + return -EINTR; + } + + /* We can now safely unlink the next free structure from the free list */ + + privnotif = priv->notif_free; + priv->notif_free = privnotif->flink; + } + + *notif = (FAR struct ieee802154_notif_s *)privnotif; + + return OK; +} \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_notif.h b/wireless/ieee802154/mac802154_notif.h new file mode 100644 index 0000000000..3cf088163d --- /dev/null +++ b/wireless/ieee802154/mac802154_notif.h @@ -0,0 +1,82 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_notif.h + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * + * Author: Anthony Merlino + * Author: Gregory Nutt + * + * The naming and comments for various fields are taken directly + * from the IEEE 802.15.4 2011 standard. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __WIRELESS_IEEE802154__MAC802154_NOTIF_H +#define __WIRELESS_IEEE802154__MAC802154_NOTIF_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* Extend the public ieee802154_notif_s to include a private forward link to + * support a list to handle allocation + */ + +struct mac802154_notif_s +{ + struct ieee802154_notif_s pub; + FAR struct mac802154_notif_s *flink; +}; + +/**************************************************************************** + * Function Prototypes + ****************************************************************************/ + +struct ieee802154_privmac_s; /* Forward Reference */ + +void mac802154_notifpool_init(FAR struct ieee802154_privmac_s *priv); + +int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_notif_s **notif, + bool allow_interrupt); + +#endif /* __WIRELESS_IEEE802154__MAC802154_NOTIF_H */ \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_orphan.c b/wireless/ieee802154/mac802154_orphan.c new file mode 100644 index 0000000000..9e4a80d4f2 --- /dev/null +++ b/wireless/ieee802154/mac802154_orphan.c @@ -0,0 +1,71 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_orphan.c + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_resp_orphan + * + * Description: + * The MLME-ORPHAN.response primitive allows the next higher layer of a + * coordinator to respond to the MLME-ORPHAN.indication primitive. + * + ****************************************************************************/ + +int mac802154_resp_orphan(MACHANDLE mac, + FAR struct ieee802154_orphan_resp_s *resp) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + return -ENOTTY; +} diff --git a/wireless/ieee802154/mac802154_poll.c b/wireless/ieee802154/mac802154_poll.c new file mode 100644 index 0000000000..58b6217211 --- /dev/null +++ b/wireless/ieee802154/mac802154_poll.c @@ -0,0 +1,376 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_poll.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include + +#include "mac802154.h" +#include "mac802154_internal.h" + +#include +#include + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void mac802154_timeout_poll(FAR struct ieee802154_privmac_s *priv); + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_poll + * + * Description: + * The MLME-POLL.request primitive prompts the device to request data from + * the coordinator. Confirmation is returned via the + * struct mac802154_maccb_s->conf_poll callback, followed by a + * struct mac802154_maccb_s->ind_data callback. + * + ****************************************************************************/ + +int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + FAR struct iob_s *iob; + FAR struct ieee802154_txdesc_s *txdesc; + FAR uint16_t *frame_ctrl; + int ret; + + /* On receipt of the MLME-POLL.request primitive, the MLME requests data from + * the coordinator, as described in 5.1.6.3. If the poll is directed to the + * PAN coordinator, the data request command may be generated without any + * destination address information present. Otherwise, the data request + * command is always generated with the destination address information in the + * CoordPANId and CoordAddress parameters. + */ + + /* Get exlusive access to the operation sempaphore. This must happen before + * getting exclusive access to the MAC struct or else there could be a lockup + * condition. This would occur if another thread is using the cmdtrans but + * needs access to the MAC in order to unlock it. + */ + + ret = mac802154_takesem(&priv->op_sem, true); + if (ret < 0) + { + return ret; + } + + priv->curr_op = MAC802154_OP_POLL; + priv->curr_cmd = IEEE802154_CMD_DATA_REQ; + + /* Get exclusive access to the MAC */ + + ret = mac802154_takesem(&priv->exclsem, true); + if (ret < 0) + { + mac802154_givesem(&priv->op_sem); + return ret; + } + + /* Allocate an IOB to put the frame in */ + + iob = iob_alloc(false); + DEBUGASSERT(iob != NULL); + + iob->io_flink = NULL; + iob->io_len = 0; + iob->io_offset = 0; + iob->io_pktlen = 0; + + /* Allocate the txdesc, waiting if necessary */ + + ret = mac802154_txdesc_alloc(priv, &txdesc, true); + if (ret < 0) + { + iob_free(iob); + mac802154_givesem(&priv->exclsem); + mac802154_givesem(&priv->op_sem); + return ret; + } + + /* Get a uin16_t reference to the first two bytes. ie frame control field */ + + frame_ctrl = (FAR uint16_t *)&iob->io_data[0]; + iob->io_len = 2; + + *frame_ctrl = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); + *frame_ctrl |= IEEE802154_FRAMECTRL_ACKREQ; + + /* Each time a data or a MAC command frame is generated, the MAC sublayer + * shall copy the value of macDSN into the Sequence Number field of the + * MHR of the outgoing frame and then increment it by one. [1] pg. 40. + */ + + iob->io_data[iob->io_len++] = priv->dsn++; + + /* If the destination address is present, copy the PAN ID and one of the + * addresses, depending on mode, into the MHR. + */ + + if (req->coordaddr.mode != IEEE802154_ADDRMODE_NONE) + { + memcpy(&iob->io_data[iob->io_len], &req->coordaddr.panid, 2); + iob->io_len += 2; + + if (req->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) + { + memcpy(&iob->io_data[iob->io_len], &req->coordaddr.saddr, 2); + iob->io_len += 2; + } + else if (req->coordaddr.mode == IEEE802154_ADDRMODE_EXTENDED) + { + memcpy(&iob->io_data[iob->io_len], &req->coordaddr.eaddr, + IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + } + } + + *frame_ctrl |= (req->coordaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); + + + + /* If the PAN identifiers are identical, the PAN ID Compression field + * shall be set to one, and the source PAN identifier shall be omitted + * from the transmitted frame. [1] pg. 41. + */ + + if (req->coordaddr.mode != IEEE802154_ADDRMODE_NONE && + req->coordaddr.panid == priv->addr.panid) + { + *frame_ctrl |= IEEE802154_FRAMECTRL_PANIDCOMP; + } + else + { + memcpy(&iob->io_data[iob->io_len], &priv->addr.panid, 2); + iob->io_len += 2; + } + + /* The Source Addressing Mode field shall be set according to the value of + * macShortAddress. If macShortAddress is less than 0xfffe, short addressing + * shall be used. Extended addressing shall be used otherwise. + */ + + if (priv->addr.saddr == IEEE802154_SADDR_BCAST) + { + *frame_ctrl |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); + memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], IEEE802154_EADDR_LEN); + iob->io_len += IEEE802154_EADDR_LEN; + } + else + { + *frame_ctrl |= (IEEE802154_ADDRMODE_SHORT << IEEE802154_FRAMECTRL_SHIFT_SADDR); + memcpy(&iob->io_data[iob->io_len], &priv->addr.saddr, 2); + iob->io_len += 2; + } + + /* Copy in the Command Frame Identifier */ + + iob->io_data[iob->io_len++] = IEEE802154_CMD_DATA_REQ; + + /* Copy the IOB reference to the descriptor */ + + txdesc->frame = iob; + txdesc->frametype = IEEE802154_FRAME_COMMAND; + + /* Save a copy of the destination addressing infromation into the tx descriptor. + * We only do this for commands to help with handling their progession. + */ + + memcpy(&txdesc->destaddr, &req->coordaddr, sizeof(struct ieee802154_addr_s)); + + /* Save a reference of the tx descriptor */ + + priv->cmd_desc = txdesc; + + /* Link the transaction into the CSMA transaction list */ + + sq_addlast((FAR sq_entry_t *)txdesc, &priv->csma_queue); + + /* We no longer need to have the MAC layer locked. */ + + mac802154_givesem(&priv->exclsem); + + /* Notify the radio driver that there is data available */ + + priv->radio->txnotify(priv->radio, false); + + return OK; +} + +/**************************************************************************** + * Internal MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_txdone_datareq_poll + * + * Description: + * Handle the completion (success/failure) of transmitting a data request + * command in an effort to extract data from the coordinator triggered by + * a POLL.request from the next highest layer + * + * Assumptions: + * Called with the MAC locked. + * + ****************************************************************************/ + +void mac802154_txdone_datareq_poll(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc) +{ + enum ieee802154_status_e status; + FAR struct mac802154_notif_s *privnotif = + (FAR struct mac802154_notif_s *)txdesc->conf; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; + + /* If the data request failed to be sent, notify the next layer + * that the poll has failed. + * OR + * On receipt of the Ack frame with the Frame Pending field set + * to zero, the device shall conclude that there are no data + * pending at the coordinator. [1] pg. 43 + */ + + if (notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS || + txdesc->framepending == 0) + { + if (notif->u.dataconf.status != IEEE802154_STATUS_SUCCESS) + { + status = notif->u.dataconf.status; + } + else + { + status = IEEE802154_STATUS_NO_DATA; + } + + notif->notiftype = IEEE802154_NOTIFY_CONF_POLL; + notif->u.pollconf.status = status; + + /* We are now done the operation, and can release the command */ + + priv->curr_op = MAC802154_OP_NONE; + priv->cmd_desc = NULL; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC, call the callback, get exclusive access again */ + + mac802154_givesem(&priv->exclsem); + priv->cb->notify(priv->cb, notif); + mac802154_takesem(&priv->exclsem, false); + } + else + { + /* On receipt of the acknowledgment frame with the Frame + * Pending field set to one, a device shall enable its + * receiver for at most macMaxFrameTotalWaitTime to receive + * the corresponding data frame from the coordinator. [1] pg.43 + */ + + priv->radio->rxenable(priv->radio, true); + + /* Start a timer, if we receive the data frame, we will cancel + * the timer, otherwise it will expire and we will notify the + * next highest layer of the failure. + */ + + mac802154_timerstart(priv, priv->max_frame_waittime, + mac802154_timeout_poll); + + /* We can deallocate the data conf notification as it is no longer + * needed. We can't use the public function here since we already + * have the MAC locked. + */ + + privnotif->flink = priv->notif_free; + priv->notif_free = privnotif; + } +} + +/**************************************************************************** + * Name: mac802154_timeout_poll + * + * Description: + * Function registered with MAC timer that gets called via the work queue to + * handle a timeout for extracting a response from the Coordinator. + * + ****************************************************************************/ + +static void mac802154_timeout_poll(FAR struct ieee802154_privmac_s *priv) +{ + FAR struct ieee802154_notif_s *notif; + + DEBUGASSERT(priv->curr_op == MAC802154_OP_POLL); + + /* Allocate a notification struct to pass to the next highest layer. + * Don't allow EINTR to interrupt. + */ + + mac802154_takesem(&priv->exclsem, false); + mac802154_notif_alloc(priv, ¬if, false); + + /* We are no longer performing the association operation */ + priv->curr_op = MAC802154_OP_NONE; + priv->cmd_desc = NULL; + mac802154_givesem(&priv->op_sem); + + /* Release the MAC */ + + mac802154_givesem(&priv->exclsem); + + notif->notiftype = IEEE802154_NOTIFY_CONF_POLL; + notif->u.pollconf.status = IEEE802154_STATUS_NO_DATA; + + priv->cb->notify(priv->cb, notif); +} \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_poll.h b/wireless/ieee802154/mac802154_poll.h new file mode 100644 index 0000000000..ceb393023c --- /dev/null +++ b/wireless/ieee802154/mac802154_poll.h @@ -0,0 +1,66 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_poll.h + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * + * Author: Anthony Merlino + * Author: Gregory Nutt + * + * The naming and comments for various fields are taken directly + * from the IEEE 802.15.4 2011 standard. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __WIRELESS_IEEE802154__MAC802154_POLL_H +#define __WIRELESS_IEEE802154__MAC802154_POLL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +/**************************************************************************** + * Function Prototypes + ****************************************************************************/ + +struct ieee802154_privmac_s; /* Forward Reference */ + +void mac802154_txdone_datareq_poll(FAR struct ieee802154_privmac_s *priv, + FAR struct ieee802154_txdesc_s *txdesc); + +#endif /* __WIRELESS_IEEE802154__MAC802154_POLL_H */ \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_purge.c b/wireless/ieee802154/mac802154_purge.c new file mode 100644 index 0000000000..8249cb5678 --- /dev/null +++ b/wireless/ieee802154/mac802154_purge.c @@ -0,0 +1,83 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_purge.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_purge + * + * Description: + * The MCPS-PURGE.request primitive allows the next higher layer to purge + * an MSDU from the transaction queue. Confirmation is returned via + * the struct mac802154_maccb_s->conf_purge callback. + * + * NOTE: The standard specifies that confirmation should be indicated via + * the asynchronous MLME-PURGE.confirm primitve. However, in our + * implementation we synchronously return the status from the request. + * Therefore, we merge the functionality of the MLME-PURGE.request and + * MLME-PURGE.confirm primitives together. + * + ****************************************************************************/ + +int mac802154_req_purge(MACHANDLE mac, uint8_t msdu_handle) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + return -ENOTTY; +} + diff --git a/wireless/ieee802154/mac802154_reset.c b/wireless/ieee802154/mac802154_reset.c new file mode 100644 index 0000000000..c1115d01db --- /dev/null +++ b/wireless/ieee802154/mac802154_reset.c @@ -0,0 +1,159 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_reset.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" +#include "mac802154_internal.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_reset + * + * Description: + * The MLME-RESET.request primitive allows the next higher layer to request + * that the MLME performs a reset operation. + * + * NOTE: The standard specifies that confirmation should be provided via + * via the asynchronous MLME-RESET.confirm primitve. However, in our + * implementation we synchronously return the value immediately. Therefore, + * we merge the functionality of the MLME-RESET.request and MLME-RESET.confirm + * primitives together. + * + * Input Parameters: + * mac - Handle to the MAC layer instance + * rst_pibattr - Whether or not to reset the MAC PIB attributes to defaults + * + ****************************************************************************/ + +int mac802154_req_reset(MACHANDLE mac, bool rst_pibattr) +{ + FAR struct ieee802154_privmac_s * priv = + (FAR struct ieee802154_privmac_s *) mac; + union ieee802154_attr_u attr; + + if (rst_pibattr) + { + priv->isassoc = false; /* Not associated with a PAN */ + priv->trackingbeacon = false; /* Not tracking beacon by default */ + priv->assocpermit = false; /* Device (if coord) not accepting ssociation */ + priv->autoreq = true; /* Auto send data req if addr. in beacon */ + priv->battlifeext = false; /* BLE disabled */ + priv->beacon_payload_len = 0; /* Beacon payload NULL */ + priv->beaconorder = 15; /* Non-beacon enabled network */ + priv->superframeorder = 15; /* Length of active portion of outgoing SF */ + priv->beacon_txtime = 0; /* Device never sent a beacon */ +#warning Set BSN and DSN to random values! + priv->bsn = 0; + priv->dsn = 0; + priv->gtspermit = true; /* PAN Coord accepting GTS requests */ + priv->minbe = 3; /* Min value of backoff exponent (BE) */ + priv->maxbe = 5; /* Max value of backoff exponent (BE) */ + priv->max_csmabackoffs = 4; /* Max # of backoffs before failure */ + priv->maxretries = 3; /* Max # of retries allowed after failure */ + priv->promisc = false; /* Device not in promiscuous mode */ + priv->rngsupport = false; /* Ranging not yet supported */ + priv->resp_waittime = 32; /* 32 SF durations */ + priv->sec_enabled = false; /* Security disabled by default */ + priv->tx_totaldur = 0; /* 0 transmit duration */ + + priv->trans_persisttime = 0x01F4; + + /* Reset the Coordinator address */ + + priv->coordaddr.mode = IEEE802154_ADDRMODE_NONE; + priv->coordaddr.saddr = IEEE802154_SADDR_UNSPEC; + memcpy(&priv->coordaddr.eaddr[0], IEEE802154_EADDR_UNSPEC, + IEEE802154_EADDR_LEN); + + /* Reset the device's address */ + + priv->addr.mode = IEEE802154_ADDRMODE_NONE; + priv->addr.panid = IEEE802154_PAN_UNSPEC; + priv->addr.saddr = IEEE802154_SADDR_UNSPEC; + memcpy(&priv->addr.eaddr[0], IEEE802154_EADDR_UNSPEC, IEEE802154_EADDR_LEN); + + priv->radio->reset_attrs(priv->radio); + + /* The radio is in control of certain attributes, but we keep a mirror + * for easy access. Copy in the radio's values now that they've been + * reset. + */ + + priv->radio->get_attr(priv->radio, IEEE802154_ATTR_MAC_MAX_FRAME_WAITTIME, + &attr); + priv->max_frame_waittime = attr.mac.max_frame_waittime; + + /* These attributes are effected and determined based on the PHY. Need to + * figure out how to "share" attributes between the radio driver and this + * MAC layer + * + * macAckWaitDuration + * macBattLifeExtPeriods + * macMaxFrameTotalWaitTime + * macLIFSPeriod + * macSIFSPeriod + * macSyncSymbolOffset + * macTimestampSupported + * macTxControlActiveDuration + * macTxControlPauseDuration + * macRxOnWhenIdle + */ + } + + return OK; +} + + diff --git a/wireless/ieee802154/mac802154_rxenable.c b/wireless/ieee802154/mac802154_rxenable.c new file mode 100644 index 0000000000..683d130e75 --- /dev/null +++ b/wireless/ieee802154/mac802154_rxenable.c @@ -0,0 +1,78 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_rxenable.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_rxenable + * + * Description: + * The MLME-RX-ENABLE.request primitive allows the next higher layer to + * request that the receiver is enable for a finite period of time. + * Confirmation is returned via the + * struct mac802154_maccb_s->conf_rxenable callback. + * + ****************************************************************************/ + +int mac802154_req_rxenable(MACHANDLE mac, + FAR struct ieee802154_rxenable_req_s *req) +{ + FAR struct ieee802154_privmac_s * priv = + (FAR struct ieee802154_privmac_s *)mac; + return -ENOTTY; +} \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_scan.c b/wireless/ieee802154/mac802154_scan.c new file mode 100644 index 0000000000..1ba9932288 --- /dev/null +++ b/wireless/ieee802154/mac802154_scan.c @@ -0,0 +1,82 @@ +/**************************************************************************** + * wireless/ieee802154/mac80215_scan.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_scan + * + * Description: + * The MLME-SCAN.request primitive is used to initiate a channel scan over a + * given list of channels. A device can use a channel scan to measure the + * energy on the channel, search for the coordinator with which it associated, + * or search for all coordinators transmitting beacon frames within the POS of + * the scanning device. Scan results are returned + * via MULTIPLE calls to the struct mac802154_maccb_s->conf_scan callback. + * This is a difference with the official 802.15.4 specification, implemented + * here to save memory. + * + ****************************************************************************/ + +int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + return -ENOTTY; +} + diff --git a/wireless/ieee802154/mac802154_start.c b/wireless/ieee802154/mac802154_start.c new file mode 100644 index 0000000000..6b0c051717 --- /dev/null +++ b/wireless/ieee802154/mac802154_start.c @@ -0,0 +1,167 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_start.c + * + * Copyright (C) 2017 Verge Inc. All rights reserved. + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" +#include "mac802154_internal.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_start + * + * Description: + * The MLME-START.request primitive makes a request for the device to start + * using a new superframe configuration. Confirmation is returned + * via the struct mac802154_maccb_s->conf_start callback. + * + ****************************************************************************/ + +int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + int ret; + + /* Get exclusive access to the MAC */ + + ret = mac802154_takesem(&priv->exclsem, true); + if (ret < 0) + { + return ret; + } + + /* When the CoordRealignment parameter is set to TRUE, the coordinator + * attempts to transmit a coordinator realignment command frame as described + * in 5.1.2.3.2. If the transmission of the coordinator realignment command + * fails due to a channel access failure, the MLME will not make any changes + * to the superframe configuration. (i.e., no PIB attributes will be changed). + * If the coordinator realignment command is successfully transmitted, the + * MLME updates the PIB attributes BeaconOrder, SuperframeOrder, PANId, + * ChannelPage, and ChannelNumber parameters. [1] pg. 106 + */ + + if (req->coordrealign) + { + /* TODO: Finish the realignment functionality */ + + return -ENOTTY; + } + + /* Set the PANID attribute */ + + priv->addr.panid = req->panid; + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_PANID, + (FAR const union ieee802154_attr_u *)&req->panid); + + /* Set the radio attributes */ + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_CHANNEL, + (FAR const union ieee802154_attr_u *)&req->chnum); + + priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_PAGE, + (FAR const union ieee802154_attr_u *)&req->chpage); + + + /* Set the beacon order */ + + if(req->beaconorder > 15) + { + ret = -EINVAL; + goto errout; + } + + priv->beaconorder = req->beaconorder; + + /* The value of macSuperframeOrder shall be ignored if macBeaconOrder = 15. pg. 19 */ + + if (priv->beaconorder < 15) + { + /* Set the superframe order */ + + if(req->superframeorder > 15) + { + ret = -EINVAL; + goto errout; + } + + priv->superframeorder = req->superframeorder; + } + + if (req->pancoord) + { + priv->devmode = IEEE802154_DEVMODE_PANCOORD; + } + else + { + priv->devmode = IEEE802154_DEVMODE_COORD; + } + + /* If the BeaconOrder parameter is less than 15, the MLME sets macBattLifeExt to + * the value of the BatteryLifeExtension parameter. If the BeaconOrder parameter + * equals 15, the value of the BatteryLifeExtension parameter is ignored. + * [1] pg. 106 + */ + + if (priv->beaconorder < 15) + { + priv->battlifeext = req->battlifeext; + + /* TODO: Finish starting beacon enabled network */ + return -ENOTTY; + } + + mac802154_givesem(&priv->exclsem); + + return OK; + +errout: + mac802154_givesem(&priv->exclsem); + return ret; +} \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_sync.c b/wireless/ieee802154/mac802154_sync.c new file mode 100644 index 0000000000..fed5e452de --- /dev/null +++ b/wireless/ieee802154/mac802154_sync.c @@ -0,0 +1,78 @@ +/**************************************************************************** + * wireless/ieee802154/mac802154_sync.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017 Verge Inc. All rights reserved. + * + * Author: Sebastien Lorquet + * Author: Gregory Nutt + * Author: Anthony Merlino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "mac802154.h" + +#include + +/**************************************************************************** + * Public MAC Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mac802154_req_sync + * + * Description: + * The MLME-SYNC.request primitive requests to synchronize with the + * coordinator by acquiring and, if specified, tracking its beacons. + * Confirmation is returned via the + * struct mac802154_maccb_s->int_commstatus callback. TOCHECK. + * + ****************************************************************************/ + +int mac802154_req_sync(MACHANDLE mac, FAR struct ieee802154_sync_req_s *req) +{ + FAR struct ieee802154_privmac_s *priv = + (FAR struct ieee802154_privmac_s *)mac; + return -ENOTTY; +} + From 1bb5a74035940a5b35a0800dd17eae6923d0f17b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 10:12:02 -0600 Subject: [PATCH 33/55] configs/.gitignore: Make sure that any .gdbinit, .project, or .cproject files are ignore so that they are less likely to be included in a patch or PR. --- configs/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/.gitignore b/configs/.gitignore index 3d589e9dce..4a8809052b 100644 --- a/configs/.gitignore +++ b/configs/.gitignore @@ -9,6 +9,8 @@ Make.dep .*.swp core .gdbinit +.project +.cproject cscope.out /Make.dep /.depend From 77757410c8e6628902a1904b1ff8fc1fc9265c64 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 10:46:48 -0600 Subject: [PATCH 34/55] Remove dangling white space at the end of lines. --- drivers/wireless/ieee802154/mrf24j40.c | 38 +++--- .../wireless/ieee802154/ieee802154_mac.h | 22 ++-- wireless/ieee802154/mac802154.c | 88 +++++++------- wireless/ieee802154/mac802154.h | 10 +- wireless/ieee802154/mac802154_assoc.c | 110 +++++++++--------- wireless/ieee802154/mac802154_data.c | 4 +- wireless/ieee802154/mac802154_device.c | 36 +++--- wireless/ieee802154/mac802154_get_mhrlen.c | 2 +- wireless/ieee802154/mac802154_getset.c | 12 +- wireless/ieee802154/mac802154_internal.h | 14 +-- wireless/ieee802154/mac802154_notif.c | 16 +-- wireless/ieee802154/mac802154_poll.c | 26 ++--- wireless/ieee802154/mac802154_purge.c | 4 +- wireless/ieee802154/mac802154_start.c | 10 +- 14 files changed, 200 insertions(+), 192 deletions(-) diff --git a/drivers/wireless/ieee802154/mrf24j40.c b/drivers/wireless/ieee802154/mrf24j40.c index 90fd913334..b08524cd4d 100644 --- a/drivers/wireless/ieee802154/mrf24j40.c +++ b/drivers/wireless/ieee802154/mrf24j40.c @@ -103,12 +103,11 @@ #define MRF24J40_GTS_SLOTS 2 -/* - * Formula for calculating default macMaxFrameWaitTime is on pg. 130 - * +/* Formula for calculating default macMaxFrameWaitTime is on pg. 130 + * * For PHYs other than CSS and UWB, the attribute phyMaxFrameDuration is given by: * - * phyMaxFrameDuration = phySHRDuration + + * phyMaxFrameDuration = phySHRDuration + * ceiling([aMaxPHYPacketSize + 1] x phySymbolsPerOctet) * * where ceiling() is a function that returns the smallest integer value greater @@ -335,7 +334,7 @@ static int mrf24j40_txnotify(FAR struct ieee802154_radio_s *radio, bool gts) * * Description: * Transmit a packet without regard to supeframe structure after a certain - * number of symbols. This function is used to send Data Request responses. + * number of symbols. This function is used to send Data Request responses. * It can also be used to send data immediately if the delay is set to 0. * * Parameters: @@ -354,7 +353,7 @@ static int mrf24j40_txdelayed(FAR struct ieee802154_radio_s *radio, { FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; uint8_t reg; - + /* Get exclusive access to the radio device */ if (sem_wait(&dev->exclsem) != 0) @@ -439,21 +438,25 @@ static int mrf24j40_get_attr(FAR struct ieee802154_radio_s *radio, ret = IEEE802154_STATUS_SUCCESS; } break; + case IEEE802154_ATTR_MAC_MAX_FRAME_WAITTIME: { attrval->mac.max_frame_waittime = dev->max_frame_waittime; ret = IEEE802154_STATUS_SUCCESS; } break; + case IEEE802154_ATTR_PHY_SYMBOL_DURATION: { attrval->phy.symdur_picosec = MRF24J40_SYMBOL_DURATION_PS; ret = IEEE802154_STATUS_SUCCESS; } break; + default: ret = IEEE802154_STATUS_UNSUPPORTED_ATTRIBUTE; } + return ret; } @@ -472,32 +475,36 @@ static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, ret = IEEE802154_STATUS_SUCCESS; } break; + case IEEE802154_ATTR_MAC_SHORT_ADDRESS: { mrf24j40_setsaddr(dev, attrval->mac.saddr); ret = IEEE802154_STATUS_SUCCESS; } break; + case IEEE802154_ATTR_MAC_EXTENDED_ADDR: { mrf24j40_seteaddr(dev, &attrval->mac.eaddr[0]); ret = IEEE802154_STATUS_SUCCESS; } break; + case IEEE802154_ATTR_MAC_PROMISCUOUS_MODE: { if (attrval->mac.promisc_mode) { - mrf24j40_setrxmode(dev, MRF24J40_RXMODE_PROMISC); + mrf24j40_setrxmode(dev, MRF24J40_RXMODE_PROMISC); } else { - mrf24j40_setrxmode(dev, MRF24J40_RXMODE_NORMAL); + mrf24j40_setrxmode(dev, MRF24J40_RXMODE_NORMAL); } ret = IEEE802154_STATUS_SUCCESS; } break; + case IEEE802154_ATTR_MAC_RX_ON_WHEN_IDLE: { dev->rxonidle = attrval->mac.rxonidle; @@ -505,6 +512,7 @@ static int mrf24j40_set_attr(FAR struct ieee802154_radio_s *radio, ret = IEEE802154_STATUS_SUCCESS; } break; + default: ret = IEEE802154_STATUS_UNSUPPORTED_ATTRIBUTE; break; @@ -587,7 +595,7 @@ static void mrf24j40_dopoll_csma(FAR void *arg) if (!dev->csma_busy) { len = dev->radiocb->poll(dev->radiocb, false, &dev->csma_desc); - + if (len > 0) { /* Now the txdesc is in use */ @@ -1594,7 +1602,7 @@ static void mrf24j40_irqwork_txnorm(FAR struct mrf24j40_radio_s *dev) * indicates if the failed transmission was due to the channel busy * (CSMA-CA timed out). */ - + if (reg & MRF24J40_TXSTAT_CCAFAIL) { status = IEEE802154_STATUS_CHANNEL_ACCESS_FAILURE; @@ -1608,7 +1616,7 @@ static void mrf24j40_irqwork_txnorm(FAR struct mrf24j40_radio_s *dev) { status = IEEE802154_STATUS_SUCCESS; } - + framepending = (mrf24j40_getreg(dev->spi, MRF24J40_TXNCON) & MRF24J40_TXNCON_FPSTAT); @@ -1853,7 +1861,7 @@ static void mrf24j40_irqworker(FAR void *arg) /* As of now the only use for the MAC timer is for delayed transactions. * Therefore, all we do here is trigger the TX norm FIFO */ - + mrf24j40_norm_trigger(dev); /* Timers are one-shot, so disable the interrupt */ @@ -1890,7 +1898,7 @@ static void mrf24j40_irqworker(FAR void *arg) mrf24j40_irqwork_txgts(dev, 1); } - + /* Unlock the radio device */ sem_post(&dev->exclsem); @@ -2014,8 +2022,8 @@ FAR struct ieee802154_radio_s *mrf24j40_init(FAR struct spi_dev_s *spi, /* For now, we want to always just have the frame pending bit set when * acknowledging a Data Request command. The standard says that the coordinator * can do this if it needs time to figure out whether it has data or not - */ - + */ + mrf24j40_setreg(dev->spi, MRF24J40_ACKTMOUT, 0x39 | MRF24J40_ACKTMOUT_DRPACK); dev->lower->enable(dev->lower, true); diff --git a/include/nuttx/wireless/ieee802154/ieee802154_mac.h b/include/nuttx/wireless/ieee802154/ieee802154_mac.h index ac51825c9a..d9732d4dd5 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_mac.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_mac.h @@ -202,7 +202,7 @@ enum ieee802154_status_e { IEEE802154_STATUS_SUCCESS = 0, IEEE802154_STATUS_FAILURE, /* This value is not outlined in the standard. It - * is a catch-all for any failures that are not + * is a catch-all for any failures that are not * outlined in the standard */ IEEE802154_STATUS_BEACON_LOSS, @@ -228,7 +228,7 @@ enum ieee802154_status_e IEEE802154_STATUS_UNSUPPORTED_ATTRIBUTE, }; -static const char *IEEE802154_STATUS_STRING[] = +static const char *IEEE802154_STATUS_STRING[] = { "Success", "Failure", @@ -414,7 +414,7 @@ struct ieee802154_addr_s enum ieee802154_addrmode_e mode; - uint16_t panid; /* PAN identifier, can be + uint16_t panid; /* PAN identifier, can be * IEEE802154_PAN_UNSPEC */ uint16_t saddr; /* short address */ uint8_t eaddr[IEEE802154_EADDR_LEN]; /* extended address */ @@ -679,13 +679,13 @@ struct ieee802154_data_conf_s * the beginning of the ranging exchange */ - uint32_t rng_counter_start; + uint32_t rng_counter_start; /* A count of the time units corresponding to an RMARKER at the antenna at * end of the ranging exchange */ - uint32_t rng_counter_stop; + uint32_t rng_counter_stop; /* A count of the time units in a message exchange over which the tracking * offset was measured @@ -698,10 +698,10 @@ struct ieee802154_data_conf_s */ uint32_t rng_offset; - - /* The Figure of Merit (FoM) characterizing the ranging measurement */ - uint8_t rng_fom; + /* The Figure of Merit (FoM) characterizing the ranging measurement */ + + uint8_t rng_fom; #endif }; @@ -1250,12 +1250,12 @@ struct ieee802154_get_req_s * Description: * Attempts to write the given value to the indicated PIB attribute. * - * NOTE: The standard specifies that confirmation should be indicated via + * NOTE: The standard specifies that confirmation should be indicated via * the asynchronous MLME-SET.confirm primitve. However, in our implementation * there is no reason not to synchronously return the status immediately. - * Therefore, we do merge the functionality of the MLME-SET.request and + * Therefore, we do merge the functionality of the MLME-SET.request and * MLME-SET.confirm primitives together. - * + * *****************************************************************************/ struct ieee802154_set_req_s diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index 51395e531b..755cdc035e 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -96,7 +96,7 @@ static void mac802154_purge_worker(FAR void *arg); /* Watchdog Timeout Functions */ static void mac802154_timeout_expiry(int argc, uint32_t arg, ...); - + static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, uint32_t symbols); @@ -133,7 +133,7 @@ static void mac802154_resetqueues(FAR struct ieee802154_privmac_s *priv) sem_init(&priv->txdesc_sem, 0, CONFIG_MAC802154_NTXDESC); /* Initialize the notifcation allocation pool */ - + mac802154_notifpool_init(priv); } @@ -169,7 +169,7 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, */ ret = sem_trywait(&priv->txdesc_sem); - + if (ret == OK) { *txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->txdesc_queue); @@ -195,8 +195,8 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, /* If we've taken a count from the semaphore, we have "reserved" the struct * but now we need to pop it off of the free list. We need to re-lock the * MAC in order to ensure this happens correctly. - */ - + */ + ret = mac802154_takesem(&priv->exclsem, allow_interrupt); if (ret < 0) { @@ -205,10 +205,10 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, } /* We can now safely unlink the next free structure from the free list */ - + *txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->txdesc_queue); } - + /* We have now successfully allocated the tx descriptor. Now we need to allocate * the notification for the data confirmation that gets passed along with the * tx descriptor. These are allocated together, but not freed together. @@ -220,7 +220,7 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, /* The mac802154_notif_alloc function follows the same rules as this * function. If it returns -EINTR, the MAC layer is already released */ - + /* We need to free the txdesc */ mac802154_txdesc_free(priv, *txdesc); @@ -228,7 +228,7 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, } (*txdesc)->conf = ¬if->u.dataconf; - + return OK; } @@ -242,7 +242,7 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, * time. * * Assumptions: - * Called with the MAC locked + * Called with the MAC locked * ****************************************************************************/ @@ -267,7 +267,7 @@ void mac802154_setupindirect(FAR struct ieee802154_privmac_s *priv, if (priv->beaconorder < 15) { - symbols = priv->trans_persisttime * + symbols = priv->trans_persisttime * (IEEE802154_BASE_SUPERFRAME_DURATION * (1 << priv->beaconorder)); } else @@ -406,7 +406,7 @@ static int mac802154_poll(FAR const struct ieee802154_radiocb_s *radiocb, { return (*txdesc)->frame->io_len; } - + return 0; } @@ -554,9 +554,9 @@ static void mac802154_txdone_worker(FAR void *arg) default: /* We can deallocate the data conf notification as it is no * longer needed. We can't use the public function here - * since we already have the MAC locked. - */ - + * since we already have the MAC locked. + */ + privnotif->flink = priv->notif_free; priv->notif_free = privnotif; break; @@ -567,9 +567,9 @@ static void mac802154_txdone_worker(FAR void *arg) { /* We can deallocate the data conf notification as it is no longer * needed. We can't use the public function here since we already - * have the MAC locked. - */ - + * have the MAC locked. + */ + privnotif->flink = priv->notif_free; priv->notif_free = privnotif; } @@ -678,7 +678,7 @@ static void mac802154_rxframe_worker(FAR void *arg) frame = ind->frame; - /* Set a local pointer to the frame control then move the offset past + /* Set a local pointer to the frame control then move the offset past * the frame control field */ @@ -716,7 +716,7 @@ static void mac802154_rxframe_worker(FAR void *arg) } else if (ind->dest.mode == IEEE802154_ADDRMODE_EXTENDED) { - memcpy(&ind->dest.eaddr[0], &frame->io_data[frame->io_offset], + memcpy(&ind->dest.eaddr[0], &frame->io_data[frame->io_offset], IEEE802154_EADDR_LEN); frame->io_offset += IEEE802154_EADDR_LEN; } @@ -739,7 +739,7 @@ static void mac802154_rxframe_worker(FAR void *arg) memcpy(&ind->src.panid, &frame->io_data[frame->io_offset], 2); frame->io_offset += 2; } - + if (ind->src.mode == IEEE802154_ADDRMODE_SHORT) { memcpy(&ind->src.saddr, &frame->io_data[frame->io_offset], 2); @@ -747,7 +747,7 @@ static void mac802154_rxframe_worker(FAR void *arg) } else if (ind->src.mode == IEEE802154_ADDRMODE_EXTENDED) { - memcpy(&ind->src.eaddr[0], &frame->io_data[frame->io_offset], + memcpy(&ind->src.eaddr[0], &frame->io_data[frame->io_offset], IEEE802154_EADDR_LEN); frame->io_offset += 8; } @@ -755,7 +755,7 @@ static void mac802154_rxframe_worker(FAR void *arg) ftype = (*frame_ctrl & IEEE802154_FRAMECTRL_FTYPE) >> IEEE802154_FRAMECTRL_SHIFT_FTYPE; - + switch (ftype) { case IEEE802154_FRAME_DATA: @@ -770,9 +770,9 @@ static void mac802154_rxframe_worker(FAR void *arg) * field after the MHR. Consu;me the byte by increasing offset so that * subsequent functions can start from the byte after the command ID. */ - + uint8_t cmdtype = frame->io_data[frame->io_offset++]; - + switch (cmdtype) { case IEEE802154_CMD_ASSOC_REQ: @@ -797,7 +797,7 @@ static void mac802154_rxframe_worker(FAR void *arg) case IEEE802154_CMD_GTS_REQ: break; } - + /* Free the data indication struct from the pool */ ieee802154_ind_free(ind); @@ -818,7 +818,7 @@ static void mac802154_rxframe_worker(FAR void *arg) case IEEE802154_FRAME_ACK: { - /* The radio layer is responsible for handling all ACKs and retries. + /* The radio layer is responsible for handling all ACKs and retries. * If for some reason an ACK gets here, just throw it out. */ @@ -834,7 +834,7 @@ static void mac802154_rxframe_worker(FAR void *arg) * Name: mac802154_rx_dataframe * * Description: - * Function called from the generic RX Frame worker to parse and handle the + * Function called from the generic RX Frame worker to parse and handle the * reception of a data frame. * ****************************************************************************/ @@ -860,14 +860,14 @@ static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, * wouldn't be performing a POLL operation. Meaning: * * If the current operation is POLL, we aren't the PAN coordinator - * so the incoming frame CAN'T + * so the incoming frame CAN'T * * FIXME: Fix documentation */ if (priv->curr_op == MAC802154_OP_POLL || priv->curr_op == MAC802154_OP_ASSOC) { - /* If we are in promiscuous mode, we need to check if the + /* If we are in promiscuous mode, we need to check if the * frame is even for us first. If the address is not ours, * then handle the frame like a normal transaction. */ @@ -922,7 +922,7 @@ static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, /* If we've gotten this far, the frame is our extracted data. Cancel the * timeout */ - + mac802154_timercancel(priv); /* If a frame is received from the coordinator with a zero length payload @@ -931,7 +931,7 @@ static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, */ mac802154_notif_alloc(priv, ¬if, false); - + if (priv->curr_op == MAC802154_OP_POLL) { notif->notiftype = IEEE802154_NOTIFY_CONF_POLL; @@ -941,7 +941,7 @@ static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, ieee802154_ind_free(ind); notif->u.pollconf.status = IEEE802154_STATUS_NO_DATA; } - else + else { notif->u.pollconf.status = IEEE802154_STATUS_SUCCESS; } @@ -951,7 +951,7 @@ static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, /* If we ever receive a data frame back as a response to the * association request, we assume it means there wasn't any data. */ - + notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; notif->u.assocconf.status = IEEE802154_STATUS_NO_DATA; } @@ -961,11 +961,11 @@ static void mac802154_rx_dataframe(FAR struct ieee802154_privmac_s *priv, priv->curr_op = MAC802154_OP_NONE; priv->cmd_desc = NULL; mac802154_givesem(&priv->op_sem); - + /* Release the MAC */ mac802154_givesem(&priv->exclsem); - + priv->cb->notify(priv->cb, notif); /* If there was data, pass it along */ @@ -1004,7 +1004,7 @@ notify_without_lock: * Name: mac802154_rx_datareq * * Description: - * Function called from the generic RX Frame worker to parse and handle the + * Function called from the generic RX Frame worker to parse and handle the * reception of an Data Request MAC command frame. * ****************************************************************************/ @@ -1031,7 +1031,7 @@ static void mac802154_rx_datareq(FAR struct ieee802154_privmac_s *priv, */ txdesc = (FAR struct ieee802154_txdesc_s *)sq_peek(&priv->indirect_queue); - + if (txdesc == NULL) { goto no_data; @@ -1097,10 +1097,10 @@ no_data: */ /* Allocate an IOB to put the frame in */ - + iob = iob_alloc(false); DEBUGASSERT(iob != NULL); - + iob->io_flink = NULL; iob->io_len = 0; iob->io_offset = 0; @@ -1127,7 +1127,7 @@ no_data: iob->io_data[iob->io_len++] = priv->dsn++; - /* Use the source address information from the received data request to + /* Use the source address information from the received data request to * respond. */ @@ -1221,7 +1221,7 @@ static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, &attrval); /* After this step, ret represents microseconds */ - + ret = ((uint64_t)attrval.phy.symdur_picosec * symbols) / (1000 * 1000); /* This method should only be used for things that can be late. For instance, @@ -1238,7 +1238,7 @@ static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, ret = ret/USEC_PER_TICK; ret++; } - + return ret; } @@ -1403,6 +1403,6 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev) memcpy(&mac->addr.eaddr, &eaddr[0], IEEE802154_EADDR_LEN); mac->radio->set_attr(mac->radio, IEEE802154_ATTR_MAC_EXTENDED_ADDR, (union ieee802154_attr_u *)&eaddr[0]); - + return (MACHANDLE)mac; } diff --git a/wireless/ieee802154/mac802154.h b/wireless/ieee802154/mac802154.h index 8eb104d5d3..40d00c9d69 100644 --- a/wireless/ieee802154/mac802154.h +++ b/wireless/ieee802154/mac802154.h @@ -139,7 +139,7 @@ int mac802154_get_mhrlen(MACHANDLE mac, * ****************************************************************************/ -int mac802154_req_data(MACHANDLE mac, +int mac802154_req_data(MACHANDLE mac, FAR const struct ieee802154_frame_meta_s *meta, FAR struct iob_s *frame); @@ -151,10 +151,10 @@ int mac802154_req_data(MACHANDLE mac, * an MSDU from the transaction queue. Confirmation is returned via * the struct mac802154_maccb_s->conf_purge callback. * - * NOTE: The standard specifies that confirmation should be indicated via + * NOTE: The standard specifies that confirmation should be indicated via * the asynchronous MLME-PURGE.confirm primitve. However, in our * implementation we synchronously return the status from the request. - * Therefore, we merge the functionality of the MLME-PURGE.request and + * Therefore, we merge the functionality of the MLME-PURGE.request and * MLME-PURGE.confirm primitives together. * ****************************************************************************/ @@ -279,9 +279,9 @@ int mac802154_req_get(MACHANDLE mac, enum ieee802154_attr_e , * * Description: * The MLME-SET.request primitive attempts to write the given value to the - * indicated MAC PIB attribute. + * indicated MAC PIB attribute. * - * NOTE: The standard specifies that confirmation should be indicated via + * NOTE: The standard specifies that confirmation should be indicated via * the asynchronous MLME-SET.confirm primitve. However, in our implementation * we synchronously return the status from the request. Therefore, we do merge * the functionality of the MLME-SET.request and MLME-SET.confirm primitives diff --git a/wireless/ieee802154/mac802154_assoc.c b/wireless/ieee802154/mac802154_assoc.c index 0e4eee7238..d0d77302a2 100644 --- a/wireless/ieee802154/mac802154_assoc.c +++ b/wireless/ieee802154/mac802154_assoc.c @@ -108,7 +108,7 @@ int mac802154_req_associate(MACHANDLE mac, priv->curr_cmd = IEEE802154_CMD_ASSOC_REQ; /* Get exclusive access to the MAC */ - + ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { @@ -155,7 +155,7 @@ int mac802154_req_associate(MACHANDLE mac, /* Copy in the capabilities information bitfield */ - priv->devmode = (req->capabilities.devtype) ? + priv->devmode = (req->capabilities.devtype) ? IEEE802154_DEVMODE_COORD : IEEE802154_DEVMODE_ENDPOINT; /* Unlike other attributes, we can't simply cast this one since it is a bit @@ -167,8 +167,8 @@ int mac802154_req_associate(MACHANDLE mac, rxonidle = req->capabilities.rxonidle; priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_RX_ON_WHEN_IDLE, - (FAR const union ieee802154_attr_u *)&rxonidle); - + (FAR const union ieee802154_attr_u *)&rxonidle); + /* Allocate an IOB to put the frame in */ iob = iob_alloc(false); @@ -231,8 +231,8 @@ int mac802154_req_associate(MACHANDLE mac, IEEE802154_EADDR_LEN); iob->io_len += IEEE802154_EADDR_LEN; } - - /* The Source PAN Identifier field shall contain the broadcast PAN identifier.*/ + + /* The Source PAN Identifier field shall contain the broadcast PAN identifier.*/ u16 = (uint16_t *)&iob->io_data[iob->io_len]; *u16 = IEEE802154_SADDR_BCAST; @@ -249,19 +249,19 @@ int mac802154_req_associate(MACHANDLE mac, iob->io_data[iob->io_len++] = IEEE802154_CMD_ASSOC_REQ; /* Copy in the capability information bits */ - + iob->io_data[iob->io_len] = 0; - iob->io_data[iob->io_len] |= (req->capabilities.devtype << + iob->io_data[iob->io_len] |= (req->capabilities.devtype << IEEE802154_CAPABILITY_SHIFT_DEVTYPE); - iob->io_data[iob->io_len] |= (req->capabilities.powersource << + iob->io_data[iob->io_len] |= (req->capabilities.powersource << IEEE802154_CAPABILITY_SHIFT_PWRSRC); - iob->io_data[iob->io_len] |= (req->capabilities.rxonidle << + iob->io_data[iob->io_len] |= (req->capabilities.rxonidle << IEEE802154_CAPABILITY_SHIFT_RXONIDLE); - iob->io_data[iob->io_len] |= (req->capabilities.security << + iob->io_data[iob->io_len] |= (req->capabilities.security << IEEE802154_CAPABILITY_SHIFT_SECURITY); - iob->io_data[iob->io_len] |= (req->capabilities.allocaddr << + iob->io_data[iob->io_len] |= (req->capabilities.allocaddr << IEEE802154_CAPABILITY_SHIFT_ALLOCADDR); - + iob->io_len++; txdesc->frame = iob; @@ -272,7 +272,7 @@ int mac802154_req_associate(MACHANDLE mac, */ memcpy(&txdesc->destaddr, &req->coordaddr, sizeof(struct ieee802154_addr_s)); - + /* Save a reference of the tx descriptor */ priv->cmd_desc = txdesc; @@ -310,7 +310,7 @@ int mac802154_resp_associate(MACHANDLE mac, FAR struct iob_s *iob; FAR uint16_t *u16; int ret; - + /* Allocate an IOB to put the frame in */ iob = iob_alloc(false); @@ -352,14 +352,14 @@ int mac802154_resp_associate(MACHANDLE mac, /* In accordance with this value of the PAN ID Compression field, the * Destination PAN Identifier field shall contain the value of macPANId, while * the Source PAN Identifier field shall be omitted. [1] pg. 69 - */ + */ memcpy(&iob->io_data[iob->io_len], &priv->addr.panid, 2); iob->io_len += 2; /* The Destination Address field shall contain the extended address of the * device requesting association. [1] pg. 69 */ - + memcpy(&iob->io_data[iob->io_len], &resp->devaddr[0], IEEE802154_EADDR_LEN); iob->io_len += IEEE802154_EADDR_LEN; @@ -382,7 +382,7 @@ int mac802154_resp_associate(MACHANDLE mac, iob->io_data[iob->io_len++] = resp->status; /* Get exclusive access to the MAC */ - + ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { @@ -436,7 +436,7 @@ void mac802154_txdone_assocreq(FAR struct ieee802154_privmac_s *priv, enum ieee802154_status_e status; FAR struct mac802154_notif_s *privnotif = (FAR struct mac802154_notif_s *)txdesc->conf; - FAR struct ieee802154_notif_s *notif = &privnotif->pub; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; FAR struct ieee802154_txdesc_s *respdesc; if(txdesc->conf->status != IEEE802154_STATUS_SUCCESS) @@ -445,7 +445,7 @@ void mac802154_txdone_assocreq(FAR struct ieee802154_privmac_s *priv, * channel access failure, the MAC sublayer shall notify the next * higher layer. [1] pg. 33 */ - + /* We can actually high-jack the data conf notification since it * is allocated as an ieee80215_notif_s anyway. Before we overwrite * any data though, we need to get the status from the data @@ -500,7 +500,7 @@ void mac802154_txdone_assocreq(FAR struct ieee802154_privmac_s *priv, * can inform the next highest layer if the association attempt fails * due to NO_DATA. */ - + mac802154_timerstart(priv, priv->resp_waittime*IEEE802154_BASE_SUPERFRAME_DURATION, mac802154_timeout_assoc); @@ -518,9 +518,9 @@ void mac802154_txdone_assocreq(FAR struct ieee802154_privmac_s *priv, /* We can deallocate the data conf notification as it is no longer * needed. We can't use the public function here since we already - * have the MAC locked. - */ - + * have the MAC locked. + */ + privnotif->flink = priv->notif_free; priv->notif_free = privnotif; } @@ -545,7 +545,7 @@ void mac802154_txdone_datareq_assoc(FAR struct ieee802154_privmac_s *priv, enum ieee802154_status_e status; FAR struct mac802154_notif_s *privnotif = (FAR struct mac802154_notif_s *)txdesc->conf; - FAR struct ieee802154_notif_s *notif = &privnotif->pub; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; /* If the data request failed to be sent, notify the next layer * that the association has failed. @@ -610,14 +610,14 @@ void mac802154_txdone_datareq_assoc(FAR struct ieee802154_privmac_s *priv, * the timer, otherwise it will expire and we will notify the * next highest layer of the failure. */ - + mac802154_timerstart(priv, priv->max_frame_waittime, mac802154_timeout_assoc); /* We can deallocate the data conf notification as it is no longer * needed. We can't use the public function here since we already - * have the MAC locked. - */ + * have the MAC locked. + */ privnotif->flink = priv->notif_free; priv->notif_free = privnotif; @@ -629,7 +629,7 @@ void mac802154_txdone_datareq_assoc(FAR struct ieee802154_privmac_s *priv, * Name: mac802154_rx_assocreq * * Description: - * Function called from the generic RX Frame worker to parse and handle the + * Function called from the generic RX Frame worker to parse and handle the * reception of an Association Request MAC command frame. * ****************************************************************************/ @@ -654,7 +654,7 @@ void mac802154_rx_assocreq(FAR struct ieee802154_privmac_s *priv, * addressing mode set to extended mode. Throw out any request received * without addressing set to extended */ - + if (ind->src.mode != IEEE802154_ADDRMODE_EXTENDED) { goto errout_with_sem; @@ -664,7 +664,7 @@ void mac802154_rx_assocreq(FAR struct ieee802154_privmac_s *priv, memcpy(¬if->u.assocind.devaddr[0], &ind->src.eaddr[0], sizeof(struct ieee802154_addr_s)); - + /* Copy in the capability information from the frame to the notification */ cap = frame->io_data[frame->io_offset++]; @@ -702,7 +702,7 @@ errout_with_sem: * Name: mac802154_rx_assocresp * * Description: - * Function called from the generic RX Frame worker to parse and handle the + * Function called from the generic RX Frame worker to parse and handle the * reception of an Association Response MAC command frame. * ****************************************************************************/ @@ -721,7 +721,7 @@ void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, { return; } - + /* Cancel the timeout used if we didn't get a response */ mac802154_timercancel(priv); @@ -744,7 +744,7 @@ void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_SHORT_ADDRESS, (FAR union ieee802154_attr_u *)&priv->addr.saddr); - + /* A Short Address field value equal to 0xfffe shall indicate that the device * has been successfully associated with a PAN but has not been allocated a * short address. In this case, the device shall communicate on the PAN using @@ -757,7 +757,7 @@ void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv, priv->addr.mode = IEEE802154_ADDRMODE_SHORT; } - + /* Parse the status from the response */ notif->u.assocconf.status = frame->io_data[frame->io_offset++]; @@ -813,7 +813,7 @@ static void mac802154_timeout_assoc(FAR struct ieee802154_privmac_s *priv) * in 6.2.2.4, with a status of NO_DATA, and the association attempt * shall be deemed a failure. [1] pg. 33 */ - + /* Allocate a notification struct to pass to the next highest layer. * Don't allow EINTR to interrupt. */ @@ -833,7 +833,7 @@ static void mac802154_timeout_assoc(FAR struct ieee802154_privmac_s *priv) notif->notiftype = IEEE802154_NOTIFY_CONF_ASSOC; notif->u.assocconf.status = IEEE802154_STATUS_NO_DATA; notif->u.assocconf.saddr = IEEE802154_SADDR_UNSPEC; - + priv->cb->notify(priv->cb, notif); } @@ -844,7 +844,7 @@ static void mac802154_timeout_assoc(FAR struct ieee802154_privmac_s *priv) * Send a data request to the coordinator to extract the association response. * * Assumptions: - * MAC is locked when called. + * MAC is locked when called. * * TODO: Can this be used for general data extraction? * @@ -858,30 +858,30 @@ static FAR struct ieee802154_txdesc_s * FAR uint16_t *u16; /* Allocate an IOB to put the frame in */ - + iob = iob_alloc(false); DEBUGASSERT(iob != NULL); - + iob->io_flink = NULL; iob->io_len = 0; iob->io_offset = 0; iob->io_pktlen = 0; - /* Allocate a tx descriptor */ + /* Allocate a tx descriptor */ mac802154_txdesc_alloc(priv, &txdesc, false); priv->curr_cmd = IEEE802154_CMD_DATA_REQ; /* Get a uin16_t reference to the first two bytes. ie frame control field */ - + u16 = (FAR uint16_t *)&iob->io_data[0]; - + *u16 = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); *u16 |= IEEE802154_FRAMECTRL_ACKREQ; *u16 |= (priv->coordaddr.mode << IEEE802154_FRAMECTRL_SHIFT_DADDR); *u16 |= (IEEE802154_ADDRMODE_EXTENDED << IEEE802154_FRAMECTRL_SHIFT_SADDR); - + /* If the Destination Addressing Mode field is set to indicate that * destination addressing information is not present, the PAN ID Compression * field shall be set to zero and the source PAN identifier shall contain the @@ -893,32 +893,32 @@ static FAR struct ieee802154_txdesc_s * * The destination address for a data request to extract an assoication request * should never be set to none. So we always set the PAN ID compression field */ - + DEBUGASSERT(priv->coordaddr.mode != IEEE802154_ADDRMODE_NONE); - + *u16 |= IEEE802154_FRAMECTRL_PANIDCOMP; - + iob->io_len = 2; - + /* Each time a data or a MAC command frame is generated, the MAC sublayer * shall copy the value of macDSN into the Sequence Number field of the * MHR of the outgoing frame and then increment it by one. [1] pg. 40. */ - + iob->io_data[iob->io_len++] = priv->dsn++; - + /* The Destination PAN Identifier field shall contain the identifier of * the PAN to which to associate. [1] pg. 68 */ - + memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.panid, 2); iob->io_len += 2; - + /* The Destination Address field shall contain the address from the * beacon frame that was transmitted by the coordinator to which the * association request command is being sent. [1] pg. 68 */ - + if (priv->coordaddr.mode == IEEE802154_ADDRMODE_SHORT) { memcpy(&iob->io_data[iob->io_len], &priv->coordaddr.saddr, 2); @@ -930,9 +930,9 @@ static FAR struct ieee802154_txdesc_s * IEEE802154_EADDR_LEN); iob->io_len += IEEE802154_EADDR_LEN; } - + /* The Source Address field shall contain the value of macExtendedAddress. */ - + memcpy(&iob->io_data[iob->io_len], &priv->addr.eaddr[0], IEEE802154_EADDR_LEN); iob->io_len += IEEE802154_EADDR_LEN; diff --git a/wireless/ieee802154/mac802154_data.c b/wireless/ieee802154/mac802154_data.c index fb89d1858d..34e3eabd50 100644 --- a/wireless/ieee802154/mac802154_data.c +++ b/wireless/ieee802154/mac802154_data.c @@ -71,7 +71,7 @@ * ****************************************************************************/ -int mac802154_req_data(MACHANDLE mac, +int mac802154_req_data(MACHANDLE mac, FAR const struct ieee802154_frame_meta_s *meta, FAR struct iob_s *frame) { @@ -289,7 +289,7 @@ int mac802154_req_data(MACHANDLE mac, * error, since this really shouldn't be happening. */ - if (priv->devmode >= IEEE802154_DEVMODE_COORD && + if (priv->devmode >= IEEE802154_DEVMODE_COORD && meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) { /* Copy in a reference to the destination address to assist in diff --git a/wireless/ieee802154/mac802154_device.c b/wireless/ieee802154/mac802154_device.c index 85a52c0051..b03ce94ba8 100644 --- a/wireless/ieee802154/mac802154_device.c +++ b/wireless/ieee802154/mac802154_device.c @@ -115,7 +115,7 @@ struct mac802154_chardevice_s bool readpending; /* Is there a read using the semaphore? */ sem_t readsem; /* Signaling semaphore for waiting read */ - sq_queue_t dataind_queue; + sq_queue_t dataind_queue; #ifndef CONFIG_DISABLE_SIGNALS /* MAC Service notification information */ @@ -254,7 +254,7 @@ static inline FAR struct ieee802154_notif_s * { dev->event_head = NULL; } - + notif->flink = NULL; } @@ -406,7 +406,7 @@ static int mac802154dev_close(FAR struct file *filep) /* If there are now no open instances of the driver and a signal handler is * not registered, purge the list of events. */ - + if (dev->md_open) { FAR struct ieee802154_notif_s *notif; @@ -474,7 +474,7 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer, /* Try popping a data indication off the list */ ind = (FAR struct ieee802154_data_ind_s *)sq_remfirst(&dev->dataind_queue); - + /* If the indication is not null, we can exit the loop and copy the data */ if (ind != NULL) @@ -483,8 +483,8 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer, break; } - /* If this is a non-blocking call, or if there is another read operation - * already pending, don't block. This driver returns EAGAIN even when + /* If this is a non-blocking call, or if there is another read operation + * already pending, don't block. This driver returns EAGAIN even when * configured as non-blocking if another read operation is already pending * This situation should be rare. It will only occur when there are 2 calls * to read from separate threads and there was no data in the rx list. @@ -500,7 +500,7 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer, mac802154dev_givesem(&dev->md_exclsem); /* Wait to be signaled when a frame is added to the list */ - + if (sem_wait(&dev->readsem) < 0) { DEBUGASSERT(errno == EINTR); @@ -512,18 +512,18 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer, * time, it should have a data indication */ } - + rx->length = (ind->frame->io_len - ind->frame->io_offset); /* Copy the data from the IOB to the user supplied struct */ memcpy(&rx->payload[0], &ind->frame->io_data[ind->frame->io_offset], - rx->length); + rx->length); memcpy(&rx->meta, ind, sizeof(struct ieee802154_data_ind_s)); /* Zero out the forward link and IOB reference */ - + rx->meta.flink = NULL; rx->meta.frame = NULL; @@ -701,7 +701,7 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd, ret = OK; break; } - + /* If this is a non-blocking call, or if there is another getevent * operation already pending, don't block. This driver returns * EAGAIN even when configured as non-blocking if another getevent @@ -741,7 +741,7 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd, } } break; - + case MAC802154IOC_ENABLE_EVENTS: { dev->enableevents = (bool)arg; @@ -752,7 +752,7 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd, default: { /* Forward any unrecognized commands to the MAC layer */ - + ret = mac802154_ioctl(dev->md_mac, cmd, arg); } break; @@ -783,7 +783,7 @@ static void mac802154dev_notify(FAR const struct mac802154_maccb_s *maccb, * notifications. */ - if (dev->enableevents && (dev->md_open != NULL || dev->notify_registered)) + if (dev->enableevents && (dev->md_open != NULL || dev->notify_registered)) { mac802154dev_pushevent(dev, notif); @@ -797,7 +797,7 @@ static void mac802154dev_notify(FAR const struct mac802154_maccb_s *maccb, sem_post(&dev->geteventsem); } -#ifndef CONFIG_DISABLE_SIGNALS +#ifndef CONFIG_DISABLE_SIGNALS if (dev->notify_registered) { @@ -810,7 +810,7 @@ static void mac802154dev_notify(FAR const struct mac802154_maccb_s *maccb, (FAR void *)notif->notiftype); #endif } -#endif +#endif } else { @@ -854,7 +854,7 @@ static void mac802154dev_rxframe(FAR const struct mac802154_maccb_s *maccb, dev->readpending = false; sem_post(&dev->readsem); } - + /* Release the driver */ mac802154dev_givesem(&dev->md_exclsem); @@ -901,7 +901,7 @@ int mac802154dev_register(MACHANDLE mac, int minor) dev->md_mac = mac; sem_init(&dev->md_exclsem, 0, 1); /* Allow the device to be opened once * before blocking */ - + sem_init(&dev->readsem, 0, 0); sem_setprotocol(&dev->readsem, SEM_PRIO_NONE); dev->readpending = false; diff --git a/wireless/ieee802154/mac802154_get_mhrlen.c b/wireless/ieee802154/mac802154_get_mhrlen.c index 608acd8067..63f6f49455 100644 --- a/wireless/ieee802154/mac802154_get_mhrlen.c +++ b/wireless/ieee802154/mac802154_get_mhrlen.c @@ -83,7 +83,7 @@ int mac802154_get_mhrlen(MACHANDLE mac, /* The source address can only be set to NONE if the device is the PAN coord */ - if (meta->srcaddr_mode == IEEE802154_ADDRMODE_NONE && + if (meta->srcaddr_mode == IEEE802154_ADDRMODE_NONE && priv->devmode != IEEE802154_DEVMODE_PANCOORD) { return -EINVAL; diff --git a/wireless/ieee802154/mac802154_getset.c b/wireless/ieee802154/mac802154_getset.c index f32559b9ab..0173d40911 100644 --- a/wireless/ieee802154/mac802154_getset.c +++ b/wireless/ieee802154/mac802154_getset.c @@ -103,7 +103,7 @@ int mac802154_req_get(MACHANDLE mac, enum ieee802154_attr_e attr, ret = priv->radio->set_attr(priv->radio, attr, attrval); break; } - + return ret; } @@ -112,9 +112,9 @@ int mac802154_req_get(MACHANDLE mac, enum ieee802154_attr_e attr, * * Description: * The MLME-SET.request primitive attempts to write the given value to the - * indicated MAC PIB attribute. + * indicated MAC PIB attribute. * - * NOTE: The standard specifies that confirmation should be indicated via + * NOTE: The standard specifies that confirmation should be indicated via * the asynchronous MLME-SET.confirm primitve. However, in our implementation * we synchronously return the status from the request. Therefore, we do merge * the functionality of the MLME-SET.request and MLME-SET.confirm primitives @@ -138,7 +138,7 @@ int mac802154_req_set(MACHANDLE mac, enum ieee802154_attr_e attr, /* Tell the radio about the attribute */ priv->radio->set_attr(priv->radio, attr, attrval); - + ret = IEEE802154_STATUS_SUCCESS; } break; @@ -149,7 +149,7 @@ int mac802154_req_set(MACHANDLE mac, enum ieee802154_attr_e attr, /* Tell the radio about the attribute */ priv->radio->set_attr(priv->radio, attr, attrval); - + ret = IEEE802154_STATUS_SUCCESS; } break; @@ -163,7 +163,7 @@ int mac802154_req_set(MACHANDLE mac, enum ieee802154_attr_e attr, /* Tell the radio about the attribute */ priv->radio->set_attr(priv->radio, attr, attrval); - + ret = IEEE802154_STATUS_SUCCESS; } break; diff --git a/wireless/ieee802154/mac802154_internal.h b/wireless/ieee802154/mac802154_internal.h index 0e49c4654d..fc85d7a009 100644 --- a/wireless/ieee802154/mac802154_internal.h +++ b/wireless/ieee802154/mac802154_internal.h @@ -88,12 +88,12 @@ #if !defined(CONFIG_MAC802154_NNOTIF) || CONFIG_MAC802154_NNOTIF <= 0 # undef CONFIG_MAC802154_NNOTIF -# define CONFIG_MAC802154_NNOTIF 6 +# define CONFIG_MAC802154_NNOTIF 6 #endif #if !defined(CONFIG_MAC802154_NTXDESC) || CONFIG_MAC802154_NTXDESC <= 0 # undef CONFIG_MAC802154_NTXDESC -# define CONFIG_MAC802154_NTXDESC 3 +# define CONFIG_MAC802154_NTXDESC 3 #endif #if CONFIG_MAC802154_NTXDESC > CONFIG_MAC802154_NNOTIF @@ -154,7 +154,7 @@ struct ieee802154_privmac_s /* Only support a single command at any given time. As of now I see no * condition where you need to have more than one command frame simultaneously - */ + */ sem_t op_sem; /* Exclusive operations */ enum mac802154_operation_e curr_op; /* The current overall operation */ @@ -192,7 +192,7 @@ struct ieee802154_privmac_s * list should also be used to populate the address list of the outgoing * beacon frame. */ - + sq_queue_t indirect_queue; /* Support a singly linked list of frames received */ @@ -320,7 +320,7 @@ struct ieee802154_privmac_s /* What type of device is this node acting as */ enum ieee802154_devmode_e devmode : 2; - + uint32_t max_csmabackoffs : 3; /* Max num backoffs for CSMA algorithm * before declaring ch access failure */ @@ -332,7 +332,7 @@ struct ieee802154_privmac_s }; /**************************************************************************** - * Inline Functions + * Inline Functions ****************************************************************************/ #define mac802154_givesem(s) sem_post(s); @@ -373,7 +373,7 @@ static inline void mac802154_txdesc_free(FAR struct ieee802154_privmac_s *priv, * Name: mac802154_timercancel * * Description: - * Cancel timer and remove reference to callback function + * Cancel timer and remove reference to callback function * * Assumptions: * priv MAC struct is locked when calling. diff --git a/wireless/ieee802154/mac802154_notif.c b/wireless/ieee802154/mac802154_notif.c index 314e6bf5f3..15368a5483 100644 --- a/wireless/ieee802154/mac802154_notif.c +++ b/wireless/ieee802154/mac802154_notif.c @@ -77,9 +77,9 @@ int mac802154_notif_free(MACHANDLE mac, FAR struct mac802154_notif_s *privnotif = (FAR struct mac802154_notif_s *)notif; /* Get exclusive access to the MAC */ - + mac802154_takesem(&priv->exclsem, false); - + privnotif->flink = priv->notif_free; priv->notif_free = privnotif; mac802154_givesem(&priv->notif_sem); @@ -160,7 +160,7 @@ int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, */ ret = sem_trywait(&priv->notif_sem); - + if (ret == OK) { privnotif = priv->notif_free; @@ -187,21 +187,21 @@ int mac802154_notif_alloc(FAR struct ieee802154_privmac_s *priv, /* If we've taken a count from the semaphore, we have "reserved" the struct * but now we need to pop it off of the free list. We need to re-lock the * MAC in order to ensure this happens correctly. - */ - + */ + ret = mac802154_takesem(&priv->exclsem, allow_interrupt); if (ret < 0) { mac802154_givesem(&priv->notif_sem); return -EINTR; } - + /* We can now safely unlink the next free structure from the free list */ - + privnotif = priv->notif_free; priv->notif_free = privnotif->flink; } - + *notif = (FAR struct ieee802154_notif_s *)privnotif; return OK; diff --git a/wireless/ieee802154/mac802154_poll.c b/wireless/ieee802154/mac802154_poll.c index 58b6217211..377dd104ab 100644 --- a/wireless/ieee802154/mac802154_poll.c +++ b/wireless/ieee802154/mac802154_poll.c @@ -112,7 +112,7 @@ int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) priv->curr_cmd = IEEE802154_CMD_DATA_REQ; /* Get exclusive access to the MAC */ - + ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { @@ -121,10 +121,10 @@ int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) } /* Allocate an IOB to put the frame in */ - + iob = iob_alloc(false); DEBUGASSERT(iob != NULL); - + iob->io_flink = NULL; iob->io_len = 0; iob->io_offset = 0; @@ -142,10 +142,10 @@ int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) } /* Get a uin16_t reference to the first two bytes. ie frame control field */ - + frame_ctrl = (FAR uint16_t *)&iob->io_data[0]; iob->io_len = 2; - + *frame_ctrl = (IEEE802154_FRAME_COMMAND << IEEE802154_FRAMECTRL_SHIFT_FTYPE); *frame_ctrl |= IEEE802154_FRAMECTRL_ACKREQ; @@ -153,7 +153,7 @@ int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) * shall copy the value of macDSN into the Sequence Number field of the * MHR of the outgoing frame and then increment it by one. [1] pg. 40. */ - + iob->io_data[iob->io_len++] = priv->dsn++; /* If the destination address is present, copy the PAN ID and one of the @@ -192,7 +192,7 @@ int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) { *frame_ctrl |= IEEE802154_FRAMECTRL_PANIDCOMP; } - else + else { memcpy(&iob->io_data[iob->io_len], &priv->addr.panid, 2); iob->io_len += 2; @@ -215,7 +215,7 @@ int mac802154_req_poll(MACHANDLE mac, FAR struct ieee802154_poll_req_s *req) memcpy(&iob->io_data[iob->io_len], &priv->addr.saddr, 2); iob->io_len += 2; } - + /* Copy in the Command Frame Identifier */ iob->io_data[iob->io_len++] = IEEE802154_CMD_DATA_REQ; @@ -273,7 +273,7 @@ void mac802154_txdone_datareq_poll(FAR struct ieee802154_privmac_s *priv, enum ieee802154_status_e status; FAR struct mac802154_notif_s *privnotif = (FAR struct mac802154_notif_s *)txdesc->conf; - FAR struct ieee802154_notif_s *notif = &privnotif->pub; + FAR struct ieee802154_notif_s *notif = &privnotif->pub; /* If the data request failed to be sent, notify the next layer * that the poll has failed. @@ -324,14 +324,14 @@ void mac802154_txdone_datareq_poll(FAR struct ieee802154_privmac_s *priv, * the timer, otherwise it will expire and we will notify the * next highest layer of the failure. */ - + mac802154_timerstart(priv, priv->max_frame_waittime, mac802154_timeout_poll); /* We can deallocate the data conf notification as it is no longer * needed. We can't use the public function here since we already - * have the MAC locked. - */ + * have the MAC locked. + */ privnotif->flink = priv->notif_free; priv->notif_free = privnotif; @@ -371,6 +371,6 @@ static void mac802154_timeout_poll(FAR struct ieee802154_privmac_s *priv) notif->notiftype = IEEE802154_NOTIFY_CONF_POLL; notif->u.pollconf.status = IEEE802154_STATUS_NO_DATA; - + priv->cb->notify(priv->cb, notif); } \ No newline at end of file diff --git a/wireless/ieee802154/mac802154_purge.c b/wireless/ieee802154/mac802154_purge.c index 8249cb5678..6073c61f8c 100644 --- a/wireless/ieee802154/mac802154_purge.c +++ b/wireless/ieee802154/mac802154_purge.c @@ -66,10 +66,10 @@ * an MSDU from the transaction queue. Confirmation is returned via * the struct mac802154_maccb_s->conf_purge callback. * - * NOTE: The standard specifies that confirmation should be indicated via + * NOTE: The standard specifies that confirmation should be indicated via * the asynchronous MLME-PURGE.confirm primitve. However, in our * implementation we synchronously return the status from the request. - * Therefore, we merge the functionality of the MLME-PURGE.request and + * Therefore, we merge the functionality of the MLME-PURGE.request and * MLME-PURGE.confirm primitives together. * ****************************************************************************/ diff --git a/wireless/ieee802154/mac802154_start.c b/wireless/ieee802154/mac802154_start.c index 6b0c051717..263703b9e8 100644 --- a/wireless/ieee802154/mac802154_start.c +++ b/wireless/ieee802154/mac802154_start.c @@ -71,7 +71,7 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) int ret; /* Get exclusive access to the MAC */ - + ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { @@ -94,7 +94,7 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) return -ENOTTY; } - + /* Set the PANID attribute */ priv->addr.panid = req->panid; @@ -107,7 +107,7 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_PAGE, (FAR const union ieee802154_attr_u *)&req->chpage); - + /* Set the beacon order */ @@ -120,7 +120,7 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) priv->beaconorder = req->beaconorder; /* The value of macSuperframeOrder shall be ignored if macBeaconOrder = 15. pg. 19 */ - + if (priv->beaconorder < 15) { /* Set the superframe order */ @@ -145,7 +145,7 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req) /* If the BeaconOrder parameter is less than 15, the MLME sets macBattLifeExt to * the value of the BatteryLifeExtension parameter. If the BeaconOrder parameter - * equals 15, the value of the BatteryLifeExtension parameter is ignored. + * equals 15, the value of the BatteryLifeExtension parameter is ignored. * [1] pg. 106 */ From ca30b6c02a5794ae6ee85d1fce5541ae5a16e8bc Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Thu, 15 Jun 2017 13:01:19 -0400 Subject: [PATCH 35/55] wireless/ieee802154: Fixes issue with wrong information being sent in a rejected association response frame --- include/nuttx/wireless/ieee802154/ieee802154_mac.h | 14 ++++++++++++-- wireless/ieee802154/mac802154_assoc.c | 10 +++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/include/nuttx/wireless/ieee802154/ieee802154_mac.h b/include/nuttx/wireless/ieee802154/ieee802154_mac.h index d9732d4dd5..a07978a64e 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_mac.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_mac.h @@ -200,14 +200,25 @@ enum ieee802154_status_e { + /* This first section of enums is defined in the standard. [1] pg. 70 + * They must be in this order + */ + IEEE802154_STATUS_SUCCESS = 0, + IEEE802154_STATUS_OUT_OF_CAPACITY, + IEEE802154_STATUS_DENIED, + + /* As of now, all values below do not have a specific value defined in the + * standard + */ + IEEE802154_STATUS_FAILURE, /* This value is not outlined in the standard. It * is a catch-all for any failures that are not * outlined in the standard */ + IEEE802154_STATUS_BEACON_LOSS, IEEE802154_STATUS_CHANNEL_ACCESS_FAILURE, - IEEE802154_STATUS_DENIED, IEEE802154_STATUS_DISABLE_TRX_FAILURE, IEEE802154_STATUS_FAILED_SECURITY_CHECK, IEEE802154_STATUS_FRAME_TOO_LONG, @@ -218,7 +229,6 @@ enum ieee802154_status_e IEEE802154_STATUS_NO_BEACON, IEEE802154_STATUS_NO_DATA, IEEE802154_STATUS_NO_SHORT_ADDRESS, - IEEE802154_STATUS_OUT_OF_CAP, IEEE802154_STATUS_PAN_ID_CONFLICT, IEEE802154_STATUS_REALIGNMENT, IEEE802154_STATUS_TRANSACTION_EXPIRED, diff --git a/wireless/ieee802154/mac802154_assoc.c b/wireless/ieee802154/mac802154_assoc.c index d0d77302a2..0de0ec1977 100644 --- a/wireless/ieee802154/mac802154_assoc.c +++ b/wireless/ieee802154/mac802154_assoc.c @@ -374,7 +374,15 @@ int mac802154_resp_associate(MACHANDLE mac, /* Copy in the assigned short address */ - memcpy(&iob->io_data[iob->io_len], &resp->assocsaddr, 2); + if (resp->status == IEEE802154_STATUS_SUCCESS) + { + memcpy(&iob->io_data[iob->io_len], &resp->assocsaddr, 2); + } + else + { + u16 = (FAR uint16_t *)&iob->io_data[iob->io_len]; + *u16 = IEEE802154_SADDR_UNSPEC; + } iob->io_len += 2; /* Copy in the association status */ From 150907a9b4e618e485fabd763f3b46407e379aae Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 12:30:58 -0600 Subject: [PATCH 36/55] Rename configs/mrf24j40-radio to mrf24j40-mac --- configs/clicker2-stm32/README.txt | 21 ++++++++++++------- .../Make.defs | 2 +- .../defconfig | 0 3 files changed, 14 insertions(+), 9 deletions(-) rename configs/clicker2-stm32/{mrf24j40-radio => mrf24j40-mac}/Make.defs (98%) rename configs/clicker2-stm32/{mrf24j40-radio => mrf24j40-mac}/defconfig (100%) diff --git a/configs/clicker2-stm32/README.txt b/configs/clicker2-stm32/README.txt index d2892192e8..1547c816ec 100644 --- a/configs/clicker2-stm32/README.txt +++ b/configs/clicker2-stm32/README.txt @@ -304,10 +304,10 @@ Configurations If you do this a lot, you will probably want to invest a little time to develop a tool to automate these steps. - mrf24j40-radio + mrf24j40-mac - This is a version of nsh that was used for testing the MRF24J40 be as a - character device. The most important configuration differences are + This is a version of nsh that was used for testing the MRF24J40 MAC be + as a character device. The most important configuration differences are summarized below: 1. Support for the BEE click and SPI are in enabled in the mikroBUS1 slot: @@ -327,7 +327,11 @@ Configurations CONFIG_WIRELESS=y CONFIG_WIRELESS_IEEE802154=y - CONFIG_IEEE802154_DEV=y + CONFIG_IEEE802154_MAC_DEV=y + CONFIG_IEEE802154_NTXDESC=3 + CONFIG_IEEE802154_IND_PREALLOC=20 + CONFIG_IEEE802154_IND_IRQRESERVE=10 + CONFIG_IEEE802154_DEFAULT_EADDR=0x00fade00deadbeef 5. Support for the lower half MRF24J40 character driver is enabled @@ -335,11 +339,13 @@ Configurations CONFIG_DRIVERS_IEEE802154=y CONFIG_IEEE802154_MRF24J40=y - 6. Support for the test program at apps/ieee802154 is enabled: + 6. Support for the i8sak test program at apps/ieee802154 is enabled: - CONFIG_IEEE802154_COMMON=y - CONFIG_IEEE802154_COORD=y + CONFIG_IEEE802154_LIBMAC=y + CONFIG_IEEE802154_LIBUTILS=y CONFIG_IEEE802154_I8SAK=y + CONFIG_IEEE802154_I8SAK_PRIORITY=100 + CONFIG_IEEE802154_I8SAK_STACKSIZE=2048 7. Initialization hooks are provided to enable the MRF24J40 and to register the radio character driver. @@ -371,7 +377,6 @@ Configurations CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y usbnsh: - ------- This is another NSH example. If differs from other 'nsh' configurations in that this configurations uses a USB serial device for console I/O. diff --git a/configs/clicker2-stm32/mrf24j40-radio/Make.defs b/configs/clicker2-stm32/mrf24j40-mac/Make.defs similarity index 98% rename from configs/clicker2-stm32/mrf24j40-radio/Make.defs rename to configs/clicker2-stm32/mrf24j40-mac/Make.defs index 4aa245f38b..ab1e10dc45 100644 --- a/configs/clicker2-stm32/mrf24j40-radio/Make.defs +++ b/configs/clicker2-stm32/mrf24j40-mac/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/clicker2-stm32/mrf24j40-radio/Make.defs +# configs/clicker2-stm32/mrf24j40-mac/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/configs/clicker2-stm32/mrf24j40-radio/defconfig b/configs/clicker2-stm32/mrf24j40-mac/defconfig similarity index 100% rename from configs/clicker2-stm32/mrf24j40-radio/defconfig rename to configs/clicker2-stm32/mrf24j40-mac/defconfig From b8e968f191b8a1aae290f70d8290d96e67636226 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 14:26:10 -0600 Subject: [PATCH 37/55] clicker2-stm32: Add a configuratino that will, eventually, be used for 6loWPAN testing. --- configs/clicker2-stm32/README.txt | 29 + .../clicker2-stm32/mrf24j40-6lowpan/Make.defs | 122 ++ .../clicker2-stm32/mrf24j40-6lowpan/defconfig | 1433 +++++++++++++++++ configs/clicker2-stm32/mrf24j40-mac/defconfig | 2 +- configs/clicker2-stm32/nsh/defconfig | 8 +- configs/clicker2-stm32/usbnsh/defconfig | 8 +- 6 files changed, 1595 insertions(+), 7 deletions(-) create mode 100644 configs/clicker2-stm32/mrf24j40-6lowpan/Make.defs create mode 100644 configs/clicker2-stm32/mrf24j40-6lowpan/defconfig diff --git a/configs/clicker2-stm32/README.txt b/configs/clicker2-stm32/README.txt index 1547c816ec..da2af00c6c 100644 --- a/configs/clicker2-stm32/README.txt +++ b/configs/clicker2-stm32/README.txt @@ -352,6 +352,35 @@ Configurations CONFIG_NSH_ARCHINIT=y + mrf24j40-6lowpan + + This is another version of nsh that is very similar to the mrf24j40-mac + configuration but is focused on testing the IEEE 802.15.4 MAC integration + with the 6loWPAN network stack. I derives directly from the mrf24j40-mac + and all NOTES provided there apply. Additional differences are summarized + below: + + NOTES: + + 1. This is another NSH example. If differs from the mrf24j40 + configuration in that this configuration, like the usbnsh + configuration, it uses a USB serial device for console I/O. + Such a configuration is useful on the Clicker2 STM32 which + has no builtin RS-232 drivers and tangle of cables and jumpers + needed to debug multi-board setups. + + Other NOTES for the usbnsh configuration should appy. + + 2. This configuration does have USART3 output enabled and set up as + the system logging device: + + CONFIG_SYSLOG_CHAR=y : Use a character device for system logging + CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" : USART3 will be /dev/ttyS0 + + However, there is nothing to generate SYLOG output in the default + configuration so nothing should appear on USART3 unless you enable + some debug output or enable the USB monitor. + nsh: Configures the NuttShell (nsh) located at examples/nsh. This diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/Make.defs b/configs/clicker2-stm32/mrf24j40-6lowpan/Make.defs new file mode 100644 index 0000000000..5d849c96f4 --- /dev/null +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/Make.defs @@ -0,0 +1,122 @@ +############################################################################ +# configs/clicker2-stm32/mrf24j40-6lowpan/Make.defs +# +# Copyright (C) 2017 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +include ${TOPDIR}/.config +include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs + +LDSCRIPT = flash.ld + +ifeq ($(WINTOOL),y) + # Windows-native toolchains + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mkwindeps.sh + ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" + ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" +else + # Linux/Cygwin-native toolchain + MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) + ARCHINCLUDES = -I. -isystem $(TOPDIR)/include + ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) +endif + +CC = $(CROSSDEV)gcc +CXX = $(CROSSDEV)g++ +CPP = $(CROSSDEV)gcc -E +LD = $(CROSSDEV)ld +AR = $(CROSSDEV)ar rcs +NM = $(CROSSDEV)nm +OBJCOPY = $(CROSSDEV)objcopy +OBJDUMP = $(CROSSDEV)objdump + +ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} +ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = -g +endif + +ifneq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer +endif + +ARCHCFLAGS = -fno-builtin +ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef +ARCHWARNINGSXX = -Wall -Wshadow -Wundef +ARCHDEFINES = +ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 + +CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + +# Loadable module definitions + +CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs + +LDMODULEFLAGS = -r -e module_initialize +ifeq ($(WINTOOL),y) + LDMODULEFLAGS += -T "${shell cygpath -w $(TOPDIR)/libc/modlib/gnu-elf.ld}" +else + LDMODULEFLAGS += -T $(TOPDIR)/libc/modlib/gnu-elf.ld +endif + +ASMEXT = .S +OBJEXT = .o +LIBEXT = .a +EXEEXT = + +ifneq ($(CROSSDEV),arm-nuttx-elf-) + LDFLAGS += -nostartfiles -nodefaultlibs +endif +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDFLAGS += -g +endif + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe +HOSTLDFLAGS = diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig new file mode 100644 index 0000000000..6332ccc671 --- /dev/null +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig @@ -0,0 +1,1433 @@ +# +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_DEFAULT_SMALL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +CONFIG_BUILD_FLAT=y +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +CONFIG_INTELHEX_BINARY=y +# CONFIG_MOTOROLA_SREC is not set +CONFIG_RAW_BINARY=y +# CONFIG_UBOOT_UIMAGE is not set +# CONFIG_DFU_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDINT_H is not set +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set +# CONFIG_ARCH_DEBUG_H is not set + +# +# Debug Options +# +CONFIG_DEBUG_ALERT=y +# CONFIG_DEBUG_FEATURES is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +# CONFIG_STACK_COLORATION is not set +CONFIG_ARCH_HAVE_HEAPCHECK=y +# CONFIG_HEAP_COLORATION is not set +# CONFIG_DEBUG_SYMBOLS is not set +CONFIG_ARCH_HAVE_CUSTOMOPT=y +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y + +# +# System Type +# +CONFIG_ARCH_ARM=y +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_MISOC is not set +# CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set +# CONFIG_ARCH_Z16 is not set +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="arm" + +# +# ARM Options +# +# CONFIG_ARCH_CHIP_A1X is not set +# CONFIG_ARCH_CHIP_C5471 is not set +# CONFIG_ARCH_CHIP_DM320 is not set +# CONFIG_ARCH_CHIP_EFM32 is not set +# CONFIG_ARCH_CHIP_IMX1 is not set +# CONFIG_ARCH_CHIP_IMX6 is not set +# CONFIG_ARCH_CHIP_KINETIS is not set +# CONFIG_ARCH_CHIP_KL is not set +# CONFIG_ARCH_CHIP_LM is not set +# CONFIG_ARCH_CHIP_TIVA is not set +# CONFIG_ARCH_CHIP_LPC11XX is not set +# CONFIG_ARCH_CHIP_LPC17XX is not set +# CONFIG_ARCH_CHIP_LPC214X is not set +# CONFIG_ARCH_CHIP_LPC2378 is not set +# CONFIG_ARCH_CHIP_LPC31XX is not set +# CONFIG_ARCH_CHIP_LPC43XX is not set +# CONFIG_ARCH_CHIP_MOXART is not set +# CONFIG_ARCH_CHIP_NUC1XX is not set +# CONFIG_ARCH_CHIP_SAMA5 is not set +# CONFIG_ARCH_CHIP_SAMD is not set +# CONFIG_ARCH_CHIP_SAML is not set +# CONFIG_ARCH_CHIP_SAM34 is not set +# CONFIG_ARCH_CHIP_SAMV7 is not set +CONFIG_ARCH_CHIP_STM32=y +# CONFIG_ARCH_CHIP_STM32F0 is not set +# CONFIG_ARCH_CHIP_STM32F7 is not set +# CONFIG_ARCH_CHIP_STM32L4 is not set +# CONFIG_ARCH_CHIP_STR71X is not set +# CONFIG_ARCH_CHIP_TMS570 is not set +# CONFIG_ARCH_CHIP_XMC4 is not set +# CONFIG_ARCH_ARM7TDMI is not set +# CONFIG_ARCH_ARM926EJS is not set +# CONFIG_ARCH_ARM920T is not set +# CONFIG_ARCH_CORTEXM0 is not set +# CONFIG_ARCH_CORTEXM23 is not set +# CONFIG_ARCH_CORTEXM3 is not set +# CONFIG_ARCH_CORTEXM33 is not set +CONFIG_ARCH_CORTEXM4=y +# CONFIG_ARCH_CORTEXM7 is not set +# CONFIG_ARCH_CORTEXA5 is not set +# CONFIG_ARCH_CORTEXA8 is not set +# CONFIG_ARCH_CORTEXA9 is not set +# CONFIG_ARCH_CORTEXR4 is not set +# CONFIG_ARCH_CORTEXR4F is not set +# CONFIG_ARCH_CORTEXR5 is not set +# CONFIG_ARCH_CORTEXR5F is not set +# CONFIG_ARCH_CORTEXR7 is not set +# CONFIG_ARCH_CORTEXR7F is not set +CONFIG_ARCH_FAMILY="armv7-m" +CONFIG_ARCH_CHIP="stm32" +# CONFIG_ARMV7M_USEBASEPRI is not set +CONFIG_ARCH_HAVE_CMNVECTOR=y +# CONFIG_ARMV7M_CMNVECTOR is not set +# CONFIG_ARMV7M_LAZYFPU is not set +CONFIG_ARCH_HAVE_FPU=y +# CONFIG_ARCH_HAVE_DPFPU is not set +CONFIG_ARCH_FPU=y +# CONFIG_ARCH_HAVE_TRUSTZONE is not set +CONFIG_ARM_HAVE_MPU_UNIFIED=y +# CONFIG_ARM_MPU is not set + +# +# ARMV7M Configuration Options +# +# CONFIG_ARMV7M_HAVE_ICACHE is not set +# CONFIG_ARMV7M_HAVE_DCACHE is not set +# CONFIG_ARMV7M_HAVE_ITCM is not set +# CONFIG_ARMV7M_HAVE_DTCM is not set +# CONFIG_ARMV7M_TOOLCHAIN_IARL is not set +# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y +CONFIG_ARMV7M_HAVE_STACKCHECK=y +# CONFIG_ARMV7M_STACKCHECK is not set +# CONFIG_ARMV7M_ITMSYSLOG is not set +# CONFIG_SERIAL_TERMIOS is not set + +# +# STM32 Configuration Options +# +# CONFIG_ARCH_CHIP_STM32L151C6 is not set +# CONFIG_ARCH_CHIP_STM32L151C8 is not set +# CONFIG_ARCH_CHIP_STM32L151CB is not set +# CONFIG_ARCH_CHIP_STM32L151R6 is not set +# CONFIG_ARCH_CHIP_STM32L151R8 is not set +# CONFIG_ARCH_CHIP_STM32L151RB is not set +# CONFIG_ARCH_CHIP_STM32L151V6 is not set +# CONFIG_ARCH_CHIP_STM32L151V8 is not set +# CONFIG_ARCH_CHIP_STM32L151VB is not set +# CONFIG_ARCH_CHIP_STM32L152C6 is not set +# CONFIG_ARCH_CHIP_STM32L152C8 is not set +# CONFIG_ARCH_CHIP_STM32L152CB is not set +# CONFIG_ARCH_CHIP_STM32L152R6 is not set +# CONFIG_ARCH_CHIP_STM32L152R8 is not set +# CONFIG_ARCH_CHIP_STM32L152RB is not set +# CONFIG_ARCH_CHIP_STM32L152V6 is not set +# CONFIG_ARCH_CHIP_STM32L152V8 is not set +# CONFIG_ARCH_CHIP_STM32L152VB is not set +# CONFIG_ARCH_CHIP_STM32L152CC is not set +# CONFIG_ARCH_CHIP_STM32L152RC is not set +# CONFIG_ARCH_CHIP_STM32L152VC is not set +# CONFIG_ARCH_CHIP_STM32L162ZD is not set +# CONFIG_ARCH_CHIP_STM32L162VE is not set +# CONFIG_ARCH_CHIP_STM32F100C8 is not set +# CONFIG_ARCH_CHIP_STM32F100CB is not set +# CONFIG_ARCH_CHIP_STM32F100R8 is not set +# CONFIG_ARCH_CHIP_STM32F100RB is not set +# CONFIG_ARCH_CHIP_STM32F100RC is not set +# CONFIG_ARCH_CHIP_STM32F100RD is not set +# CONFIG_ARCH_CHIP_STM32F100RE is not set +# CONFIG_ARCH_CHIP_STM32F100V8 is not set +# CONFIG_ARCH_CHIP_STM32F100VB is not set +# CONFIG_ARCH_CHIP_STM32F100VC is not set +# CONFIG_ARCH_CHIP_STM32F100VD is not set +# CONFIG_ARCH_CHIP_STM32F100VE is not set +# CONFIG_ARCH_CHIP_STM32F102CB is not set +# CONFIG_ARCH_CHIP_STM32F103T8 is not set +# CONFIG_ARCH_CHIP_STM32F103TB is not set +# CONFIG_ARCH_CHIP_STM32F103C4 is not set +# CONFIG_ARCH_CHIP_STM32F103C8 is not set +# CONFIG_ARCH_CHIP_STM32F103CB is not set +# CONFIG_ARCH_CHIP_STM32F103R8 is not set +# CONFIG_ARCH_CHIP_STM32F103RB is not set +# CONFIG_ARCH_CHIP_STM32F103RC is not set +# CONFIG_ARCH_CHIP_STM32F103RD is not set +# CONFIG_ARCH_CHIP_STM32F103RE is not set +# CONFIG_ARCH_CHIP_STM32F103RG is not set +# CONFIG_ARCH_CHIP_STM32F103V8 is not set +# CONFIG_ARCH_CHIP_STM32F103VB is not set +# CONFIG_ARCH_CHIP_STM32F103VC is not set +# CONFIG_ARCH_CHIP_STM32F103VE is not set +# CONFIG_ARCH_CHIP_STM32F103ZE is not set +# CONFIG_ARCH_CHIP_STM32F105VB is not set +# CONFIG_ARCH_CHIP_STM32F105RB is not set +# CONFIG_ARCH_CHIP_STM32F107VC is not set +# CONFIG_ARCH_CHIP_STM32F205RG is not set +# CONFIG_ARCH_CHIP_STM32F207IG is not set +# CONFIG_ARCH_CHIP_STM32F207ZE is not set +# CONFIG_ARCH_CHIP_STM32F302K6 is not set +# CONFIG_ARCH_CHIP_STM32F302K8 is not set +# CONFIG_ARCH_CHIP_STM32F302CB is not set +# CONFIG_ARCH_CHIP_STM32F302CC is not set +# CONFIG_ARCH_CHIP_STM32F302RB is not set +# CONFIG_ARCH_CHIP_STM32F302RC is not set +# CONFIG_ARCH_CHIP_STM32F302VB is not set +# CONFIG_ARCH_CHIP_STM32F302VC is not set +# CONFIG_ARCH_CHIP_STM32F303K6 is not set +# CONFIG_ARCH_CHIP_STM32F303K8 is not set +# CONFIG_ARCH_CHIP_STM32F303C6 is not set +# CONFIG_ARCH_CHIP_STM32F303C8 is not set +# CONFIG_ARCH_CHIP_STM32F303CB is not set +# CONFIG_ARCH_CHIP_STM32F303CC is not set +# CONFIG_ARCH_CHIP_STM32F303RB is not set +# CONFIG_ARCH_CHIP_STM32F303RC is not set +# CONFIG_ARCH_CHIP_STM32F303RD is not set +# CONFIG_ARCH_CHIP_STM32F303RE is not set +# CONFIG_ARCH_CHIP_STM32F303VB is not set +# CONFIG_ARCH_CHIP_STM32F303VC is not set +# CONFIG_ARCH_CHIP_STM32F334K4 is not set +# CONFIG_ARCH_CHIP_STM32F334K6 is not set +# CONFIG_ARCH_CHIP_STM32F334K8 is not set +# CONFIG_ARCH_CHIP_STM32F334C4 is not set +# CONFIG_ARCH_CHIP_STM32F334C6 is not set +# CONFIG_ARCH_CHIP_STM32F334C8 is not set +# CONFIG_ARCH_CHIP_STM32F334R4 is not set +# CONFIG_ARCH_CHIP_STM32F334R6 is not set +# CONFIG_ARCH_CHIP_STM32F334R8 is not set +# CONFIG_ARCH_CHIP_STM32F372C8 is not set +# CONFIG_ARCH_CHIP_STM32F372R8 is not set +# CONFIG_ARCH_CHIP_STM32F372V8 is not set +# CONFIG_ARCH_CHIP_STM32F372CB is not set +# CONFIG_ARCH_CHIP_STM32F372RB is not set +# CONFIG_ARCH_CHIP_STM32F372VB is not set +# CONFIG_ARCH_CHIP_STM32F372CC is not set +# CONFIG_ARCH_CHIP_STM32F372RC is not set +# CONFIG_ARCH_CHIP_STM32F372VC is not set +# CONFIG_ARCH_CHIP_STM32F373C8 is not set +# CONFIG_ARCH_CHIP_STM32F373R8 is not set +# CONFIG_ARCH_CHIP_STM32F373V8 is not set +# CONFIG_ARCH_CHIP_STM32F373CB is not set +# CONFIG_ARCH_CHIP_STM32F373RB is not set +# CONFIG_ARCH_CHIP_STM32F373VB is not set +# CONFIG_ARCH_CHIP_STM32F373CC is not set +# CONFIG_ARCH_CHIP_STM32F373RC is not set +# CONFIG_ARCH_CHIP_STM32F373VC is not set +# CONFIG_ARCH_CHIP_STM32F401RE is not set +# CONFIG_ARCH_CHIP_STM32F410RB is not set +# CONFIG_ARCH_CHIP_STM32F411RE is not set +# CONFIG_ARCH_CHIP_STM32F411VE is not set +# CONFIG_ARCH_CHIP_STM32F405RG is not set +# CONFIG_ARCH_CHIP_STM32F405VG is not set +# CONFIG_ARCH_CHIP_STM32F405ZG is not set +# CONFIG_ARCH_CHIP_STM32F407VE is not set +CONFIG_ARCH_CHIP_STM32F407VG=y +# CONFIG_ARCH_CHIP_STM32F407ZE is not set +# CONFIG_ARCH_CHIP_STM32F407ZG is not set +# CONFIG_ARCH_CHIP_STM32F407IE is not set +# CONFIG_ARCH_CHIP_STM32F407IG is not set +# CONFIG_ARCH_CHIP_STM32F427V is not set +# CONFIG_ARCH_CHIP_STM32F427Z is not set +# CONFIG_ARCH_CHIP_STM32F427I is not set +# CONFIG_ARCH_CHIP_STM32F429V is not set +# CONFIG_ARCH_CHIP_STM32F429Z is not set +# CONFIG_ARCH_CHIP_STM32F429I is not set +# CONFIG_ARCH_CHIP_STM32F429B is not set +# CONFIG_ARCH_CHIP_STM32F429N is not set +# CONFIG_ARCH_CHIP_STM32F446M is not set +# CONFIG_ARCH_CHIP_STM32F446R is not set +# CONFIG_ARCH_CHIP_STM32F446V is not set +# CONFIG_ARCH_CHIP_STM32F446Z is not set +# CONFIG_ARCH_CHIP_STM32F469A is not set +# CONFIG_ARCH_CHIP_STM32F469I is not set +# CONFIG_ARCH_CHIP_STM32F469B is not set +# CONFIG_ARCH_CHIP_STM32F469N is not set +CONFIG_STM32_FLASH_CONFIG_DEFAULT=y +# CONFIG_STM32_FLASH_CONFIG_4 is not set +# CONFIG_STM32_FLASH_CONFIG_6 is not set +# CONFIG_STM32_FLASH_CONFIG_8 is not set +# CONFIG_STM32_FLASH_CONFIG_B is not set +# CONFIG_STM32_FLASH_CONFIG_C is not set +# CONFIG_STM32_FLASH_CONFIG_D is not set +# CONFIG_STM32_FLASH_CONFIG_E is not set +# CONFIG_STM32_FLASH_CONFIG_F is not set +# CONFIG_STM32_FLASH_CONFIG_G is not set +# CONFIG_STM32_FLASH_CONFIG_I is not set +# CONFIG_STM32_STM32L15XX is not set +# CONFIG_STM32_ENERGYLITE is not set +# CONFIG_STM32_STM32F10XX is not set +# CONFIG_STM32_VALUELINE is not set +# CONFIG_STM32_CONNECTIVITYLINE is not set +# CONFIG_STM32_PERFORMANCELINE is not set +# CONFIG_STM32_USBACCESSLINE is not set +# CONFIG_STM32_HIGHDENSITY is not set +# CONFIG_STM32_MEDIUMDENSITY is not set +# CONFIG_STM32_LOWDENSITY is not set +# CONFIG_STM32_STM32F20XX is not set +# CONFIG_STM32_STM32F205 is not set +# CONFIG_STM32_STM32F207 is not set +# CONFIG_STM32_STM32F30XX is not set +# CONFIG_STM32_STM32F302 is not set +# CONFIG_STM32_STM32F303 is not set +# CONFIG_STM32_STM32F33XX is not set +# CONFIG_STM32_STM32F37XX is not set +CONFIG_STM32_STM32F40XX=y +# CONFIG_STM32_STM32F401 is not set +# CONFIG_STM32_STM32F410 is not set +# CONFIG_STM32_STM32F411 is not set +# CONFIG_STM32_STM32F405 is not set +CONFIG_STM32_STM32F407=y +# CONFIG_STM32_STM32F427 is not set +# CONFIG_STM32_STM32F429 is not set +# CONFIG_STM32_STM32F446 is not set +# CONFIG_STM32_STM32F469 is not set +# CONFIG_STM32_DFU is not set + +# +# STM32 Peripheral Support +# +CONFIG_STM32_HAVE_CCM=y +# CONFIG_STM32_HAVE_USBDEV is not set +CONFIG_STM32_HAVE_OTGFS=y +CONFIG_STM32_HAVE_FSMC=y +# CONFIG_STM32_HAVE_HRTIM1 is not set +# CONFIG_STM32_HAVE_LTDC is not set +CONFIG_STM32_HAVE_USART3=y +CONFIG_STM32_HAVE_UART4=y +CONFIG_STM32_HAVE_UART5=y +CONFIG_STM32_HAVE_USART6=y +# CONFIG_STM32_HAVE_UART7 is not set +# CONFIG_STM32_HAVE_UART8 is not set +CONFIG_STM32_HAVE_TIM1=y +CONFIG_STM32_HAVE_TIM2=y +CONFIG_STM32_HAVE_TIM3=y +CONFIG_STM32_HAVE_TIM4=y +CONFIG_STM32_HAVE_TIM5=y +CONFIG_STM32_HAVE_TIM6=y +CONFIG_STM32_HAVE_TIM7=y +CONFIG_STM32_HAVE_TIM8=y +CONFIG_STM32_HAVE_TIM9=y +CONFIG_STM32_HAVE_TIM10=y +CONFIG_STM32_HAVE_TIM11=y +CONFIG_STM32_HAVE_TIM12=y +CONFIG_STM32_HAVE_TIM13=y +CONFIG_STM32_HAVE_TIM14=y +# CONFIG_STM32_HAVE_TIM15 is not set +# CONFIG_STM32_HAVE_TIM16 is not set +# CONFIG_STM32_HAVE_TIM17 is not set +CONFIG_STM32_HAVE_ADC2=y +CONFIG_STM32_HAVE_ADC3=y +# CONFIG_STM32_HAVE_ADC4 is not set +# CONFIG_STM32_HAVE_ADC1_DMA is not set +# CONFIG_STM32_HAVE_ADC2_DMA is not set +# CONFIG_STM32_HAVE_ADC3_DMA is not set +# CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set +CONFIG_STM32_HAVE_CAN1=y +CONFIG_STM32_HAVE_CAN2=y +# CONFIG_STM32_HAVE_COMP1 is not set +# CONFIG_STM32_HAVE_COMP2 is not set +# CONFIG_STM32_HAVE_COMP3 is not set +# CONFIG_STM32_HAVE_COMP4 is not set +# CONFIG_STM32_HAVE_COMP5 is not set +# CONFIG_STM32_HAVE_COMP6 is not set +# CONFIG_STM32_HAVE_COMP7 is not set +CONFIG_STM32_HAVE_DAC1=y +CONFIG_STM32_HAVE_DAC2=y +CONFIG_STM32_HAVE_RNG=y +CONFIG_STM32_HAVE_ETHMAC=y +CONFIG_STM32_HAVE_I2C2=y +CONFIG_STM32_HAVE_I2C3=y +CONFIG_STM32_HAVE_SPI2=y +CONFIG_STM32_HAVE_SPI3=y +CONFIG_STM32_HAVE_I2S3=y +# CONFIG_STM32_HAVE_SPI4 is not set +# CONFIG_STM32_HAVE_SPI5 is not set +# CONFIG_STM32_HAVE_SPI6 is not set +# CONFIG_STM32_HAVE_SAIPLL is not set +# CONFIG_STM32_HAVE_I2SPLL is not set +# CONFIG_STM32_HAVE_OPAMP1 is not set +# CONFIG_STM32_HAVE_OPAMP2 is not set +# CONFIG_STM32_HAVE_OPAMP3 is not set +# CONFIG_STM32_HAVE_OPAMP4 is not set +# CONFIG_STM32_ADC1 is not set +# CONFIG_STM32_ADC2 is not set +# CONFIG_STM32_ADC3 is not set +# CONFIG_STM32_BKPSRAM is not set +# CONFIG_STM32_CAN1 is not set +# CONFIG_STM32_CAN2 is not set +# CONFIG_STM32_CCMDATARAM is not set +# CONFIG_STM32_CRC is not set +# CONFIG_STM32_CRYP is not set +# CONFIG_STM32_DMA1 is not set +# CONFIG_STM32_DMA2 is not set +# CONFIG_STM32_DAC1 is not set +# CONFIG_STM32_DAC2 is not set +# CONFIG_STM32_DCMI is not set +# CONFIG_STM32_ETHMAC is not set +# CONFIG_STM32_FSMC is not set +# CONFIG_STM32_HASH is not set +# CONFIG_STM32_I2C1 is not set +# CONFIG_STM32_I2C2 is not set +# CONFIG_STM32_I2C3 is not set +# CONFIG_STM32_OPAMP is not set +CONFIG_STM32_OTGFS=y +# CONFIG_STM32_OTGHS is not set +CONFIG_STM32_PWR=y +# CONFIG_STM32_RNG is not set +# CONFIG_STM32_SDIO is not set +# CONFIG_STM32_SPI1 is not set +# CONFIG_STM32_SPI2 is not set +CONFIG_STM32_SPI3=y +# CONFIG_STM32_I2S3 is not set +CONFIG_STM32_SYSCFG=y +# CONFIG_STM32_TIM1 is not set +# CONFIG_STM32_TIM2 is not set +# CONFIG_STM32_TIM3 is not set +# CONFIG_STM32_TIM4 is not set +# CONFIG_STM32_TIM5 is not set +# CONFIG_STM32_TIM6 is not set +# CONFIG_STM32_TIM7 is not set +# CONFIG_STM32_TIM8 is not set +# CONFIG_STM32_TIM9 is not set +# CONFIG_STM32_TIM10 is not set +# CONFIG_STM32_TIM11 is not set +# CONFIG_STM32_TIM12 is not set +# CONFIG_STM32_TIM13 is not set +# CONFIG_STM32_TIM14 is not set +# CONFIG_STM32_USART1 is not set +# CONFIG_STM32_USART2 is not set +CONFIG_STM32_USART3=y +# CONFIG_STM32_UART4 is not set +# CONFIG_STM32_UART5 is not set +# CONFIG_STM32_USART6 is not set +# CONFIG_STM32_IWDG is not set +# CONFIG_STM32_WWDG is not set +CONFIG_STM32_SPI=y +# CONFIG_STM32_NOEXT_VECTORS is not set + +# +# Alternate Pin Mapping +# +# CONFIG_STM32_FLASH_PREFETCH is not set +# CONFIG_STM32_FLASH_WORKAROUND_DATA_CACHE_CORRUPTION_ON_RWW is not set +# CONFIG_STM32_JTAG_DISABLE is not set +# CONFIG_STM32_JTAG_FULL_ENABLE is not set +# CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set +CONFIG_STM32_JTAG_SW_ENABLE=y +CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y +# CONFIG_STM32_FORCEPOWER is not set +# CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set +CONFIG_STM32_CCMEXCLUDE=y + +# +# Timer Configuration +# +# CONFIG_STM32_ONESHOT is not set +# CONFIG_STM32_FREERUN is not set +# CONFIG_STM32_TIM1_CAP is not set +# CONFIG_STM32_TIM2_CAP is not set +# CONFIG_STM32_TIM3_CAP is not set +# CONFIG_STM32_TIM4_CAP is not set +# CONFIG_STM32_TIM5_CAP is not set +# CONFIG_STM32_TIM8_CAP is not set +# CONFIG_STM32_TIM9_CAP is not set +# CONFIG_STM32_TIM10_CAP is not set +# CONFIG_STM32_TIM11_CAP is not set +# CONFIG_STM32_TIM12_CAP is not set +# CONFIG_STM32_TIM13_CAP is not set +# CONFIG_STM32_TIM14_CAP is not set +CONFIG_STM32_USART=y +CONFIG_STM32_SERIALDRIVER=y + +# +# U[S]ART Configuration +# + +# +# U[S]ART Device Configuration +# +CONFIG_STM32_USART3_SERIALDRIVER=y +# CONFIG_STM32_USART3_1WIREDRIVER is not set +# CONFIG_USART3_RS485 is not set + +# +# Serial Driver Configuration +# +# CONFIG_SERIAL_DISABLE_REORDERING is not set +# CONFIG_STM32_FLOWCONTROL_BROKEN is not set +# CONFIG_STM32_USART_BREAKS is not set +# CONFIG_STM32_USART_SINGLEWIRE is not set + +# +# SPI Configuration +# +# CONFIG_STM32_SPI_INTERRUPTS is not set +# CONFIG_STM32_SPI_DMA is not set +# CONFIG_STM32_HAVE_RTC_COUNTER is not set +# CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set + +# +# USB FS Host Configuration +# + +# +# USB HS Host Configuration +# + +# +# USB Host Debug Configuration +# + +# +# USB Device Configuration +# +# CONFIG_ARCH_TOOLCHAIN_IAR is not set +CONFIG_ARCH_TOOLCHAIN_GNU=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_VECNOTIRQ is not set +# CONFIG_ARCH_DMA is not set +CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +# CONFIG_ARCH_HAVE_MULTICPU is not set +CONFIG_ARCH_HAVE_VFORK=y +# CONFIG_ARCH_HAVE_MMU is not set +CONFIG_ARCH_HAVE_MPU=y +# CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set +# CONFIG_ARCH_HAVE_POWEROFF is not set +CONFIG_ARCH_HAVE_RESET=y +# CONFIG_ARCH_HAVE_RTC_SUBSECONDS is not set +# CONFIG_ARCH_USE_MPU is not set +# CONFIG_ARCH_IRQPRIO is not set +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set +CONFIG_ARCH_HAVE_RAMVECTORS=y +# CONFIG_ARCH_RAMVECTORS is not set +# CONFIG_ARCH_MINIMAL_VECTORTABLE is not set + +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=16717 +# CONFIG_ARCH_CALIBRATION is not set + +# +# Interrupt options +# +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 +CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set + +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set + +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=131072 +# CONFIG_ARCH_HAVE_SDRAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_CLICKER2_STM32=y +# CONFIG_ARCH_BOARD_STM32F4_DISCOVERY is not set +# CONFIG_ARCH_BOARD_MIKROE_STM32F4 is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="clicker2-stm32" + +# +# Common Board Options +# +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +CONFIG_ARCH_BUTTONS=y +CONFIG_ARCH_HAVE_IRQBUTTONS=y +CONFIG_ARCH_IRQBUTTONS=y + +# +# Board-Specific Options +# +CONFIG_CLICKER2_STM32_MB1_SPI=y +# CONFIG_CLICKER2_STM32_MB2_SPI is not set +CONFIG_CLICKER2_STM32_MB1_BEE=y +# CONFIG_CLICKER2_STM32_MB2_BEE is not set +# CONFIG_BOARD_CRASHDUMP is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +CONFIG_BOARDCTL_USBDEVCTRL=y +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set + +# +# RTOS Features +# +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_ENVIRON is not set + +# +# Clocks and Timers +# +CONFIG_ARCH_HAVE_TICKLESS=y +# CONFIG_SCHED_TICKLESS is not set +CONFIG_USEC_PER_TICK=10000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set +CONFIG_ARCH_HAVE_TIMEKEEPING=y +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2013 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=1 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=16 +CONFIG_WDOG_INTRESERVE=4 +CONFIG_PREALLOC_TIMERS=4 + +# +# Tasks and Scheduling +# +# CONFIG_SPINLOCK is not set +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_RR_INTERVAL=200 +# CONFIG_SCHED_SPORADIC is not set +CONFIG_TASK_NAME_SIZE=32 +CONFIG_MAX_TASKS=16 +# CONFIG_SCHED_HAVE_PARENT is not set +CONFIG_SCHED_WAITPID=y + +# +# Pthread Options +# +# CONFIG_PTHREAD_MUTEX_TYPES is not set +CONFIG_PTHREAD_MUTEX_ROBUST=y +# CONFIG_PTHREAD_MUTEX_UNSAFE is not set +# CONFIG_PTHREAD_MUTEX_BOTH is not set +CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set + +# +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +# CONFIG_SCHED_INSTRUMENTATION is not set + +# +# Files and I/O +# +# CONFIG_DEV_CONSOLE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +# CONFIG_PRIORITY_INHERITANCE is not set + +# +# RTOS hooks +# +CONFIG_BOARD_INITIALIZE=y +# CONFIG_BOARD_INITTHREAD is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set + +# +# Signal Numbers +# +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 + +# +# POSIX Message Queue Options +# +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 +# CONFIG_MODULE is not set + +# +# Work queue support +# +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 +# CONFIG_SCHED_LPWORK is not set + +# +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=2048 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=2048 +# CONFIG_LIB_SYSCALL is not set + +# +# Device Drivers +# +CONFIG_DISABLE_POLL=y +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set +# CONFIG_DEV_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set +# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set +# CONFIG_PWM is not set +CONFIG_ARCH_HAVE_I2CRESET=y +# CONFIG_I2C is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y +CONFIG_SPI=y +# CONFIG_SPI_SLAVE is not set +CONFIG_SPI_EXCHANGE=y +# CONFIG_SPI_CMDDATA is not set +# CONFIG_SPI_CALLBACK is not set +# CONFIG_SPI_HWFEATURES is not set +# CONFIG_SPI_BITORDER is not set +# CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI_DRIVER is not set +# CONFIG_SPI_BITBANG is not set +# CONFIG_I2S is not set + +# +# Timer Driver Support +# +# CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_AUDIO_DEVICES is not set +# CONFIG_VIDEO_DEVICES is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# +# CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set + +# +# LCD Driver Support +# +# CONFIG_LCD is not set +# CONFIG_SLCD is not set + +# +# LED Support +# +# CONFIG_USERLED is not set +# CONFIG_RGBLED is not set +# CONFIG_PCA9635PW is not set +# CONFIG_NCP5623C is not set +# CONFIG_MMCSD is not set +# CONFIG_MODEM is not set +# CONFIG_MTD is not set +# CONFIG_EEPROM is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +CONFIG_SERIAL=y +CONFIG_SERIAL_REMOVABLE=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_16550_UART is not set +# CONFIG_UART_SERIALDRIVER is not set +# CONFIG_UART0_SERIALDRIVER is not set +# CONFIG_UART1_SERIALDRIVER is not set +# CONFIG_UART2_SERIALDRIVER is not set +# CONFIG_UART3_SERIALDRIVER is not set +# CONFIG_UART4_SERIALDRIVER is not set +# CONFIG_UART5_SERIALDRIVER is not set +# CONFIG_UART6_SERIALDRIVER is not set +# CONFIG_UART7_SERIALDRIVER is not set +# CONFIG_UART8_SERIALDRIVER is not set +# CONFIG_SCI0_SERIALDRIVER is not set +# CONFIG_SCI1_SERIALDRIVER is not set +# CONFIG_USART0_SERIALDRIVER is not set +# CONFIG_USART1_SERIALDRIVER is not set +# CONFIG_USART2_SERIALDRIVER is not set +CONFIG_USART3_SERIALDRIVER=y +# CONFIG_USART4_SERIALDRIVER is not set +# CONFIG_USART5_SERIALDRIVER is not set +# CONFIG_USART6_SERIALDRIVER is not set +# CONFIG_USART7_SERIALDRIVER is not set +# CONFIG_USART8_SERIALDRIVER is not set +# CONFIG_OTHER_UART_SERIALDRIVER is not set +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +# CONFIG_SERIAL_DMA is not set +CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y +# CONFIG_USART3_SERIAL_CONSOLE is not set +# CONFIG_OTHER_SERIAL_CONSOLE is not set +CONFIG_NO_SERIAL_CONSOLE=y + +# +# USART3 Configuration +# +CONFIG_USART3_RXBUFSIZE=256 +CONFIG_USART3_TXBUFSIZE=256 +CONFIG_USART3_BAUD=115200 +CONFIG_USART3_BITS=8 +CONFIG_USART3_PARITY=0 +CONFIG_USART3_2STOP=0 +# CONFIG_USART3_IFLOWCONTROL is not set +# CONFIG_USART3_OFLOWCONTROL is not set +# CONFIG_USART3_DMA is not set +# CONFIG_PSEUDOTERM is not set +CONFIG_USBDEV=y + +# +# USB Device Controller Driver Options +# +# CONFIG_USBDEV_ISOCHRONOUS is not set +# CONFIG_USBDEV_DUALSPEED is not set +CONFIG_USBDEV_SELFPOWERED=y +# CONFIG_USBDEV_BUSPOWERED is not set +CONFIG_USBDEV_MAXPOWER=100 +# CONFIG_USBDEV_DMA is not set +# CONFIG_ARCH_USBDEV_STALLQUEUE is not set +# CONFIG_USBDEV_TRACE is not set + +# +# USB Device Class Driver Options +# +# CONFIG_USBDEV_COMPOSITE is not set +# CONFIG_PL2303 is not set +CONFIG_CDCACM=y +CONFIG_CDCACM_CONSOLE=y +CONFIG_CDCACM_EP0MAXPACKET=64 +CONFIG_CDCACM_EPINTIN=1 +CONFIG_CDCACM_EPINTIN_FSSIZE=64 +CONFIG_CDCACM_EPINTIN_HSSIZE=64 +CONFIG_CDCACM_EPBULKOUT=3 +CONFIG_CDCACM_EPBULKOUT_FSSIZE=64 +CONFIG_CDCACM_EPBULKOUT_HSSIZE=512 +CONFIG_CDCACM_EPBULKIN=2 +CONFIG_CDCACM_EPBULKIN_FSSIZE=64 +CONFIG_CDCACM_EPBULKIN_HSSIZE=512 +CONFIG_CDCACM_NRDREQS=4 +CONFIG_CDCACM_NWRREQS=4 +CONFIG_CDCACM_BULKIN_REQLEN=96 +CONFIG_CDCACM_RXBUFSIZE=256 +CONFIG_CDCACM_TXBUFSIZE=256 +CONFIG_CDCACM_VENDORID=0x0525 +CONFIG_CDCACM_PRODUCTID=0xa4a7 +CONFIG_CDCACM_VENDORSTR="NuttX" +CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial" +# CONFIG_USBMSC is not set +# CONFIG_USBHOST is not set +# CONFIG_USBMISC is not set +# CONFIG_HAVE_USBTRACE is not set +CONFIG_DRIVERS_WIRELESS=y +# CONFIG_WL_CC1101 is not set +# CONFIG_WL_CC3000 is not set +CONFIG_DRIVERS_IEEE802154=y +CONFIG_IEEE802154_MRF24J40=y +# CONFIG_IEEE802154_AT86RF233 is not set +# CONFIG_DRIVERS_IEEE80211 is not set +# CONFIG_WL_NRF24L01 is not set +# CONFIG_DRIVERS_CONTACTLESS is not set + +# +# System Logging +# +# CONFIG_ARCH_SYSLOG is not set +CONFIG_SYSLOG_WRITE=y +# CONFIG_RAMLOG is not set +# CONFIG_SYSLOG_BUFFER is not set +CONFIG_SYSLOG_INTBUFFER=y +CONFIG_SYSLOG_INTBUFSIZE=396 +# CONFIG_SYSLOG_TIMESTAMP is not set +# CONFIG_SYSLOG_SERIAL_CONSOLE is not set +CONFIG_SYSLOG_CHAR=y +# CONFIG_SYSLOG_NONE is not set +# CONFIG_SYSLOG_FILE is not set +CONFIG_SYSLOG_CHAR_CRLF=y +CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" +# CONFIG_SYSLOG_CHARDEV is not set + +# +# Networking Support +# +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set +# CONFIG_NET is not set + +# +# Crypto API +# +# CONFIG_CRYPTO is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_AUTOMOUNTER is not set +# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set +# CONFIG_PSEUDOFS_SOFTLINKS is not set +CONFIG_FS_READABLE=y +CONFIG_FS_WRITABLE=y +# CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" +# CONFIG_FS_RAMMAP is not set +CONFIG_FS_FAT=y +CONFIG_FAT_LCNAMES=y +CONFIG_FAT_LFN=y +CONFIG_FAT_MAXFNAME=32 +# CONFIG_FS_FATTIME is not set +# CONFIG_FAT_FORCE_INDIRECT is not set +# CONFIG_FAT_DMAMEMORY is not set +# CONFIG_FAT_DIRECT_RETRY is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set +# CONFIG_FS_TMPFS is not set +# CONFIG_FS_SMARTFS is not set +# CONFIG_FS_BINFS is not set +CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set + +# +# Exclude individual procfs entries +# +# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set +# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set +# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set +# CONFIG_FS_UNIONFS is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +# CONFIG_ARCH_HAVE_HEAP2 is not set +# CONFIG_GRAN is not set + +# +# Common I/O Buffer Support +# +CONFIG_MM_IOB=y +CONFIG_IOB_NBUFFERS=8 +CONFIG_IOB_BUFSIZE=196 +CONFIG_IOB_NCHAINS=0 +CONFIG_IOB_THROTTLE=0 + +# +# Audio Support +# +# CONFIG_AUDIO is not set + +# +# Wireless Support +# +CONFIG_WIRELESS=y +CONFIG_WIRELESS_IEEE802154=y +CONFIG_IEEE802154_DEFAULT_EADDR=0x00fade00deadbeef +CONFIG_IEEE802154_MAC_DEV=y +CONFIG_MAC802154_HPWORK=y +CONFIG_IEEE802154_NTXDESC=3 +CONFIG_IEEE802154_IND_PREALLOC=20 +CONFIG_IEEE802154_IND_IRQRESERVE=10 + +# +# Binary Loader +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +CONFIG_BUILTIN=y +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# + +# +# Standard C Library Options +# + +# +# Standard C I/O +# +# CONFIG_STDIO_DISABLE_BUFFERING is not set +CONFIG_STDIO_BUFFER_SIZE=64 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +CONFIG_LIBC_LONG_LONG=y +# CONFIG_LIBC_SCANSET is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_MEMCPY_VIK is not set +# CONFIG_LIBM is not set + +# +# Architecture-Specific Support +# +CONFIG_ARCH_LOWPUTC=y +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_LIBC_ARCH_MEMCPY is not set +# CONFIG_LIBC_ARCH_MEMCMP is not set +# CONFIG_LIBC_ARCH_MEMMOVE is not set +# CONFIG_LIBC_ARCH_MEMSET is not set +# CONFIG_LIBC_ARCH_STRCHR is not set +# CONFIG_LIBC_ARCH_STRCMP is not set +# CONFIG_LIBC_ARCH_STRCPY is not set +# CONFIG_LIBC_ARCH_STRNCPY is not set +# CONFIG_LIBC_ARCH_STRLEN is not set +# CONFIG_LIBC_ARCH_STRNLEN is not set +# CONFIG_LIBC_ARCH_ELF is not set +# CONFIG_ARMV7M_MEMCPY is not set + +# +# stdlib Options +# +CONFIG_LIB_RAND_ORDER=1 +CONFIG_LIB_HOMEDIR="/" +CONFIG_LIBC_TMPDIR="/tmp" +CONFIG_LIBC_MAX_TMPFILE=32 + +# +# Program Execution Options +# +# CONFIG_LIBC_EXECFUNCS is not set +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 + +# +# errno Decode Support +# +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set + +# +# memcpy/memset Options +# +# CONFIG_MEMSET_OPTSPEED is not set +# CONFIG_LIBC_DLLFCN is not set +# CONFIG_LIBC_MODLIB is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set + +# +# Time/Time Zone Support +# +# CONFIG_LIBC_LOCALTIME is not set +# CONFIG_TIME_EXTENDED is not set +CONFIG_ARCH_HAVE_TLS=y + +# +# Thread Local Storage (TLS) +# +# CONFIG_TLS is not set + +# +# Network-Related Options +# +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set +# CONFIG_LIBC_NETDB is not set + +# +# NETDB Support +# +# CONFIG_NETDB_HOSTFILE is not set +# CONFIG_LIBC_IOCTL_VARIADIC is not set +CONFIG_LIB_SENDFILE_BUFSIZE=512 + +# +# Non-standard Library Support +# +# CONFIG_LIB_CRC64_FAST is not set +# CONFIG_LIB_KBDCODEC is not set +# CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +CONFIG_HAVE_CXX=y +# CONFIG_CXX_NEWLONG is not set + +# +# LLVM C++ Library (libcxx) +# +# CONFIG_LIBCXX is not set + +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set + +# +# Application Configuration +# + +# +# Built-In Applications +# +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + +# +# CAN Utilities +# + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set +# CONFIG_EXAMPLES_CHAT is not set +# CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CXXTEST is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FSTEST is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_MEDIA is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_NRF24L01TERM is not set +CONFIG_EXAMPLES_NSH=y +CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTERM is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PCA9635 is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set +# CONFIG_EXAMPLES_RGBLED is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMART_TEST is not set +# CONFIG_EXAMPLES_SMP is not set +# CONFIG_EXAMPLES_STAT is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_XBC_TEST is not set + +# +# File System Utilities +# +# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set + +# +# GPS Utilities +# +# CONFIG_GPSUTILS_MINMEA_LIB is not set + +# +# Graphics Support +# +# CONFIG_TIFF is not set +# CONFIG_GRAPHICS_TRAVELER is not set + +# +# Interpreters +# +# CONFIG_INTERPRETERS_BAS is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set + +# +# Network Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_ESP8266 is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_SMTP is not set + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set + +# +# Command Line Configuration +# +CONFIG_NSH_READLINE=y +# CONFIG_NSH_CLE is not set +CONFIG_NSH_LINELEN=64 +# CONFIG_NSH_DISABLE_SEMICOLON is not set +CONFIG_NSH_CMDPARMS=y +CONFIG_NSH_MAXARGUMENTS=6 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_BUILTIN_APPS=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_ADDROUTE is not set +# CONFIG_NSH_DISABLE_BASENAME is not set +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_CMP is not set +CONFIG_NSH_DISABLE_DATE=y +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_DF is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set +# CONFIG_NSH_DISABLE_DIRNAME is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +CONFIG_NSH_DISABLE_GET=y +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +CONFIG_NSH_DISABLE_IFUPDOWN=y +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +CONFIG_NSH_DISABLE_LOSMART=y +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFATFS is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MV is not set +# CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y +# CONFIG_NSH_DISABLE_PS is not set +CONFIG_NSH_DISABLE_PUT=y +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNAME is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +CONFIG_NSH_DISABLE_WGET=y +# CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 + +# +# Configure Command Options +# +# CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set +CONFIG_NSH_CODECS_BUFSIZE=128 +CONFIG_NSH_CMDOPT_HEXDUMP=y +CONFIG_NSH_PROC_MOUNTPOINT="/proc" +CONFIG_NSH_FILEIOSIZE=512 + +# +# Scripting Support +# +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set + +# +# Console Configuration +# +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_USBCONSOLE is not set +# CONFIG_NSH_ALTCONDEV is not set +CONFIG_NSH_ARCHINIT=y +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set + +# +# NxWidgets/NxWM +# + +# +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set +CONFIG_HAVE_CXXINITIALIZE=y + +# +# System Libraries and NSH Add-Ons +# +# CONFIG_SYSTEM_CDCACM is not set +# CONFIG_SYSTEM_CLE is not set +# CONFIG_SYSTEM_CUTERM is not set +# CONFIG_SYSTEM_FREE is not set +# CONFIG_SYSTEM_HEX2BIN is not set +# CONFIG_SYSTEM_HEXED is not set +# CONFIG_SYSTEM_INSTALL is not set +# CONFIG_SYSTEM_RAMTEST is not set +CONFIG_READLINE_HAVE_EXTMATCH=y +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y +# CONFIG_READLINE_TABCOMPLETION is not set +# CONFIG_READLINE_CMD_HISTORY is not set +# CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set +# CONFIG_SYSTEM_UBLOXMODEM is not set +# CONFIG_SYSTEM_VI is not set +# CONFIG_SYSTEM_ZMODEM is not set + +# +# Wireless Libraries and NSH Add-Ons +# + +# +# IEEE 802.15.4 applications +# +CONFIG_IEEE802154_LIBMAC=y +CONFIG_IEEE802154_LIBUTILS=y +CONFIG_IEEE802154_I8SAK=y +CONFIG_IEEE802154_I8SAK_PRIORITY=100 +CONFIG_IEEE802154_I8SAK_STACKSIZE=2048 diff --git a/configs/clicker2-stm32/mrf24j40-mac/defconfig b/configs/clicker2-stm32/mrf24j40-mac/defconfig index 2455c08c41..41ced67c47 100644 --- a/configs/clicker2-stm32/mrf24j40-mac/defconfig +++ b/configs/clicker2-stm32/mrf24j40-mac/defconfig @@ -16,7 +16,7 @@ CONFIG_HOST_LINUX=y # # Build Configuration # -CONFIG_APPS_DIR="../apps" +# CONFIG_APPS_DIR="../apps" CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set diff --git a/configs/clicker2-stm32/nsh/defconfig b/configs/clicker2-stm32/nsh/defconfig index ae4b8ff23c..0fb4bd7cdc 100644 --- a/configs/clicker2-stm32/nsh/defconfig +++ b/configs/clicker2-stm32/nsh/defconfig @@ -120,12 +120,11 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="stm32" -# CONFIG_ARCH_TOOLCHAIN_IAR is not set # CONFIG_ARMV7M_USEBASEPRI is not set CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARMV7M_CMNVECTOR is not set @@ -394,6 +393,7 @@ CONFIG_STM32_HAVE_I2C2=y CONFIG_STM32_HAVE_I2C3=y CONFIG_STM32_HAVE_SPI2=y CONFIG_STM32_HAVE_SPI3=y +CONFIG_STM32_HAVE_I2S3=y # CONFIG_STM32_HAVE_SPI4 is not set # CONFIG_STM32_HAVE_SPI5 is not set # CONFIG_STM32_HAVE_SPI6 is not set @@ -432,6 +432,7 @@ CONFIG_STM32_PWR=y # CONFIG_STM32_SPI1 is not set # CONFIG_STM32_SPI2 is not set # CONFIG_STM32_SPI3 is not set +# CONFIG_STM32_I2S3 is not set CONFIG_STM32_SYSCFG=y # CONFIG_STM32_TIM1 is not set # CONFIG_STM32_TIM2 is not set @@ -527,6 +528,7 @@ CONFIG_STM32_USART3_SERIALDRIVER=y # # USB Device Configuration # +# CONFIG_ARCH_TOOLCHAIN_IAR is not set CONFIG_ARCH_TOOLCHAIN_GNU=y # @@ -1075,7 +1077,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # CONFIG_C99_BOOL8 is not set CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_CXX_NEWLONG is not set # @@ -1305,6 +1306,7 @@ CONFIG_NSH_CONSOLE=y # Platform-specific Support # # CONFIG_PLATFORM_CONFIGDATA is not set +CONFIG_HAVE_CXXINITIALIZE=y # # System Libraries and NSH Add-Ons diff --git a/configs/clicker2-stm32/usbnsh/defconfig b/configs/clicker2-stm32/usbnsh/defconfig index c82313ce75..3db2eabaaf 100644 --- a/configs/clicker2-stm32/usbnsh/defconfig +++ b/configs/clicker2-stm32/usbnsh/defconfig @@ -120,12 +120,11 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="stm32" -# CONFIG_ARCH_TOOLCHAIN_IAR is not set # CONFIG_ARMV7M_USEBASEPRI is not set CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARMV7M_CMNVECTOR is not set @@ -394,6 +393,7 @@ CONFIG_STM32_HAVE_I2C2=y CONFIG_STM32_HAVE_I2C3=y CONFIG_STM32_HAVE_SPI2=y CONFIG_STM32_HAVE_SPI3=y +CONFIG_STM32_HAVE_I2S3=y # CONFIG_STM32_HAVE_SPI4 is not set # CONFIG_STM32_HAVE_SPI5 is not set # CONFIG_STM32_HAVE_SPI6 is not set @@ -432,6 +432,7 @@ CONFIG_STM32_PWR=y # CONFIG_STM32_SPI1 is not set # CONFIG_STM32_SPI2 is not set # CONFIG_STM32_SPI3 is not set +# CONFIG_STM32_I2S3 is not set CONFIG_STM32_SYSCFG=y # CONFIG_STM32_TIM1 is not set # CONFIG_STM32_TIM2 is not set @@ -527,6 +528,7 @@ CONFIG_STM32_USART3_SERIALDRIVER=y # # USB Device Configuration # +# CONFIG_ARCH_TOOLCHAIN_IAR is not set CONFIG_ARCH_TOOLCHAIN_GNU=y # @@ -1124,7 +1126,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # CONFIG_C99_BOOL8 is not set CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_CXX_NEWLONG is not set # @@ -1356,6 +1357,7 @@ CONFIG_NSH_ARCHINIT=y # Platform-specific Support # # CONFIG_PLATFORM_CONFIGDATA is not set +CONFIG_HAVE_CXXINITIALIZE=y # # System Libraries and NSH Add-Ons From cd54a0340fad497a3d671be355e8966f1cc5b0ed Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 14:29:09 -0600 Subject: [PATCH 38/55] Fix a typo. And typo in Kconfig file is reflect in all defconfig files. --- configs/arduino-due/nsh/defconfig | 2 +- configs/bambino-200e/netnsh/defconfig | 2 +- configs/bambino-200e/nsh/defconfig | 2 +- configs/bambino-200e/usbnsh/defconfig | 2 +- configs/c5471evm/httpd/defconfig | 2 +- configs/c5471evm/nettest/defconfig | 2 +- configs/c5471evm/nsh/defconfig | 2 +- configs/cc3200-launchpad/nsh/defconfig | 2 +- configs/clicker2-stm32/knsh/defconfig | 2 +- configs/clicker2-stm32/mrf24j40-radio/defconfig | 2 +- configs/clicker2-stm32/nsh/defconfig | 2 +- configs/clicker2-stm32/usbnsh/defconfig | 2 +- configs/cloudctrl/nsh/defconfig | 2 +- configs/dk-tm4c129x/ipv6/defconfig | 2 +- configs/dk-tm4c129x/nsh/defconfig | 2 +- configs/ea3131/nsh/defconfig | 2 +- configs/ea3131/pgnsh/defconfig | 2 +- configs/ea3131/usbserial/defconfig | 2 +- configs/ea3152/ostest/defconfig | 2 +- configs/eagle100/httpd/defconfig | 2 +- configs/eagle100/nettest/defconfig | 2 +- configs/eagle100/nsh/defconfig | 2 +- configs/eagle100/nxflat/defconfig | 2 +- configs/eagle100/thttpd/defconfig | 2 +- configs/efm32-g8xx-stk/nsh/defconfig | 2 +- configs/efm32gg-stk3700/nsh/defconfig | 2 +- configs/ekk-lm3s9b96/nsh/defconfig | 2 +- configs/fire-stm32v2/nsh/defconfig | 2 +- configs/freedom-k64f/netnsh/defconfig | 2 +- configs/freedom-k64f/nsh/defconfig | 2 +- configs/freedom-k66f/netnsh/defconfig | 2 +- configs/freedom-k66f/nsh/defconfig | 2 +- configs/freedom-kl25z/nsh/defconfig | 2 +- configs/freedom-kl26z/nsh/defconfig | 2 +- configs/hymini-stm32v/nsh/defconfig | 2 +- configs/hymini-stm32v/nsh2/defconfig | 2 +- configs/hymini-stm32v/usbmsc/defconfig | 2 +- configs/hymini-stm32v/usbnsh/defconfig | 2 +- configs/hymini-stm32v/usbserial/defconfig | 2 +- configs/kwikstik-k40/ostest/defconfig | 2 +- configs/launchxl-tms57004/nsh/defconfig | 2 +- configs/lincoln60/netnsh/defconfig | 2 +- configs/lincoln60/nsh/defconfig | 2 +- configs/lincoln60/thttpd-binfs/defconfig | 2 +- configs/lm3s6432-s2e/nsh/defconfig | 2 +- configs/lm3s6965-ek/discover/defconfig | 2 +- configs/lm3s6965-ek/nsh/defconfig | 2 +- configs/lm3s6965-ek/nx/defconfig | 2 +- configs/lm3s6965-ek/tcpecho/defconfig | 2 +- configs/lm3s8962-ek/nsh/defconfig | 2 +- configs/lm3s8962-ek/nx/defconfig | 2 +- configs/lm4f120-launchpad/nsh/defconfig | 2 +- configs/lpc4330-xplorer/nsh/defconfig | 2 +- configs/lpc4337-ws/nsh/defconfig | 2 +- configs/lpc4357-evb/nsh/defconfig | 2 +- configs/lpc4370-link2/nsh/defconfig | 2 +- configs/lpcxpresso-lpc1115/nsh/defconfig | 2 +- configs/lpcxpresso-lpc1768/dhcpd/defconfig | 2 +- configs/lpcxpresso-lpc1768/nsh/defconfig | 2 +- configs/lpcxpresso-lpc1768/nx/defconfig | 2 +- configs/lpcxpresso-lpc1768/thttpd/defconfig | 2 +- configs/lpcxpresso-lpc1768/usbmsc/defconfig | 2 +- configs/maple/nsh/defconfig | 2 +- configs/maple/nx/defconfig | 2 +- configs/maple/usbnsh/defconfig | 2 +- configs/mbed/nsh/defconfig | 2 +- configs/mcu123-lpc214x/composite/defconfig | 2 +- configs/mcu123-lpc214x/nsh/defconfig | 2 +- configs/mcu123-lpc214x/usbmsc/defconfig | 2 +- configs/mcu123-lpc214x/usbserial/defconfig | 2 +- configs/mikroe-stm32f4/fulldemo/defconfig | 2 +- configs/mikroe-stm32f4/kostest/defconfig | 2 +- configs/mikroe-stm32f4/nsh/defconfig | 2 +- configs/mikroe-stm32f4/nx/defconfig | 2 +- configs/mikroe-stm32f4/nxlines/defconfig | 2 +- configs/mikroe-stm32f4/nxtext/defconfig | 2 +- configs/mikroe-stm32f4/usbnsh/defconfig | 2 +- configs/moxa/nsh/defconfig | 2 +- configs/mx1ads/ostest/defconfig | 2 +- configs/ntosd-dm320/nettest/defconfig | 2 +- configs/ntosd-dm320/nsh/defconfig | 2 +- configs/ntosd-dm320/poll/defconfig | 2 +- configs/ntosd-dm320/thttpd/defconfig | 2 +- configs/ntosd-dm320/udp/defconfig | 2 +- configs/ntosd-dm320/webserver/defconfig | 2 +- configs/nucleo-144/f746-evalos/defconfig | 2 +- configs/nucleo-144/f746-nsh/defconfig | 2 +- configs/nucleo-144/f767-evalos/defconfig | 2 +- configs/nucleo-144/f767-nsh/defconfig | 2 +- configs/nucleo-f072rb/nsh/defconfig | 2 +- configs/nucleo-f091rc/nsh/defconfig | 2 +- configs/nucleo-f303re/adc/defconfig | 2 +- configs/nucleo-f303re/can/defconfig | 2 +- configs/nucleo-f303re/hello/defconfig | 2 +- configs/nucleo-f303re/nxlines/defconfig | 2 +- configs/nucleo-f303re/pwm/defconfig | 2 +- configs/nucleo-f303re/serialrx/defconfig | 2 +- configs/nucleo-f303re/uavcan/defconfig | 2 +- configs/nucleo-f334r8/adc/defconfig | 2 +- configs/nucleo-f334r8/nsh/defconfig | 2 +- configs/nucleo-f4x1re/f401-nsh/defconfig | 2 +- configs/nucleo-f4x1re/f411-nsh/defconfig | 2 +- configs/nucleo-l432kc/nsh/defconfig | 2 +- configs/nucleo-l452re/nsh/defconfig | 2 +- configs/nucleo-l476rg/nsh/defconfig | 2 +- configs/nucleo-l496zg/nsh/defconfig | 2 +- configs/nutiny-nuc120/nsh/defconfig | 2 +- configs/olimex-efm32g880f128-stk/nsh/defconfig | 2 +- configs/olimex-lpc-h3131/nsh/defconfig | 2 +- configs/olimex-lpc1766stk/ftpc/defconfig | 2 +- configs/olimex-lpc1766stk/hidmouse/defconfig | 2 +- configs/olimex-lpc1766stk/nettest/defconfig | 2 +- configs/olimex-lpc1766stk/nsh/defconfig | 2 +- configs/olimex-lpc1766stk/nx/defconfig | 2 +- configs/olimex-lpc1766stk/slip-httpd/defconfig | 2 +- configs/olimex-lpc1766stk/thttpd-binfs/defconfig | 2 +- configs/olimex-lpc1766stk/thttpd-nxflat/defconfig | 2 +- configs/olimex-lpc1766stk/usbmsc/defconfig | 2 +- configs/olimex-lpc1766stk/usbserial/defconfig | 2 +- configs/olimex-lpc1766stk/zmodem/defconfig | 2 +- configs/olimex-lpc2378/nsh/defconfig | 2 +- configs/olimex-stm32-e407/discover/defconfig | 2 +- configs/olimex-stm32-e407/netnsh/defconfig | 2 +- configs/olimex-stm32-e407/nsh/defconfig | 2 +- configs/olimex-stm32-e407/telnetd/defconfig | 2 +- configs/olimex-stm32-e407/usbnsh/defconfig | 2 +- configs/olimex-stm32-e407/webserver/defconfig | 2 +- configs/olimex-stm32-h405/usbnsh/defconfig | 2 +- configs/olimex-stm32-h407/nsh/defconfig | 2 +- configs/olimex-stm32-p107/nsh/defconfig | 2 +- configs/olimex-stm32-p207/nsh/defconfig | 2 +- configs/olimex-stm32-p407/knsh/defconfig | 2 +- configs/olimex-stm32-p407/nsh/defconfig | 2 +- configs/olimex-strp711/nettest/defconfig | 2 +- configs/olimex-strp711/nsh/defconfig | 2 +- configs/olimexino-stm32/can/defconfig | 2 +- configs/olimexino-stm32/composite/defconfig | 2 +- configs/olimexino-stm32/nsh/defconfig | 2 +- configs/olimexino-stm32/smallnsh/defconfig | 2 +- configs/olimexino-stm32/tiny/defconfig | 2 +- configs/open1788/knsh/defconfig | 2 +- configs/open1788/nsh/defconfig | 2 +- configs/open1788/nxlines/defconfig | 2 +- configs/pcduino-a10/nsh/defconfig | 2 +- configs/photon/nsh/defconfig | 2 +- configs/photon/usbnsh/defconfig | 2 +- configs/photon/wlan/defconfig | 2 +- configs/sabre-6quad/nsh/defconfig | 2 +- configs/sabre-6quad/smp/defconfig | 2 +- configs/sam3u-ek/knsh/defconfig | 2 +- configs/sam3u-ek/nsh/defconfig | 2 +- configs/sam3u-ek/nx/defconfig | 2 +- configs/sam3u-ek/nxwm/defconfig | 2 +- configs/sam4cmp-db/nsh/defconfig | 2 +- configs/sam4e-ek/nsh/defconfig | 2 +- configs/sam4e-ek/nxwm/defconfig | 2 +- configs/sam4e-ek/usbnsh/defconfig | 2 +- configs/sam4l-xplained/nsh/defconfig | 2 +- configs/sam4s-xplained-pro/nsh/defconfig | 2 +- configs/sam4s-xplained/nsh/defconfig | 2 +- configs/sama5d2-xult/nsh/defconfig | 2 +- configs/sama5d3-xplained/bridge/defconfig | 2 +- configs/sama5d3-xplained/nsh/defconfig | 2 +- configs/sama5d3x-ek/demo/defconfig | 2 +- configs/sama5d3x-ek/hello/defconfig | 2 +- configs/sama5d3x-ek/norboot/defconfig | 2 +- configs/sama5d3x-ek/nsh/defconfig | 2 +- configs/sama5d3x-ek/nx/defconfig | 2 +- configs/sama5d3x-ek/nxplayer/defconfig | 2 +- configs/sama5d3x-ek/nxwm/defconfig | 2 +- configs/sama5d3x-ek/ov2640/defconfig | 2 +- configs/sama5d4-ek/at25boot/defconfig | 2 +- configs/sama5d4-ek/bridge/defconfig | 2 +- configs/sama5d4-ek/dramboot/defconfig | 2 +- configs/sama5d4-ek/elf/defconfig | 2 +- configs/sama5d4-ek/ipv6/defconfig | 2 +- configs/sama5d4-ek/knsh/defconfig | 2 +- configs/sama5d4-ek/nsh/defconfig | 2 +- configs/sama5d4-ek/nxwm/defconfig | 2 +- configs/sama5d4-ek/ramtest/defconfig | 2 +- configs/samd20-xplained/nsh/defconfig | 2 +- configs/samd21-xplained/nsh/defconfig | 2 +- configs/same70-xplained/netnsh/defconfig | 2 +- configs/same70-xplained/nsh/defconfig | 2 +- configs/saml21-xplained/nsh/defconfig | 2 +- configs/samv71-xult/knsh/defconfig | 2 +- configs/samv71-xult/module/defconfig | 2 +- configs/samv71-xult/mxtxplnd/defconfig | 2 +- configs/samv71-xult/netnsh/defconfig | 2 +- configs/samv71-xult/nsh/defconfig | 2 +- configs/samv71-xult/nxwm/defconfig | 2 +- configs/samv71-xult/vnc/defconfig | 2 +- configs/samv71-xult/vnxwm/defconfig | 2 +- configs/shenzhou/nsh/defconfig | 2 +- configs/shenzhou/nxwm/defconfig | 2 +- configs/shenzhou/thttpd/defconfig | 2 +- configs/spark/composite/defconfig | 2 +- configs/spark/nsh/defconfig | 2 +- configs/spark/usbmsc/defconfig | 2 +- configs/spark/usbnsh/defconfig | 2 +- configs/spark/usbserial/defconfig | 2 +- configs/stm3210e-eval/composite/defconfig | 2 +- configs/stm3210e-eval/nsh/defconfig | 2 +- configs/stm3210e-eval/nsh2/defconfig | 2 +- configs/stm3210e-eval/nx/defconfig | 2 +- configs/stm3210e-eval/nxterm/defconfig | 2 +- configs/stm3210e-eval/pm/defconfig | 2 +- configs/stm3210e-eval/usbmsc/defconfig | 2 +- configs/stm3210e-eval/usbserial/defconfig | 2 +- configs/stm3220g-eval/dhcpd/defconfig | 2 +- configs/stm3220g-eval/nettest/defconfig | 2 +- configs/stm3220g-eval/nsh/defconfig | 2 +- configs/stm3220g-eval/nsh2/defconfig | 2 +- configs/stm3220g-eval/nxwm/defconfig | 2 +- configs/stm3220g-eval/telnetd/defconfig | 2 +- configs/stm3240g-eval/dhcpd/defconfig | 2 +- configs/stm3240g-eval/discover/defconfig | 2 +- configs/stm3240g-eval/knxwm/defconfig | 2 +- configs/stm3240g-eval/nettest/defconfig | 2 +- configs/stm3240g-eval/nsh/defconfig | 2 +- configs/stm3240g-eval/nsh2/defconfig | 2 +- configs/stm3240g-eval/nxterm/defconfig | 2 +- configs/stm3240g-eval/nxwm/defconfig | 2 +- configs/stm3240g-eval/telnetd/defconfig | 2 +- configs/stm3240g-eval/webserver/defconfig | 2 +- configs/stm3240g-eval/xmlrpc/defconfig | 2 +- configs/stm32_tiny/nsh/defconfig | 2 +- configs/stm32_tiny/usbnsh/defconfig | 2 +- configs/stm32butterfly2/nsh/defconfig | 2 +- configs/stm32butterfly2/nshnet/defconfig | 2 +- configs/stm32butterfly2/nshusbdev/defconfig | 2 +- configs/stm32butterfly2/nshusbhost/defconfig | 2 +- configs/stm32f0discovery/nsh/defconfig | 2 +- configs/stm32f103-minimum/audio_tone/defconfig | 2 +- configs/stm32f103-minimum/buttons/defconfig | 2 +- configs/stm32f103-minimum/jlx12864g/defconfig | 2 +- configs/stm32f103-minimum/mcp2515/defconfig | 2 +- configs/stm32f103-minimum/nrf24/defconfig | 2 +- configs/stm32f103-minimum/nsh/defconfig | 2 +- configs/stm32f103-minimum/pwm/defconfig | 2 +- configs/stm32f103-minimum/rfid-rc522/defconfig | 2 +- configs/stm32f103-minimum/rgbled/defconfig | 2 +- configs/stm32f103-minimum/usbnsh/defconfig | 2 +- configs/stm32f103-minimum/userled/defconfig | 2 +- configs/stm32f103-minimum/veml6070/defconfig | 2 +- configs/stm32f3discovery/nsh/defconfig | 2 +- configs/stm32f3discovery/usbnsh/defconfig | 2 +- configs/stm32f411e-disco/nsh/defconfig | 2 +- configs/stm32f429i-disco/extflash/defconfig | 2 +- configs/stm32f429i-disco/lcd/defconfig | 2 +- configs/stm32f429i-disco/ltdc/defconfig | 2 +- configs/stm32f429i-disco/nsh/defconfig | 2 +- configs/stm32f429i-disco/nxwm/defconfig | 2 +- configs/stm32f429i-disco/usbmsc/defconfig | 2 +- configs/stm32f429i-disco/usbnsh/defconfig | 2 +- configs/stm32f4discovery/canard/defconfig | 2 +- configs/stm32f4discovery/cxxtest/defconfig | 2 +- configs/stm32f4discovery/elf/defconfig | 2 +- configs/stm32f4discovery/ipv6/defconfig | 2 +- configs/stm32f4discovery/kostest/defconfig | 2 +- configs/stm32f4discovery/netnsh/defconfig | 2 +- configs/stm32f4discovery/nsh/defconfig | 2 +- configs/stm32f4discovery/nxlines/defconfig | 2 +- configs/stm32f4discovery/pm/defconfig | 2 +- configs/stm32f4discovery/posix_spawn/defconfig | 2 +- configs/stm32f4discovery/pseudoterm/defconfig | 2 +- configs/stm32f4discovery/rgbled/defconfig | 2 +- configs/stm32f4discovery/uavcan/defconfig | 2 +- configs/stm32f4discovery/usbnsh/defconfig | 2 +- configs/stm32f4discovery/xen1210/defconfig | 2 +- configs/stm32f746-ws/nsh/defconfig | 2 +- configs/stm32f746g-disco/nsh/defconfig | 2 +- configs/stm32l476-mdk/nsh/defconfig | 2 +- configs/stm32l476vg-disco/nsh/defconfig | 2 +- configs/stm32ldiscovery/nsh/defconfig | 2 +- configs/stm32vldiscovery/nsh/defconfig | 2 +- configs/teensy-3.x/nsh/defconfig | 2 +- configs/teensy-3.x/usbnsh/defconfig | 2 +- configs/teensy-lc/nsh/defconfig | 2 +- configs/tm4c123g-launchpad/nsh/defconfig | 2 +- configs/tm4c1294-launchpad/ipv6/defconfig | 2 +- configs/tm4c1294-launchpad/nsh/defconfig | 2 +- configs/twr-k60n512/nsh/defconfig | 2 +- configs/twr-k64f120m/netnsh/defconfig | 2 +- configs/twr-k64f120m/nsh/defconfig | 2 +- configs/u-blox-c027/nsh/defconfig | 2 +- configs/viewtool-stm32f107/highpri/defconfig | 2 +- configs/viewtool-stm32f107/netnsh/defconfig | 2 +- configs/viewtool-stm32f107/nsh/defconfig | 2 +- configs/xmc4500-relax/nsh/defconfig | 2 +- configs/zkit-arm-1769/hello/defconfig | 2 +- configs/zkit-arm-1769/nsh/defconfig | 2 +- configs/zkit-arm-1769/nxhello/defconfig | 2 +- configs/zkit-arm-1769/thttpd/defconfig | 2 +- configs/zp214xpa/nsh/defconfig | 2 +- configs/zp214xpa/nxlines/defconfig | 2 +- 296 files changed, 296 insertions(+), 296 deletions(-) diff --git a/configs/arduino-due/nsh/defconfig b/configs/arduino-due/nsh/defconfig index e1101645f9..0c74534397 100644 --- a/configs/arduino-due/nsh/defconfig +++ b/configs/arduino-due/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/bambino-200e/netnsh/defconfig b/configs/bambino-200e/netnsh/defconfig index 5cad2e7172..4c577358ab 100644 --- a/configs/bambino-200e/netnsh/defconfig +++ b/configs/bambino-200e/netnsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/bambino-200e/nsh/defconfig b/configs/bambino-200e/nsh/defconfig index fc72cef1ae..656e239b04 100644 --- a/configs/bambino-200e/nsh/defconfig +++ b/configs/bambino-200e/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/bambino-200e/usbnsh/defconfig b/configs/bambino-200e/usbnsh/defconfig index 558c13c30e..d8a0e87737 100644 --- a/configs/bambino-200e/usbnsh/defconfig +++ b/configs/bambino-200e/usbnsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/c5471evm/httpd/defconfig b/configs/c5471evm/httpd/defconfig index 227ca4a58a..29f7ec3ae8 100644 --- a/configs/c5471evm/httpd/defconfig +++ b/configs/c5471evm/httpd/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/c5471evm/nettest/defconfig b/configs/c5471evm/nettest/defconfig index 7df297ee2c..45f9e58c62 100644 --- a/configs/c5471evm/nettest/defconfig +++ b/configs/c5471evm/nettest/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/c5471evm/nsh/defconfig b/configs/c5471evm/nsh/defconfig index 5dff7fac5f..8c1db41cf2 100644 --- a/configs/c5471evm/nsh/defconfig +++ b/configs/c5471evm/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/cc3200-launchpad/nsh/defconfig b/configs/cc3200-launchpad/nsh/defconfig index f0db72f06e..53a2f00513 100644 --- a/configs/cc3200-launchpad/nsh/defconfig +++ b/configs/cc3200-launchpad/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/clicker2-stm32/knsh/defconfig b/configs/clicker2-stm32/knsh/defconfig index caa991f103..b75ba40a8d 100644 --- a/configs/clicker2-stm32/knsh/defconfig +++ b/configs/clicker2-stm32/knsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/clicker2-stm32/mrf24j40-radio/defconfig b/configs/clicker2-stm32/mrf24j40-radio/defconfig index b258d177c3..706cddb21e 100644 --- a/configs/clicker2-stm32/mrf24j40-radio/defconfig +++ b/configs/clicker2-stm32/mrf24j40-radio/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/clicker2-stm32/nsh/defconfig b/configs/clicker2-stm32/nsh/defconfig index ae4b8ff23c..c2dbc420a8 100644 --- a/configs/clicker2-stm32/nsh/defconfig +++ b/configs/clicker2-stm32/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/clicker2-stm32/usbnsh/defconfig b/configs/clicker2-stm32/usbnsh/defconfig index c82313ce75..1cf52249ef 100644 --- a/configs/clicker2-stm32/usbnsh/defconfig +++ b/configs/clicker2-stm32/usbnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/cloudctrl/nsh/defconfig b/configs/cloudctrl/nsh/defconfig index 5f87a306d1..6d04d18d25 100644 --- a/configs/cloudctrl/nsh/defconfig +++ b/configs/cloudctrl/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/dk-tm4c129x/ipv6/defconfig b/configs/dk-tm4c129x/ipv6/defconfig index 0e08299917..be1d710871 100644 --- a/configs/dk-tm4c129x/ipv6/defconfig +++ b/configs/dk-tm4c129x/ipv6/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/dk-tm4c129x/nsh/defconfig b/configs/dk-tm4c129x/nsh/defconfig index 8b8ea559d0..8e12ecd745 100644 --- a/configs/dk-tm4c129x/nsh/defconfig +++ b/configs/dk-tm4c129x/nsh/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/ea3131/nsh/defconfig b/configs/ea3131/nsh/defconfig index 5820f7eb95..82b66982bf 100644 --- a/configs/ea3131/nsh/defconfig +++ b/configs/ea3131/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ea3131/pgnsh/defconfig b/configs/ea3131/pgnsh/defconfig index c70463809c..e125edb112 100644 --- a/configs/ea3131/pgnsh/defconfig +++ b/configs/ea3131/pgnsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ea3131/usbserial/defconfig b/configs/ea3131/usbserial/defconfig index 6acce61b13..e48e8bf072 100644 --- a/configs/ea3131/usbserial/defconfig +++ b/configs/ea3131/usbserial/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ea3152/ostest/defconfig b/configs/ea3152/ostest/defconfig index 188d64ca4a..f875b4fec7 100644 --- a/configs/ea3152/ostest/defconfig +++ b/configs/ea3152/ostest/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/eagle100/httpd/defconfig b/configs/eagle100/httpd/defconfig index 2f5fac899d..cc1bd3fea5 100644 --- a/configs/eagle100/httpd/defconfig +++ b/configs/eagle100/httpd/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/eagle100/nettest/defconfig b/configs/eagle100/nettest/defconfig index bec8a97047..228d044b6d 100644 --- a/configs/eagle100/nettest/defconfig +++ b/configs/eagle100/nettest/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/eagle100/nsh/defconfig b/configs/eagle100/nsh/defconfig index ffa99ab8ca..10e2a9df02 100644 --- a/configs/eagle100/nsh/defconfig +++ b/configs/eagle100/nsh/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/eagle100/nxflat/defconfig b/configs/eagle100/nxflat/defconfig index 7f14f43553..5c200c5b97 100644 --- a/configs/eagle100/nxflat/defconfig +++ b/configs/eagle100/nxflat/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/eagle100/thttpd/defconfig b/configs/eagle100/thttpd/defconfig index b7858460af..629f3fa0ea 100644 --- a/configs/eagle100/thttpd/defconfig +++ b/configs/eagle100/thttpd/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/efm32-g8xx-stk/nsh/defconfig b/configs/efm32-g8xx-stk/nsh/defconfig index 2b1e12ffe0..8c542af600 100644 --- a/configs/efm32-g8xx-stk/nsh/defconfig +++ b/configs/efm32-g8xx-stk/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/efm32gg-stk3700/nsh/defconfig b/configs/efm32gg-stk3700/nsh/defconfig index 8118f915ca..30de447ed8 100644 --- a/configs/efm32gg-stk3700/nsh/defconfig +++ b/configs/efm32gg-stk3700/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/ekk-lm3s9b96/nsh/defconfig b/configs/ekk-lm3s9b96/nsh/defconfig index d2eabf737b..7f32f0e259 100644 --- a/configs/ekk-lm3s9b96/nsh/defconfig +++ b/configs/ekk-lm3s9b96/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/fire-stm32v2/nsh/defconfig b/configs/fire-stm32v2/nsh/defconfig index 53063ac7af..b1f0cb08c0 100644 --- a/configs/fire-stm32v2/nsh/defconfig +++ b/configs/fire-stm32v2/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/freedom-k64f/netnsh/defconfig b/configs/freedom-k64f/netnsh/defconfig index 691747b286..936939ac97 100644 --- a/configs/freedom-k64f/netnsh/defconfig +++ b/configs/freedom-k64f/netnsh/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/freedom-k64f/nsh/defconfig b/configs/freedom-k64f/nsh/defconfig index 47e37626e8..7fd5528da8 100644 --- a/configs/freedom-k64f/nsh/defconfig +++ b/configs/freedom-k64f/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/freedom-k66f/netnsh/defconfig b/configs/freedom-k66f/netnsh/defconfig index 97e053710c..0dd182b325 100644 --- a/configs/freedom-k66f/netnsh/defconfig +++ b/configs/freedom-k66f/netnsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/freedom-k66f/nsh/defconfig b/configs/freedom-k66f/nsh/defconfig index ca3eec729d..edc066fd74 100644 --- a/configs/freedom-k66f/nsh/defconfig +++ b/configs/freedom-k66f/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/freedom-kl25z/nsh/defconfig b/configs/freedom-kl25z/nsh/defconfig index 7f1ca58fe7..9413dc8192 100644 --- a/configs/freedom-kl25z/nsh/defconfig +++ b/configs/freedom-kl25z/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/freedom-kl26z/nsh/defconfig b/configs/freedom-kl26z/nsh/defconfig index 9c5d47ab79..5f42f0e673 100644 --- a/configs/freedom-kl26z/nsh/defconfig +++ b/configs/freedom-kl26z/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/hymini-stm32v/nsh/defconfig b/configs/hymini-stm32v/nsh/defconfig index 7df3f16f96..2178d7a29a 100644 --- a/configs/hymini-stm32v/nsh/defconfig +++ b/configs/hymini-stm32v/nsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/hymini-stm32v/nsh2/defconfig b/configs/hymini-stm32v/nsh2/defconfig index 78b8a93b10..4e3a6fdb4a 100644 --- a/configs/hymini-stm32v/nsh2/defconfig +++ b/configs/hymini-stm32v/nsh2/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/hymini-stm32v/usbmsc/defconfig b/configs/hymini-stm32v/usbmsc/defconfig index aa41f35bfb..95ebfa83d3 100644 --- a/configs/hymini-stm32v/usbmsc/defconfig +++ b/configs/hymini-stm32v/usbmsc/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/hymini-stm32v/usbnsh/defconfig b/configs/hymini-stm32v/usbnsh/defconfig index f8bdf8cd52..745d7c0730 100644 --- a/configs/hymini-stm32v/usbnsh/defconfig +++ b/configs/hymini-stm32v/usbnsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/hymini-stm32v/usbserial/defconfig b/configs/hymini-stm32v/usbserial/defconfig index 7ea3f00e64..045cdccaa0 100644 --- a/configs/hymini-stm32v/usbserial/defconfig +++ b/configs/hymini-stm32v/usbserial/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/kwikstik-k40/ostest/defconfig b/configs/kwikstik-k40/ostest/defconfig index 6234ea74dd..24d291809a 100644 --- a/configs/kwikstik-k40/ostest/defconfig +++ b/configs/kwikstik-k40/ostest/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/launchxl-tms57004/nsh/defconfig b/configs/launchxl-tms57004/nsh/defconfig index d48b4c9b34..e6bb627c23 100644 --- a/configs/launchxl-tms57004/nsh/defconfig +++ b/configs/launchxl-tms57004/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CHIP_TMS570=y CONFIG_ARCH_CORTEXR4=y # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-r" diff --git a/configs/lincoln60/netnsh/defconfig b/configs/lincoln60/netnsh/defconfig index 8e2ddd336b..30978880fe 100644 --- a/configs/lincoln60/netnsh/defconfig +++ b/configs/lincoln60/netnsh/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lincoln60/nsh/defconfig b/configs/lincoln60/nsh/defconfig index 099a29380d..e5bbca65a5 100644 --- a/configs/lincoln60/nsh/defconfig +++ b/configs/lincoln60/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lincoln60/thttpd-binfs/defconfig b/configs/lincoln60/thttpd-binfs/defconfig index fe524e1cab..37a5d1d8f9 100644 --- a/configs/lincoln60/thttpd-binfs/defconfig +++ b/configs/lincoln60/thttpd-binfs/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm3s6432-s2e/nsh/defconfig b/configs/lm3s6432-s2e/nsh/defconfig index 7f4046a18b..fcdf915068 100644 --- a/configs/lm3s6432-s2e/nsh/defconfig +++ b/configs/lm3s6432-s2e/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm3s6965-ek/discover/defconfig b/configs/lm3s6965-ek/discover/defconfig index fa9015122c..8911dd2255 100644 --- a/configs/lm3s6965-ek/discover/defconfig +++ b/configs/lm3s6965-ek/discover/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm3s6965-ek/nsh/defconfig b/configs/lm3s6965-ek/nsh/defconfig index fa9015122c..8911dd2255 100644 --- a/configs/lm3s6965-ek/nsh/defconfig +++ b/configs/lm3s6965-ek/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm3s6965-ek/nx/defconfig b/configs/lm3s6965-ek/nx/defconfig index 38ca2f3c28..7f646f8ffc 100644 --- a/configs/lm3s6965-ek/nx/defconfig +++ b/configs/lm3s6965-ek/nx/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm3s6965-ek/tcpecho/defconfig b/configs/lm3s6965-ek/tcpecho/defconfig index b7f9e0a3ff..a814a4a2f0 100644 --- a/configs/lm3s6965-ek/tcpecho/defconfig +++ b/configs/lm3s6965-ek/tcpecho/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm3s8962-ek/nsh/defconfig b/configs/lm3s8962-ek/nsh/defconfig index 96b19a018d..6ba967e058 100644 --- a/configs/lm3s8962-ek/nsh/defconfig +++ b/configs/lm3s8962-ek/nsh/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm3s8962-ek/nx/defconfig b/configs/lm3s8962-ek/nx/defconfig index c78f7a54f2..b2efec5dc1 100644 --- a/configs/lm3s8962-ek/nx/defconfig +++ b/configs/lm3s8962-ek/nx/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lm4f120-launchpad/nsh/defconfig b/configs/lm4f120-launchpad/nsh/defconfig index 723ef7ac64..ed626fbd69 100644 --- a/configs/lm4f120-launchpad/nsh/defconfig +++ b/configs/lm4f120-launchpad/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpc4330-xplorer/nsh/defconfig b/configs/lpc4330-xplorer/nsh/defconfig index b133fea022..51822e20f9 100644 --- a/configs/lpc4330-xplorer/nsh/defconfig +++ b/configs/lpc4330-xplorer/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpc4337-ws/nsh/defconfig b/configs/lpc4337-ws/nsh/defconfig index b228af1f60..fc91caec26 100644 --- a/configs/lpc4337-ws/nsh/defconfig +++ b/configs/lpc4337-ws/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpc4357-evb/nsh/defconfig b/configs/lpc4357-evb/nsh/defconfig index cd8935a19f..b725ca2a3a 100644 --- a/configs/lpc4357-evb/nsh/defconfig +++ b/configs/lpc4357-evb/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpc4370-link2/nsh/defconfig b/configs/lpc4370-link2/nsh/defconfig index 81a79dfeb5..f3cdaabbc2 100644 --- a/configs/lpc4370-link2/nsh/defconfig +++ b/configs/lpc4370-link2/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpcxpresso-lpc1115/nsh/defconfig b/configs/lpcxpresso-lpc1115/nsh/defconfig index d46c1d2b71..cbda045e76 100644 --- a/configs/lpcxpresso-lpc1115/nsh/defconfig +++ b/configs/lpcxpresso-lpc1115/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/lpcxpresso-lpc1768/dhcpd/defconfig b/configs/lpcxpresso-lpc1768/dhcpd/defconfig index 185cbfeeae..5fb7705879 100644 --- a/configs/lpcxpresso-lpc1768/dhcpd/defconfig +++ b/configs/lpcxpresso-lpc1768/dhcpd/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpcxpresso-lpc1768/nsh/defconfig b/configs/lpcxpresso-lpc1768/nsh/defconfig index 5885acd549..211cdb6f9a 100644 --- a/configs/lpcxpresso-lpc1768/nsh/defconfig +++ b/configs/lpcxpresso-lpc1768/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpcxpresso-lpc1768/nx/defconfig b/configs/lpcxpresso-lpc1768/nx/defconfig index d68db2998e..a85cd7dd13 100644 --- a/configs/lpcxpresso-lpc1768/nx/defconfig +++ b/configs/lpcxpresso-lpc1768/nx/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpcxpresso-lpc1768/thttpd/defconfig b/configs/lpcxpresso-lpc1768/thttpd/defconfig index c854c8a66c..42286f138d 100644 --- a/configs/lpcxpresso-lpc1768/thttpd/defconfig +++ b/configs/lpcxpresso-lpc1768/thttpd/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/lpcxpresso-lpc1768/usbmsc/defconfig b/configs/lpcxpresso-lpc1768/usbmsc/defconfig index 3c0c09a6fd..3c6064bfaa 100644 --- a/configs/lpcxpresso-lpc1768/usbmsc/defconfig +++ b/configs/lpcxpresso-lpc1768/usbmsc/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/maple/nsh/defconfig b/configs/maple/nsh/defconfig index 0dbf9308c1..3d3dc6c516 100644 --- a/configs/maple/nsh/defconfig +++ b/configs/maple/nsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/maple/nx/defconfig b/configs/maple/nx/defconfig index 083bfcf053..90d72dd22c 100644 --- a/configs/maple/nx/defconfig +++ b/configs/maple/nx/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/maple/usbnsh/defconfig b/configs/maple/usbnsh/defconfig index c2d7fb75aa..fae6560d13 100644 --- a/configs/maple/usbnsh/defconfig +++ b/configs/maple/usbnsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mbed/nsh/defconfig b/configs/mbed/nsh/defconfig index d72476da05..1f048c9cd8 100644 --- a/configs/mbed/nsh/defconfig +++ b/configs/mbed/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mcu123-lpc214x/composite/defconfig b/configs/mcu123-lpc214x/composite/defconfig index 64d1898909..69bb189369 100644 --- a/configs/mcu123-lpc214x/composite/defconfig +++ b/configs/mcu123-lpc214x/composite/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/mcu123-lpc214x/nsh/defconfig b/configs/mcu123-lpc214x/nsh/defconfig index 35d07253e0..232d22fd4c 100644 --- a/configs/mcu123-lpc214x/nsh/defconfig +++ b/configs/mcu123-lpc214x/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/mcu123-lpc214x/usbmsc/defconfig b/configs/mcu123-lpc214x/usbmsc/defconfig index 516afa4720..a0568627d2 100644 --- a/configs/mcu123-lpc214x/usbmsc/defconfig +++ b/configs/mcu123-lpc214x/usbmsc/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/mcu123-lpc214x/usbserial/defconfig b/configs/mcu123-lpc214x/usbserial/defconfig index 9e9a05c8d5..148e35e809 100644 --- a/configs/mcu123-lpc214x/usbserial/defconfig +++ b/configs/mcu123-lpc214x/usbserial/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/mikroe-stm32f4/fulldemo/defconfig b/configs/mikroe-stm32f4/fulldemo/defconfig index 956df4df96..8195102e45 100644 --- a/configs/mikroe-stm32f4/fulldemo/defconfig +++ b/configs/mikroe-stm32f4/fulldemo/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mikroe-stm32f4/kostest/defconfig b/configs/mikroe-stm32f4/kostest/defconfig index df4088feca..1acecc4281 100644 --- a/configs/mikroe-stm32f4/kostest/defconfig +++ b/configs/mikroe-stm32f4/kostest/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mikroe-stm32f4/nsh/defconfig b/configs/mikroe-stm32f4/nsh/defconfig index ac5595096f..6ebe81c54c 100644 --- a/configs/mikroe-stm32f4/nsh/defconfig +++ b/configs/mikroe-stm32f4/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mikroe-stm32f4/nx/defconfig b/configs/mikroe-stm32f4/nx/defconfig index b6d01b2b68..a90fc6ef0a 100644 --- a/configs/mikroe-stm32f4/nx/defconfig +++ b/configs/mikroe-stm32f4/nx/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mikroe-stm32f4/nxlines/defconfig b/configs/mikroe-stm32f4/nxlines/defconfig index c299e729b8..23e48763ec 100644 --- a/configs/mikroe-stm32f4/nxlines/defconfig +++ b/configs/mikroe-stm32f4/nxlines/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mikroe-stm32f4/nxtext/defconfig b/configs/mikroe-stm32f4/nxtext/defconfig index 7ea8085608..c3575a1754 100644 --- a/configs/mikroe-stm32f4/nxtext/defconfig +++ b/configs/mikroe-stm32f4/nxtext/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/mikroe-stm32f4/usbnsh/defconfig b/configs/mikroe-stm32f4/usbnsh/defconfig index 0b24f1d0e4..98b77895a6 100644 --- a/configs/mikroe-stm32f4/usbnsh/defconfig +++ b/configs/mikroe-stm32f4/usbnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/moxa/nsh/defconfig b/configs/moxa/nsh/defconfig index 489a186b49..f46425a6bc 100644 --- a/configs/moxa/nsh/defconfig +++ b/configs/moxa/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/mx1ads/ostest/defconfig b/configs/mx1ads/ostest/defconfig index 25ead2ce11..5fb1a5473a 100644 --- a/configs/mx1ads/ostest/defconfig +++ b/configs/mx1ads/ostest/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM920T=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ntosd-dm320/nettest/defconfig b/configs/ntosd-dm320/nettest/defconfig index afe277011f..f93ba341f0 100644 --- a/configs/ntosd-dm320/nettest/defconfig +++ b/configs/ntosd-dm320/nettest/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ntosd-dm320/nsh/defconfig b/configs/ntosd-dm320/nsh/defconfig index 7346dc05a6..6176b2fedc 100644 --- a/configs/ntosd-dm320/nsh/defconfig +++ b/configs/ntosd-dm320/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ntosd-dm320/poll/defconfig b/configs/ntosd-dm320/poll/defconfig index 4c5c1343b9..50c575cb39 100644 --- a/configs/ntosd-dm320/poll/defconfig +++ b/configs/ntosd-dm320/poll/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ntosd-dm320/thttpd/defconfig b/configs/ntosd-dm320/thttpd/defconfig index d5ae0d1cba..9af33bfaa1 100644 --- a/configs/ntosd-dm320/thttpd/defconfig +++ b/configs/ntosd-dm320/thttpd/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ntosd-dm320/udp/defconfig b/configs/ntosd-dm320/udp/defconfig index 291f86c54b..ad5207ab7f 100644 --- a/configs/ntosd-dm320/udp/defconfig +++ b/configs/ntosd-dm320/udp/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/ntosd-dm320/webserver/defconfig b/configs/ntosd-dm320/webserver/defconfig index 16966d5862..2a650b8522 100644 --- a/configs/ntosd-dm320/webserver/defconfig +++ b/configs/ntosd-dm320/webserver/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/nucleo-144/f746-evalos/defconfig b/configs/nucleo-144/f746-evalos/defconfig index 6a333e8185..7ec5fa8829 100644 --- a/configs/nucleo-144/f746-evalos/defconfig +++ b/configs/nucleo-144/f746-evalos/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-144/f746-nsh/defconfig b/configs/nucleo-144/f746-nsh/defconfig index 4e100930ac..d18f62a879 100644 --- a/configs/nucleo-144/f746-nsh/defconfig +++ b/configs/nucleo-144/f746-nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-144/f767-evalos/defconfig b/configs/nucleo-144/f767-evalos/defconfig index cbc8fd6181..193173b89e 100644 --- a/configs/nucleo-144/f767-evalos/defconfig +++ b/configs/nucleo-144/f767-evalos/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-144/f767-nsh/defconfig b/configs/nucleo-144/f767-nsh/defconfig index 3fc8fc5181..87f3cc3b5e 100644 --- a/configs/nucleo-144/f767-nsh/defconfig +++ b/configs/nucleo-144/f767-nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f072rb/nsh/defconfig b/configs/nucleo-f072rb/nsh/defconfig index 978624897e..786360f314 100644 --- a/configs/nucleo-f072rb/nsh/defconfig +++ b/configs/nucleo-f072rb/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/nucleo-f091rc/nsh/defconfig b/configs/nucleo-f091rc/nsh/defconfig index 924c68ec5c..af23528d4e 100644 --- a/configs/nucleo-f091rc/nsh/defconfig +++ b/configs/nucleo-f091rc/nsh/defconfig @@ -148,7 +148,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/nucleo-f303re/adc/defconfig b/configs/nucleo-f303re/adc/defconfig index f2dae45cf7..b63a7eb712 100644 --- a/configs/nucleo-f303re/adc/defconfig +++ b/configs/nucleo-f303re/adc/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f303re/can/defconfig b/configs/nucleo-f303re/can/defconfig index f6252ea707..4fab471101 100644 --- a/configs/nucleo-f303re/can/defconfig +++ b/configs/nucleo-f303re/can/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f303re/hello/defconfig b/configs/nucleo-f303re/hello/defconfig index 736dfa88f8..c2ed153f8e 100644 --- a/configs/nucleo-f303re/hello/defconfig +++ b/configs/nucleo-f303re/hello/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f303re/nxlines/defconfig b/configs/nucleo-f303re/nxlines/defconfig index f3e7fc382e..5d3104d9b3 100644 --- a/configs/nucleo-f303re/nxlines/defconfig +++ b/configs/nucleo-f303re/nxlines/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f303re/pwm/defconfig b/configs/nucleo-f303re/pwm/defconfig index 489bb99455..98720e69b6 100644 --- a/configs/nucleo-f303re/pwm/defconfig +++ b/configs/nucleo-f303re/pwm/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f303re/serialrx/defconfig b/configs/nucleo-f303re/serialrx/defconfig index 2e6e2181fa..8b14405c4a 100644 --- a/configs/nucleo-f303re/serialrx/defconfig +++ b/configs/nucleo-f303re/serialrx/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f303re/uavcan/defconfig b/configs/nucleo-f303re/uavcan/defconfig index a111dce0a8..8a8f69e455 100644 --- a/configs/nucleo-f303re/uavcan/defconfig +++ b/configs/nucleo-f303re/uavcan/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f334r8/adc/defconfig b/configs/nucleo-f334r8/adc/defconfig index ff470c333f..8e3bf15ba0 100644 --- a/configs/nucleo-f334r8/adc/defconfig +++ b/configs/nucleo-f334r8/adc/defconfig @@ -147,7 +147,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f334r8/nsh/defconfig b/configs/nucleo-f334r8/nsh/defconfig index 94238e0628..86849afa1c 100644 --- a/configs/nucleo-f334r8/nsh/defconfig +++ b/configs/nucleo-f334r8/nsh/defconfig @@ -145,7 +145,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f4x1re/f401-nsh/defconfig b/configs/nucleo-f4x1re/f401-nsh/defconfig index 4748f70509..34b6503df7 100644 --- a/configs/nucleo-f4x1re/f401-nsh/defconfig +++ b/configs/nucleo-f4x1re/f401-nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-f4x1re/f411-nsh/defconfig b/configs/nucleo-f4x1re/f411-nsh/defconfig index 6e70b6ec40..65bbd4052e 100644 --- a/configs/nucleo-f4x1re/f411-nsh/defconfig +++ b/configs/nucleo-f4x1re/f411-nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-l432kc/nsh/defconfig b/configs/nucleo-l432kc/nsh/defconfig index efb716c902..4c7ca2e3a8 100644 --- a/configs/nucleo-l432kc/nsh/defconfig +++ b/configs/nucleo-l432kc/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-l452re/nsh/defconfig b/configs/nucleo-l452re/nsh/defconfig index 354b25f7c7..f291066eb1 100644 --- a/configs/nucleo-l452re/nsh/defconfig +++ b/configs/nucleo-l452re/nsh/defconfig @@ -155,7 +155,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-l476rg/nsh/defconfig b/configs/nucleo-l476rg/nsh/defconfig index 7094ab8803..ec6e351f10 100644 --- a/configs/nucleo-l476rg/nsh/defconfig +++ b/configs/nucleo-l476rg/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nucleo-l496zg/nsh/defconfig b/configs/nucleo-l496zg/nsh/defconfig index ad95f558a8..f4a3abdb4d 100644 --- a/configs/nucleo-l496zg/nsh/defconfig +++ b/configs/nucleo-l496zg/nsh/defconfig @@ -155,7 +155,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/nutiny-nuc120/nsh/defconfig b/configs/nutiny-nuc120/nsh/defconfig index 2f9d28a88b..e40159008d 100644 --- a/configs/nutiny-nuc120/nsh/defconfig +++ b/configs/nutiny-nuc120/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/olimex-efm32g880f128-stk/nsh/defconfig b/configs/olimex-efm32g880f128-stk/nsh/defconfig index f2da9812c1..0c2d530f18 100644 --- a/configs/olimex-efm32g880f128-stk/nsh/defconfig +++ b/configs/olimex-efm32g880f128-stk/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc-h3131/nsh/defconfig b/configs/olimex-lpc-h3131/nsh/defconfig index b2620d8888..359bb1c618 100644 --- a/configs/olimex-lpc-h3131/nsh/defconfig +++ b/configs/olimex-lpc-h3131/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_ARM926EJS=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/olimex-lpc1766stk/ftpc/defconfig b/configs/olimex-lpc1766stk/ftpc/defconfig index 41bc62fc8a..66009ad876 100644 --- a/configs/olimex-lpc1766stk/ftpc/defconfig +++ b/configs/olimex-lpc1766stk/ftpc/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/hidmouse/defconfig b/configs/olimex-lpc1766stk/hidmouse/defconfig index 4751e49360..5ad0081369 100644 --- a/configs/olimex-lpc1766stk/hidmouse/defconfig +++ b/configs/olimex-lpc1766stk/hidmouse/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/nettest/defconfig b/configs/olimex-lpc1766stk/nettest/defconfig index 6cac49f3ef..1c1ce57c62 100644 --- a/configs/olimex-lpc1766stk/nettest/defconfig +++ b/configs/olimex-lpc1766stk/nettest/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/nsh/defconfig b/configs/olimex-lpc1766stk/nsh/defconfig index 373eeb3daa..30f99c9e9e 100644 --- a/configs/olimex-lpc1766stk/nsh/defconfig +++ b/configs/olimex-lpc1766stk/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/nx/defconfig b/configs/olimex-lpc1766stk/nx/defconfig index 0b67c54f61..a3e14b06fd 100644 --- a/configs/olimex-lpc1766stk/nx/defconfig +++ b/configs/olimex-lpc1766stk/nx/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/slip-httpd/defconfig b/configs/olimex-lpc1766stk/slip-httpd/defconfig index fefac5aa76..cb850516d1 100644 --- a/configs/olimex-lpc1766stk/slip-httpd/defconfig +++ b/configs/olimex-lpc1766stk/slip-httpd/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/thttpd-binfs/defconfig b/configs/olimex-lpc1766stk/thttpd-binfs/defconfig index 7a15c4c5ef..9472686f64 100644 --- a/configs/olimex-lpc1766stk/thttpd-binfs/defconfig +++ b/configs/olimex-lpc1766stk/thttpd-binfs/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig b/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig index 208c90d50f..e1ce6c18ca 100644 --- a/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig +++ b/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/usbmsc/defconfig b/configs/olimex-lpc1766stk/usbmsc/defconfig index 9ae53e827a..d4616a4c52 100644 --- a/configs/olimex-lpc1766stk/usbmsc/defconfig +++ b/configs/olimex-lpc1766stk/usbmsc/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/usbserial/defconfig b/configs/olimex-lpc1766stk/usbserial/defconfig index 16a873814f..6702da37d3 100644 --- a/configs/olimex-lpc1766stk/usbserial/defconfig +++ b/configs/olimex-lpc1766stk/usbserial/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc1766stk/zmodem/defconfig b/configs/olimex-lpc1766stk/zmodem/defconfig index ec2b96b615..698a49c268 100644 --- a/configs/olimex-lpc1766stk/zmodem/defconfig +++ b/configs/olimex-lpc1766stk/zmodem/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-lpc2378/nsh/defconfig b/configs/olimex-lpc2378/nsh/defconfig index 5fb9b94171..9f68d38ef9 100644 --- a/configs/olimex-lpc2378/nsh/defconfig +++ b/configs/olimex-lpc2378/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/olimex-stm32-e407/discover/defconfig b/configs/olimex-stm32-e407/discover/defconfig index c44bf12478..67717307c5 100644 --- a/configs/olimex-stm32-e407/discover/defconfig +++ b/configs/olimex-stm32-e407/discover/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-e407/netnsh/defconfig b/configs/olimex-stm32-e407/netnsh/defconfig index 70f2e93be0..06367d3c0f 100644 --- a/configs/olimex-stm32-e407/netnsh/defconfig +++ b/configs/olimex-stm32-e407/netnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-e407/nsh/defconfig b/configs/olimex-stm32-e407/nsh/defconfig index ac026758f0..aadadcc642 100644 --- a/configs/olimex-stm32-e407/nsh/defconfig +++ b/configs/olimex-stm32-e407/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-e407/telnetd/defconfig b/configs/olimex-stm32-e407/telnetd/defconfig index 87dc6849d7..eaf4e161e3 100644 --- a/configs/olimex-stm32-e407/telnetd/defconfig +++ b/configs/olimex-stm32-e407/telnetd/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-e407/usbnsh/defconfig b/configs/olimex-stm32-e407/usbnsh/defconfig index 11f6948f93..97476cc594 100644 --- a/configs/olimex-stm32-e407/usbnsh/defconfig +++ b/configs/olimex-stm32-e407/usbnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-e407/webserver/defconfig b/configs/olimex-stm32-e407/webserver/defconfig index 2e790c9e1b..a1587edd55 100644 --- a/configs/olimex-stm32-e407/webserver/defconfig +++ b/configs/olimex-stm32-e407/webserver/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-h405/usbnsh/defconfig b/configs/olimex-stm32-h405/usbnsh/defconfig index 042364cd6d..e9e635c56e 100644 --- a/configs/olimex-stm32-h405/usbnsh/defconfig +++ b/configs/olimex-stm32-h405/usbnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-h407/nsh/defconfig b/configs/olimex-stm32-h407/nsh/defconfig index 0936be97e1..9c63f28284 100644 --- a/configs/olimex-stm32-h407/nsh/defconfig +++ b/configs/olimex-stm32-h407/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-p107/nsh/defconfig b/configs/olimex-stm32-p107/nsh/defconfig index 4ce159df73..ad911d78c5 100644 --- a/configs/olimex-stm32-p107/nsh/defconfig +++ b/configs/olimex-stm32-p107/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-p207/nsh/defconfig b/configs/olimex-stm32-p207/nsh/defconfig index 965a7c32a8..9426e3101a 100644 --- a/configs/olimex-stm32-p207/nsh/defconfig +++ b/configs/olimex-stm32-p207/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-p407/knsh/defconfig b/configs/olimex-stm32-p407/knsh/defconfig index f5b9cc2d99..b1fdc541d1 100644 --- a/configs/olimex-stm32-p407/knsh/defconfig +++ b/configs/olimex-stm32-p407/knsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-stm32-p407/nsh/defconfig b/configs/olimex-stm32-p407/nsh/defconfig index 0131469661..ea3cb293ea 100644 --- a/configs/olimex-stm32-p407/nsh/defconfig +++ b/configs/olimex-stm32-p407/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimex-strp711/nettest/defconfig b/configs/olimex-strp711/nettest/defconfig index e0ccedba80..1ffde23af6 100644 --- a/configs/olimex-strp711/nettest/defconfig +++ b/configs/olimex-strp711/nettest/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/olimex-strp711/nsh/defconfig b/configs/olimex-strp711/nsh/defconfig index 01d338d07f..b6dd0ab42a 100644 --- a/configs/olimex-strp711/nsh/defconfig +++ b/configs/olimex-strp711/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/olimexino-stm32/can/defconfig b/configs/olimexino-stm32/can/defconfig index 6cc8af2285..3546af6d67 100644 --- a/configs/olimexino-stm32/can/defconfig +++ b/configs/olimexino-stm32/can/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimexino-stm32/composite/defconfig b/configs/olimexino-stm32/composite/defconfig index 898f6ae919..1ac088cadd 100644 --- a/configs/olimexino-stm32/composite/defconfig +++ b/configs/olimexino-stm32/composite/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimexino-stm32/nsh/defconfig b/configs/olimexino-stm32/nsh/defconfig index 486a4aea62..5adb8a0072 100644 --- a/configs/olimexino-stm32/nsh/defconfig +++ b/configs/olimexino-stm32/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimexino-stm32/smallnsh/defconfig b/configs/olimexino-stm32/smallnsh/defconfig index 39a7a0efdf..6eee73059c 100644 --- a/configs/olimexino-stm32/smallnsh/defconfig +++ b/configs/olimexino-stm32/smallnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/olimexino-stm32/tiny/defconfig b/configs/olimexino-stm32/tiny/defconfig index ec4bcd7661..9c3336dde2 100644 --- a/configs/olimexino-stm32/tiny/defconfig +++ b/configs/olimexino-stm32/tiny/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/open1788/knsh/defconfig b/configs/open1788/knsh/defconfig index 830d16a862..e64f107bdd 100644 --- a/configs/open1788/knsh/defconfig +++ b/configs/open1788/knsh/defconfig @@ -121,7 +121,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/open1788/nsh/defconfig b/configs/open1788/nsh/defconfig index fe79328722..19181fdaf3 100644 --- a/configs/open1788/nsh/defconfig +++ b/configs/open1788/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/open1788/nxlines/defconfig b/configs/open1788/nxlines/defconfig index 4718ef242c..8f19b3ff44 100644 --- a/configs/open1788/nxlines/defconfig +++ b/configs/open1788/nxlines/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/pcduino-a10/nsh/defconfig b/configs/pcduino-a10/nsh/defconfig index 5bf38982d2..6bb6cc85f5 100644 --- a/configs/pcduino-a10/nsh/defconfig +++ b/configs/pcduino-a10/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA8=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/photon/nsh/defconfig b/configs/photon/nsh/defconfig index cb67991831..ec4b9b09da 100644 --- a/configs/photon/nsh/defconfig +++ b/configs/photon/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/photon/usbnsh/defconfig b/configs/photon/usbnsh/defconfig index 1e72753651..83aa8cc706 100644 --- a/configs/photon/usbnsh/defconfig +++ b/configs/photon/usbnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/photon/wlan/defconfig b/configs/photon/wlan/defconfig index 409aae40fc..a368939cd5 100644 --- a/configs/photon/wlan/defconfig +++ b/configs/photon/wlan/defconfig @@ -161,7 +161,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sabre-6quad/nsh/defconfig b/configs/sabre-6quad/nsh/defconfig index e6854aefa3..34e466f8dd 100644 --- a/configs/sabre-6quad/nsh/defconfig +++ b/configs/sabre-6quad/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA9=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sabre-6quad/smp/defconfig b/configs/sabre-6quad/smp/defconfig index d8f479ef6d..df75983507 100644 --- a/configs/sabre-6quad/smp/defconfig +++ b/configs/sabre-6quad/smp/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA9=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sam3u-ek/knsh/defconfig b/configs/sam3u-ek/knsh/defconfig index 0d45737050..00727a1a4b 100644 --- a/configs/sam3u-ek/knsh/defconfig +++ b/configs/sam3u-ek/knsh/defconfig @@ -121,7 +121,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam3u-ek/nsh/defconfig b/configs/sam3u-ek/nsh/defconfig index 1115ecb270..b66e85a3b2 100644 --- a/configs/sam3u-ek/nsh/defconfig +++ b/configs/sam3u-ek/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam3u-ek/nx/defconfig b/configs/sam3u-ek/nx/defconfig index 2494de67ac..9da0de848c 100644 --- a/configs/sam3u-ek/nx/defconfig +++ b/configs/sam3u-ek/nx/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam3u-ek/nxwm/defconfig b/configs/sam3u-ek/nxwm/defconfig index 8cd9244edf..3679a57014 100644 --- a/configs/sam3u-ek/nxwm/defconfig +++ b/configs/sam3u-ek/nxwm/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam4cmp-db/nsh/defconfig b/configs/sam4cmp-db/nsh/defconfig index 1794bf5c2f..6f812d40e5 100644 --- a/configs/sam4cmp-db/nsh/defconfig +++ b/configs/sam4cmp-db/nsh/defconfig @@ -145,7 +145,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam4e-ek/nsh/defconfig b/configs/sam4e-ek/nsh/defconfig index cd4b617a70..ba2e6ac537 100644 --- a/configs/sam4e-ek/nsh/defconfig +++ b/configs/sam4e-ek/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam4e-ek/nxwm/defconfig b/configs/sam4e-ek/nxwm/defconfig index ed4c3f7e1a..5825ea317a 100644 --- a/configs/sam4e-ek/nxwm/defconfig +++ b/configs/sam4e-ek/nxwm/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam4e-ek/usbnsh/defconfig b/configs/sam4e-ek/usbnsh/defconfig index f26914f97d..95fb33bab6 100644 --- a/configs/sam4e-ek/usbnsh/defconfig +++ b/configs/sam4e-ek/usbnsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam4l-xplained/nsh/defconfig b/configs/sam4l-xplained/nsh/defconfig index c31e95a224..2fb22422bb 100644 --- a/configs/sam4l-xplained/nsh/defconfig +++ b/configs/sam4l-xplained/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam4s-xplained-pro/nsh/defconfig b/configs/sam4s-xplained-pro/nsh/defconfig index ab547b3535..52094cda2a 100644 --- a/configs/sam4s-xplained-pro/nsh/defconfig +++ b/configs/sam4s-xplained-pro/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sam4s-xplained/nsh/defconfig b/configs/sam4s-xplained/nsh/defconfig index d8874cd629..eedd076c7d 100644 --- a/configs/sam4s-xplained/nsh/defconfig +++ b/configs/sam4s-xplained/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/sama5d2-xult/nsh/defconfig b/configs/sama5d2-xult/nsh/defconfig index 29da9edcbc..b67a43fa3e 100644 --- a/configs/sama5d2-xult/nsh/defconfig +++ b/configs/sama5d2-xult/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3-xplained/bridge/defconfig b/configs/sama5d3-xplained/bridge/defconfig index 7e940c157c..99b8276424 100644 --- a/configs/sama5d3-xplained/bridge/defconfig +++ b/configs/sama5d3-xplained/bridge/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3-xplained/nsh/defconfig b/configs/sama5d3-xplained/nsh/defconfig index 9800716ad6..5ededbc5b7 100644 --- a/configs/sama5d3-xplained/nsh/defconfig +++ b/configs/sama5d3-xplained/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/demo/defconfig b/configs/sama5d3x-ek/demo/defconfig index fde9166472..55762b25fa 100644 --- a/configs/sama5d3x-ek/demo/defconfig +++ b/configs/sama5d3x-ek/demo/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/hello/defconfig b/configs/sama5d3x-ek/hello/defconfig index b89238191d..a787c5c912 100644 --- a/configs/sama5d3x-ek/hello/defconfig +++ b/configs/sama5d3x-ek/hello/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/norboot/defconfig b/configs/sama5d3x-ek/norboot/defconfig index f17b0631dc..5d56dcf2e1 100644 --- a/configs/sama5d3x-ek/norboot/defconfig +++ b/configs/sama5d3x-ek/norboot/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/nsh/defconfig b/configs/sama5d3x-ek/nsh/defconfig index cced99e1ed..f7b3795dad 100644 --- a/configs/sama5d3x-ek/nsh/defconfig +++ b/configs/sama5d3x-ek/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/nx/defconfig b/configs/sama5d3x-ek/nx/defconfig index 5f847f9088..017db51730 100644 --- a/configs/sama5d3x-ek/nx/defconfig +++ b/configs/sama5d3x-ek/nx/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/nxplayer/defconfig b/configs/sama5d3x-ek/nxplayer/defconfig index 0fe83187f0..38a1b13f7e 100644 --- a/configs/sama5d3x-ek/nxplayer/defconfig +++ b/configs/sama5d3x-ek/nxplayer/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/nxwm/defconfig b/configs/sama5d3x-ek/nxwm/defconfig index 15b961d99f..ae7d95b633 100644 --- a/configs/sama5d3x-ek/nxwm/defconfig +++ b/configs/sama5d3x-ek/nxwm/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d3x-ek/ov2640/defconfig b/configs/sama5d3x-ek/ov2640/defconfig index b9330a2019..23fb7a5524 100644 --- a/configs/sama5d3x-ek/ov2640/defconfig +++ b/configs/sama5d3x-ek/ov2640/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/at25boot/defconfig b/configs/sama5d4-ek/at25boot/defconfig index 11a0dab220..05f84eb161 100644 --- a/configs/sama5d4-ek/at25boot/defconfig +++ b/configs/sama5d4-ek/at25boot/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/bridge/defconfig b/configs/sama5d4-ek/bridge/defconfig index bbb4e9e530..12357d183b 100644 --- a/configs/sama5d4-ek/bridge/defconfig +++ b/configs/sama5d4-ek/bridge/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/dramboot/defconfig b/configs/sama5d4-ek/dramboot/defconfig index c25c40e231..f8b4edfb62 100644 --- a/configs/sama5d4-ek/dramboot/defconfig +++ b/configs/sama5d4-ek/dramboot/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/elf/defconfig b/configs/sama5d4-ek/elf/defconfig index 07a6c79d33..7c991c3661 100644 --- a/configs/sama5d4-ek/elf/defconfig +++ b/configs/sama5d4-ek/elf/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/ipv6/defconfig b/configs/sama5d4-ek/ipv6/defconfig index fbcd409311..3e78f2eb80 100644 --- a/configs/sama5d4-ek/ipv6/defconfig +++ b/configs/sama5d4-ek/ipv6/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/knsh/defconfig b/configs/sama5d4-ek/knsh/defconfig index 39104b9481..ecb8f1ba28 100644 --- a/configs/sama5d4-ek/knsh/defconfig +++ b/configs/sama5d4-ek/knsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/nsh/defconfig b/configs/sama5d4-ek/nsh/defconfig index 5a4c97c83c..bc82420950 100644 --- a/configs/sama5d4-ek/nsh/defconfig +++ b/configs/sama5d4-ek/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/nxwm/defconfig b/configs/sama5d4-ek/nxwm/defconfig index 63014d2966..7c64b72b32 100644 --- a/configs/sama5d4-ek/nxwm/defconfig +++ b/configs/sama5d4-ek/nxwm/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/sama5d4-ek/ramtest/defconfig b/configs/sama5d4-ek/ramtest/defconfig index e199864e5a..68be4651fd 100644 --- a/configs/sama5d4-ek/ramtest/defconfig +++ b/configs/sama5d4-ek/ramtest/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" diff --git a/configs/samd20-xplained/nsh/defconfig b/configs/samd20-xplained/nsh/defconfig index f7143f1a8c..bc627ebe7d 100644 --- a/configs/samd20-xplained/nsh/defconfig +++ b/configs/samd20-xplained/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/samd21-xplained/nsh/defconfig b/configs/samd21-xplained/nsh/defconfig index 67c907795d..5793d20b5d 100644 --- a/configs/samd21-xplained/nsh/defconfig +++ b/configs/samd21-xplained/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/same70-xplained/netnsh/defconfig b/configs/same70-xplained/netnsh/defconfig index ea1f8fbbdc..6a54902810 100644 --- a/configs/same70-xplained/netnsh/defconfig +++ b/configs/same70-xplained/netnsh/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/same70-xplained/nsh/defconfig b/configs/same70-xplained/nsh/defconfig index 4cdbf698ca..be26e40bea 100644 --- a/configs/same70-xplained/nsh/defconfig +++ b/configs/same70-xplained/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/saml21-xplained/nsh/defconfig b/configs/saml21-xplained/nsh/defconfig index 3e1d6fdd03..3f87ed3cb9 100644 --- a/configs/saml21-xplained/nsh/defconfig +++ b/configs/saml21-xplained/nsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/samv71-xult/knsh/defconfig b/configs/samv71-xult/knsh/defconfig index 084a65b9f0..ff58543fa5 100644 --- a/configs/samv71-xult/knsh/defconfig +++ b/configs/samv71-xult/knsh/defconfig @@ -127,7 +127,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/samv71-xult/module/defconfig b/configs/samv71-xult/module/defconfig index 2f89f12a0a..17227cbe09 100644 --- a/configs/samv71-xult/module/defconfig +++ b/configs/samv71-xult/module/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/samv71-xult/mxtxplnd/defconfig b/configs/samv71-xult/mxtxplnd/defconfig index d9fc28ec2d..2bc101b6e5 100644 --- a/configs/samv71-xult/mxtxplnd/defconfig +++ b/configs/samv71-xult/mxtxplnd/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/samv71-xult/netnsh/defconfig b/configs/samv71-xult/netnsh/defconfig index 0cf0b67a8e..1e66fe1ba1 100644 --- a/configs/samv71-xult/netnsh/defconfig +++ b/configs/samv71-xult/netnsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/samv71-xult/nsh/defconfig b/configs/samv71-xult/nsh/defconfig index 3233d2a89f..60f1a3ce49 100644 --- a/configs/samv71-xult/nsh/defconfig +++ b/configs/samv71-xult/nsh/defconfig @@ -122,7 +122,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/samv71-xult/nxwm/defconfig b/configs/samv71-xult/nxwm/defconfig index 704a09e308..7e41323e27 100644 --- a/configs/samv71-xult/nxwm/defconfig +++ b/configs/samv71-xult/nxwm/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/samv71-xult/vnc/defconfig b/configs/samv71-xult/vnc/defconfig index da546e0dd0..8a1cc95805 100644 --- a/configs/samv71-xult/vnc/defconfig +++ b/configs/samv71-xult/vnc/defconfig @@ -124,7 +124,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/samv71-xult/vnxwm/defconfig b/configs/samv71-xult/vnxwm/defconfig index 454f319c8c..25f06d52dd 100644 --- a/configs/samv71-xult/vnxwm/defconfig +++ b/configs/samv71-xult/vnxwm/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/shenzhou/nsh/defconfig b/configs/shenzhou/nsh/defconfig index b43530adc2..19fd332296 100644 --- a/configs/shenzhou/nsh/defconfig +++ b/configs/shenzhou/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index e1f8f33041..9dfa5ad375 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/shenzhou/thttpd/defconfig b/configs/shenzhou/thttpd/defconfig index 98020af006..f2f2f74237 100644 --- a/configs/shenzhou/thttpd/defconfig +++ b/configs/shenzhou/thttpd/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/spark/composite/defconfig b/configs/spark/composite/defconfig index 281a489e6c..e0350b7852 100644 --- a/configs/spark/composite/defconfig +++ b/configs/spark/composite/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/spark/nsh/defconfig b/configs/spark/nsh/defconfig index 1e1c422438..a404c2bc70 100644 --- a/configs/spark/nsh/defconfig +++ b/configs/spark/nsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/spark/usbmsc/defconfig b/configs/spark/usbmsc/defconfig index feca6a0a92..7face48d5c 100644 --- a/configs/spark/usbmsc/defconfig +++ b/configs/spark/usbmsc/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/spark/usbnsh/defconfig b/configs/spark/usbnsh/defconfig index 8fcdcc3ce6..3d0184ad1f 100644 --- a/configs/spark/usbnsh/defconfig +++ b/configs/spark/usbnsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/spark/usbserial/defconfig b/configs/spark/usbserial/defconfig index 8d6a8293da..70835160d5 100644 --- a/configs/spark/usbserial/defconfig +++ b/configs/spark/usbserial/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/composite/defconfig b/configs/stm3210e-eval/composite/defconfig index 4bfafde9e3..cb7ad87fd0 100644 --- a/configs/stm3210e-eval/composite/defconfig +++ b/configs/stm3210e-eval/composite/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/nsh/defconfig b/configs/stm3210e-eval/nsh/defconfig index 8ccc2e7606..8207333ab1 100644 --- a/configs/stm3210e-eval/nsh/defconfig +++ b/configs/stm3210e-eval/nsh/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/nsh2/defconfig b/configs/stm3210e-eval/nsh2/defconfig index 4e78fee3f0..83d246522d 100644 --- a/configs/stm3210e-eval/nsh2/defconfig +++ b/configs/stm3210e-eval/nsh2/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig index 951415392f..8208105130 100644 --- a/configs/stm3210e-eval/nx/defconfig +++ b/configs/stm3210e-eval/nx/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/nxterm/defconfig b/configs/stm3210e-eval/nxterm/defconfig index a577757298..c6fa59410d 100644 --- a/configs/stm3210e-eval/nxterm/defconfig +++ b/configs/stm3210e-eval/nxterm/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/pm/defconfig b/configs/stm3210e-eval/pm/defconfig index a05bfcc94b..bc195374f6 100644 --- a/configs/stm3210e-eval/pm/defconfig +++ b/configs/stm3210e-eval/pm/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/usbmsc/defconfig b/configs/stm3210e-eval/usbmsc/defconfig index 84983fb9fc..47d7658081 100644 --- a/configs/stm3210e-eval/usbmsc/defconfig +++ b/configs/stm3210e-eval/usbmsc/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3210e-eval/usbserial/defconfig b/configs/stm3210e-eval/usbserial/defconfig index fb49e872c7..a586efc92f 100644 --- a/configs/stm3210e-eval/usbserial/defconfig +++ b/configs/stm3210e-eval/usbserial/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3220g-eval/dhcpd/defconfig b/configs/stm3220g-eval/dhcpd/defconfig index ca619c0056..5fdd9cd651 100644 --- a/configs/stm3220g-eval/dhcpd/defconfig +++ b/configs/stm3220g-eval/dhcpd/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3220g-eval/nettest/defconfig b/configs/stm3220g-eval/nettest/defconfig index 010d4fa174..db3c65568c 100644 --- a/configs/stm3220g-eval/nettest/defconfig +++ b/configs/stm3220g-eval/nettest/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3220g-eval/nsh/defconfig b/configs/stm3220g-eval/nsh/defconfig index 1b8ee32471..1ecef98b39 100644 --- a/configs/stm3220g-eval/nsh/defconfig +++ b/configs/stm3220g-eval/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3220g-eval/nsh2/defconfig b/configs/stm3220g-eval/nsh2/defconfig index 003e9148ac..de128433be 100644 --- a/configs/stm3220g-eval/nsh2/defconfig +++ b/configs/stm3220g-eval/nsh2/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3220g-eval/nxwm/defconfig b/configs/stm3220g-eval/nxwm/defconfig index c09050cf11..847e4f77e8 100644 --- a/configs/stm3220g-eval/nxwm/defconfig +++ b/configs/stm3220g-eval/nxwm/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3220g-eval/telnetd/defconfig b/configs/stm3220g-eval/telnetd/defconfig index be338e0500..a0ab8932f4 100644 --- a/configs/stm3220g-eval/telnetd/defconfig +++ b/configs/stm3220g-eval/telnetd/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/dhcpd/defconfig b/configs/stm3240g-eval/dhcpd/defconfig index 49863ae158..d3d3dcffff 100644 --- a/configs/stm3240g-eval/dhcpd/defconfig +++ b/configs/stm3240g-eval/dhcpd/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/discover/defconfig b/configs/stm3240g-eval/discover/defconfig index 67c33f4078..1d9a91bb46 100644 --- a/configs/stm3240g-eval/discover/defconfig +++ b/configs/stm3240g-eval/discover/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/knxwm/defconfig b/configs/stm3240g-eval/knxwm/defconfig index 2dc44e36db..789f7631fc 100644 --- a/configs/stm3240g-eval/knxwm/defconfig +++ b/configs/stm3240g-eval/knxwm/defconfig @@ -131,7 +131,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/nettest/defconfig b/configs/stm3240g-eval/nettest/defconfig index be929fb671..de9bc2113b 100644 --- a/configs/stm3240g-eval/nettest/defconfig +++ b/configs/stm3240g-eval/nettest/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig index ab364fa992..99c8ece468 100644 --- a/configs/stm3240g-eval/nsh/defconfig +++ b/configs/stm3240g-eval/nsh/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/nsh2/defconfig b/configs/stm3240g-eval/nsh2/defconfig index e412f481f3..1c35e4babb 100644 --- a/configs/stm3240g-eval/nsh2/defconfig +++ b/configs/stm3240g-eval/nsh2/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/nxterm/defconfig b/configs/stm3240g-eval/nxterm/defconfig index bd0d5919b4..411476cbd6 100644 --- a/configs/stm3240g-eval/nxterm/defconfig +++ b/configs/stm3240g-eval/nxterm/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index d4f41b9d83..467fd105a9 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/telnetd/defconfig b/configs/stm3240g-eval/telnetd/defconfig index abb14d9aae..a6e171b9e2 100644 --- a/configs/stm3240g-eval/telnetd/defconfig +++ b/configs/stm3240g-eval/telnetd/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/webserver/defconfig b/configs/stm3240g-eval/webserver/defconfig index 877d772f46..c438b53b40 100644 --- a/configs/stm3240g-eval/webserver/defconfig +++ b/configs/stm3240g-eval/webserver/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm3240g-eval/xmlrpc/defconfig b/configs/stm3240g-eval/xmlrpc/defconfig index 32ec3cb2eb..63ce7679db 100644 --- a/configs/stm3240g-eval/xmlrpc/defconfig +++ b/configs/stm3240g-eval/xmlrpc/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32_tiny/nsh/defconfig b/configs/stm32_tiny/nsh/defconfig index 2588da219c..d1aacaf710 100644 --- a/configs/stm32_tiny/nsh/defconfig +++ b/configs/stm32_tiny/nsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32_tiny/usbnsh/defconfig b/configs/stm32_tiny/usbnsh/defconfig index f471ae9dbc..3466aa3bf2 100644 --- a/configs/stm32_tiny/usbnsh/defconfig +++ b/configs/stm32_tiny/usbnsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32butterfly2/nsh/defconfig b/configs/stm32butterfly2/nsh/defconfig index ce0251c52c..91f4d1c2e2 100644 --- a/configs/stm32butterfly2/nsh/defconfig +++ b/configs/stm32butterfly2/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32butterfly2/nshnet/defconfig b/configs/stm32butterfly2/nshnet/defconfig index fbf702ddf1..a2d0055386 100644 --- a/configs/stm32butterfly2/nshnet/defconfig +++ b/configs/stm32butterfly2/nshnet/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32butterfly2/nshusbdev/defconfig b/configs/stm32butterfly2/nshusbdev/defconfig index 920a2e768c..f57578e7d0 100644 --- a/configs/stm32butterfly2/nshusbdev/defconfig +++ b/configs/stm32butterfly2/nshusbdev/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32butterfly2/nshusbhost/defconfig b/configs/stm32butterfly2/nshusbhost/defconfig index ce0251c52c..91f4d1c2e2 100644 --- a/configs/stm32butterfly2/nshusbhost/defconfig +++ b/configs/stm32butterfly2/nshusbhost/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f0discovery/nsh/defconfig b/configs/stm32f0discovery/nsh/defconfig index 643b2b8269..f8ee52a34d 100644 --- a/configs/stm32f0discovery/nsh/defconfig +++ b/configs/stm32f0discovery/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/stm32f103-minimum/audio_tone/defconfig b/configs/stm32f103-minimum/audio_tone/defconfig index a02e34ff9f..2dd9628e9c 100644 --- a/configs/stm32f103-minimum/audio_tone/defconfig +++ b/configs/stm32f103-minimum/audio_tone/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/buttons/defconfig b/configs/stm32f103-minimum/buttons/defconfig index 741e878765..b6fa8ac7d1 100644 --- a/configs/stm32f103-minimum/buttons/defconfig +++ b/configs/stm32f103-minimum/buttons/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/jlx12864g/defconfig b/configs/stm32f103-minimum/jlx12864g/defconfig index 5044311070..d0e48894b2 100644 --- a/configs/stm32f103-minimum/jlx12864g/defconfig +++ b/configs/stm32f103-minimum/jlx12864g/defconfig @@ -152,7 +152,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/mcp2515/defconfig b/configs/stm32f103-minimum/mcp2515/defconfig index 56727ae711..3298e2a838 100644 --- a/configs/stm32f103-minimum/mcp2515/defconfig +++ b/configs/stm32f103-minimum/mcp2515/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/nrf24/defconfig b/configs/stm32f103-minimum/nrf24/defconfig index e47dac3b56..38dff042fc 100644 --- a/configs/stm32f103-minimum/nrf24/defconfig +++ b/configs/stm32f103-minimum/nrf24/defconfig @@ -148,7 +148,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/nsh/defconfig b/configs/stm32f103-minimum/nsh/defconfig index 9c30d971fd..4f44304393 100644 --- a/configs/stm32f103-minimum/nsh/defconfig +++ b/configs/stm32f103-minimum/nsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/pwm/defconfig b/configs/stm32f103-minimum/pwm/defconfig index d7926d95f4..c9948199ad 100644 --- a/configs/stm32f103-minimum/pwm/defconfig +++ b/configs/stm32f103-minimum/pwm/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/rfid-rc522/defconfig b/configs/stm32f103-minimum/rfid-rc522/defconfig index 105cc29402..7b3b9fdec1 100644 --- a/configs/stm32f103-minimum/rfid-rc522/defconfig +++ b/configs/stm32f103-minimum/rfid-rc522/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/rgbled/defconfig b/configs/stm32f103-minimum/rgbled/defconfig index 057b09e1be..7f69a3fad9 100644 --- a/configs/stm32f103-minimum/rgbled/defconfig +++ b/configs/stm32f103-minimum/rgbled/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/usbnsh/defconfig b/configs/stm32f103-minimum/usbnsh/defconfig index 4d93790163..b7c50a79ab 100644 --- a/configs/stm32f103-minimum/usbnsh/defconfig +++ b/configs/stm32f103-minimum/usbnsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/userled/defconfig b/configs/stm32f103-minimum/userled/defconfig index 43ee87336b..8a37b7e1aa 100644 --- a/configs/stm32f103-minimum/userled/defconfig +++ b/configs/stm32f103-minimum/userled/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f103-minimum/veml6070/defconfig b/configs/stm32f103-minimum/veml6070/defconfig index 115d1fa491..1c6f89180b 100644 --- a/configs/stm32f103-minimum/veml6070/defconfig +++ b/configs/stm32f103-minimum/veml6070/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f3discovery/nsh/defconfig b/configs/stm32f3discovery/nsh/defconfig index dcf4905161..e21921d897 100644 --- a/configs/stm32f3discovery/nsh/defconfig +++ b/configs/stm32f3discovery/nsh/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f3discovery/usbnsh/defconfig b/configs/stm32f3discovery/usbnsh/defconfig index 1ffe9da444..95c5ec9610 100644 --- a/configs/stm32f3discovery/usbnsh/defconfig +++ b/configs/stm32f3discovery/usbnsh/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f411e-disco/nsh/defconfig b/configs/stm32f411e-disco/nsh/defconfig index 0dd9aff2d1..bbab590c49 100644 --- a/configs/stm32f411e-disco/nsh/defconfig +++ b/configs/stm32f411e-disco/nsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f429i-disco/extflash/defconfig b/configs/stm32f429i-disco/extflash/defconfig index 4815ca65f5..bcdb618783 100644 --- a/configs/stm32f429i-disco/extflash/defconfig +++ b/configs/stm32f429i-disco/extflash/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f429i-disco/lcd/defconfig b/configs/stm32f429i-disco/lcd/defconfig index ca01660057..61efc4cfff 100644 --- a/configs/stm32f429i-disco/lcd/defconfig +++ b/configs/stm32f429i-disco/lcd/defconfig @@ -121,7 +121,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f429i-disco/ltdc/defconfig b/configs/stm32f429i-disco/ltdc/defconfig index c657306064..41a2e7d396 100644 --- a/configs/stm32f429i-disco/ltdc/defconfig +++ b/configs/stm32f429i-disco/ltdc/defconfig @@ -121,7 +121,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f429i-disco/nsh/defconfig b/configs/stm32f429i-disco/nsh/defconfig index 5ef88f3db5..e2a1170c5e 100644 --- a/configs/stm32f429i-disco/nsh/defconfig +++ b/configs/stm32f429i-disco/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f429i-disco/nxwm/defconfig b/configs/stm32f429i-disco/nxwm/defconfig index c79f7605eb..13890fe609 100644 --- a/configs/stm32f429i-disco/nxwm/defconfig +++ b/configs/stm32f429i-disco/nxwm/defconfig @@ -121,7 +121,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f429i-disco/usbmsc/defconfig b/configs/stm32f429i-disco/usbmsc/defconfig index b7f855e112..8025b772d4 100644 --- a/configs/stm32f429i-disco/usbmsc/defconfig +++ b/configs/stm32f429i-disco/usbmsc/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f429i-disco/usbnsh/defconfig b/configs/stm32f429i-disco/usbnsh/defconfig index 2b2c0a4ea9..be48d86123 100644 --- a/configs/stm32f429i-disco/usbnsh/defconfig +++ b/configs/stm32f429i-disco/usbnsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/canard/defconfig b/configs/stm32f4discovery/canard/defconfig index e3378d9df3..b47022a351 100644 --- a/configs/stm32f4discovery/canard/defconfig +++ b/configs/stm32f4discovery/canard/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/cxxtest/defconfig b/configs/stm32f4discovery/cxxtest/defconfig index 736dca9f6c..02cd0cbc2b 100644 --- a/configs/stm32f4discovery/cxxtest/defconfig +++ b/configs/stm32f4discovery/cxxtest/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/elf/defconfig b/configs/stm32f4discovery/elf/defconfig index cf42ee96b1..8dea3c3a3c 100644 --- a/configs/stm32f4discovery/elf/defconfig +++ b/configs/stm32f4discovery/elf/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/ipv6/defconfig b/configs/stm32f4discovery/ipv6/defconfig index 2db3c1beeb..bab7d7d7f7 100644 --- a/configs/stm32f4discovery/ipv6/defconfig +++ b/configs/stm32f4discovery/ipv6/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/kostest/defconfig b/configs/stm32f4discovery/kostest/defconfig index ea9e35d2f9..8195826113 100644 --- a/configs/stm32f4discovery/kostest/defconfig +++ b/configs/stm32f4discovery/kostest/defconfig @@ -128,7 +128,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/netnsh/defconfig b/configs/stm32f4discovery/netnsh/defconfig index ada356f924..c60861ec0b 100644 --- a/configs/stm32f4discovery/netnsh/defconfig +++ b/configs/stm32f4discovery/netnsh/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/nsh/defconfig b/configs/stm32f4discovery/nsh/defconfig index 78f20fe4e4..3e3a60c3aa 100644 --- a/configs/stm32f4discovery/nsh/defconfig +++ b/configs/stm32f4discovery/nsh/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/nxlines/defconfig b/configs/stm32f4discovery/nxlines/defconfig index 3ca9c479ad..af2533a39e 100644 --- a/configs/stm32f4discovery/nxlines/defconfig +++ b/configs/stm32f4discovery/nxlines/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/pm/defconfig b/configs/stm32f4discovery/pm/defconfig index 11fc388755..7cfc253fa7 100644 --- a/configs/stm32f4discovery/pm/defconfig +++ b/configs/stm32f4discovery/pm/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/posix_spawn/defconfig b/configs/stm32f4discovery/posix_spawn/defconfig index f9eaa1d647..e1a7bf6754 100644 --- a/configs/stm32f4discovery/posix_spawn/defconfig +++ b/configs/stm32f4discovery/posix_spawn/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/pseudoterm/defconfig b/configs/stm32f4discovery/pseudoterm/defconfig index a4e5461f78..7ef11b8d2c 100644 --- a/configs/stm32f4discovery/pseudoterm/defconfig +++ b/configs/stm32f4discovery/pseudoterm/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/rgbled/defconfig b/configs/stm32f4discovery/rgbled/defconfig index f9d9463532..8135278af2 100644 --- a/configs/stm32f4discovery/rgbled/defconfig +++ b/configs/stm32f4discovery/rgbled/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/uavcan/defconfig b/configs/stm32f4discovery/uavcan/defconfig index ca307a2006..ed52310f8a 100644 --- a/configs/stm32f4discovery/uavcan/defconfig +++ b/configs/stm32f4discovery/uavcan/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/usbnsh/defconfig b/configs/stm32f4discovery/usbnsh/defconfig index 35c6cd7d45..8528822d33 100644 --- a/configs/stm32f4discovery/usbnsh/defconfig +++ b/configs/stm32f4discovery/usbnsh/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f4discovery/xen1210/defconfig b/configs/stm32f4discovery/xen1210/defconfig index 514ce52a4e..161b69470a 100644 --- a/configs/stm32f4discovery/xen1210/defconfig +++ b/configs/stm32f4discovery/xen1210/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f746-ws/nsh/defconfig b/configs/stm32f746-ws/nsh/defconfig index eeb171767e..5349facfcb 100644 --- a/configs/stm32f746-ws/nsh/defconfig +++ b/configs/stm32f746-ws/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32f746g-disco/nsh/defconfig b/configs/stm32f746g-disco/nsh/defconfig index 5fdda7f074..27b9ceac04 100644 --- a/configs/stm32f746g-disco/nsh/defconfig +++ b/configs/stm32f746g-disco/nsh/defconfig @@ -126,7 +126,7 @@ CONFIG_ARCH_CORTEXM7=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32l476-mdk/nsh/defconfig b/configs/stm32l476-mdk/nsh/defconfig index c94b92be89..ae76fab953 100644 --- a/configs/stm32l476-mdk/nsh/defconfig +++ b/configs/stm32l476-mdk/nsh/defconfig @@ -117,7 +117,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32l476vg-disco/nsh/defconfig b/configs/stm32l476vg-disco/nsh/defconfig index ec45e553a1..ea16d05145 100644 --- a/configs/stm32l476vg-disco/nsh/defconfig +++ b/configs/stm32l476vg-disco/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32ldiscovery/nsh/defconfig b/configs/stm32ldiscovery/nsh/defconfig index 9dfcacb8a2..ccb8f423a4 100644 --- a/configs/stm32ldiscovery/nsh/defconfig +++ b/configs/stm32ldiscovery/nsh/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/stm32vldiscovery/nsh/defconfig b/configs/stm32vldiscovery/nsh/defconfig index 3865292e7a..36bda9b888 100644 --- a/configs/stm32vldiscovery/nsh/defconfig +++ b/configs/stm32vldiscovery/nsh/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/teensy-3.x/nsh/defconfig b/configs/teensy-3.x/nsh/defconfig index d2fcf166d5..32c17e80e3 100644 --- a/configs/teensy-3.x/nsh/defconfig +++ b/configs/teensy-3.x/nsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/teensy-3.x/usbnsh/defconfig b/configs/teensy-3.x/usbnsh/defconfig index 649efb23af..f90d41df56 100644 --- a/configs/teensy-3.x/usbnsh/defconfig +++ b/configs/teensy-3.x/usbnsh/defconfig @@ -119,7 +119,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/teensy-lc/nsh/defconfig b/configs/teensy-lc/nsh/defconfig index 66fc7e6177..6b1797d057 100644 --- a/configs/teensy-lc/nsh/defconfig +++ b/configs/teensy-lc/nsh/defconfig @@ -120,7 +120,7 @@ CONFIG_ARCH_CORTEXM0=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv6-m" diff --git a/configs/tm4c123g-launchpad/nsh/defconfig b/configs/tm4c123g-launchpad/nsh/defconfig index 625f0d748c..7c9ee110fe 100644 --- a/configs/tm4c123g-launchpad/nsh/defconfig +++ b/configs/tm4c123g-launchpad/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/tm4c1294-launchpad/ipv6/defconfig b/configs/tm4c1294-launchpad/ipv6/defconfig index e663a9301b..b4afb81b20 100644 --- a/configs/tm4c1294-launchpad/ipv6/defconfig +++ b/configs/tm4c1294-launchpad/ipv6/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/tm4c1294-launchpad/nsh/defconfig b/configs/tm4c1294-launchpad/nsh/defconfig index 91c0781f88..f29f06c7a6 100644 --- a/configs/tm4c1294-launchpad/nsh/defconfig +++ b/configs/tm4c1294-launchpad/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/twr-k60n512/nsh/defconfig b/configs/twr-k60n512/nsh/defconfig index 9f8055ba1b..d7481c0175 100644 --- a/configs/twr-k60n512/nsh/defconfig +++ b/configs/twr-k60n512/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/twr-k64f120m/netnsh/defconfig b/configs/twr-k64f120m/netnsh/defconfig index ac3ca96275..b56205263e 100644 --- a/configs/twr-k64f120m/netnsh/defconfig +++ b/configs/twr-k64f120m/netnsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/twr-k64f120m/nsh/defconfig b/configs/twr-k64f120m/nsh/defconfig index c3b81237e9..791a448446 100644 --- a/configs/twr-k64f120m/nsh/defconfig +++ b/configs/twr-k64f120m/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/u-blox-c027/nsh/defconfig b/configs/u-blox-c027/nsh/defconfig index d4295f62f9..a2ae8f809e 100644 --- a/configs/u-blox-c027/nsh/defconfig +++ b/configs/u-blox-c027/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/viewtool-stm32f107/highpri/defconfig b/configs/viewtool-stm32f107/highpri/defconfig index 6e883f2526..156787a1b4 100644 --- a/configs/viewtool-stm32f107/highpri/defconfig +++ b/configs/viewtool-stm32f107/highpri/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/viewtool-stm32f107/netnsh/defconfig b/configs/viewtool-stm32f107/netnsh/defconfig index 92708d6039..576facbb20 100644 --- a/configs/viewtool-stm32f107/netnsh/defconfig +++ b/configs/viewtool-stm32f107/netnsh/defconfig @@ -125,7 +125,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/viewtool-stm32f107/nsh/defconfig b/configs/viewtool-stm32f107/nsh/defconfig index bca8db1a3d..a84458179e 100644 --- a/configs/viewtool-stm32f107/nsh/defconfig +++ b/configs/viewtool-stm32f107/nsh/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/xmc4500-relax/nsh/defconfig b/configs/xmc4500-relax/nsh/defconfig index db33aac810..12c80ea662 100644 --- a/configs/xmc4500-relax/nsh/defconfig +++ b/configs/xmc4500-relax/nsh/defconfig @@ -123,7 +123,7 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/zkit-arm-1769/hello/defconfig b/configs/zkit-arm-1769/hello/defconfig index 7bea34aa2d..4a0b0c9fc4 100644 --- a/configs/zkit-arm-1769/hello/defconfig +++ b/configs/zkit-arm-1769/hello/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/zkit-arm-1769/nsh/defconfig b/configs/zkit-arm-1769/nsh/defconfig index 0afb96b403..f5f7211ee5 100644 --- a/configs/zkit-arm-1769/nsh/defconfig +++ b/configs/zkit-arm-1769/nsh/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/zkit-arm-1769/nxhello/defconfig b/configs/zkit-arm-1769/nxhello/defconfig index 5472c32bc3..21d5842a6d 100644 --- a/configs/zkit-arm-1769/nxhello/defconfig +++ b/configs/zkit-arm-1769/nxhello/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/zkit-arm-1769/thttpd/defconfig b/configs/zkit-arm-1769/thttpd/defconfig index 50238485e5..68b63b644d 100644 --- a/configs/zkit-arm-1769/thttpd/defconfig +++ b/configs/zkit-arm-1769/thttpd/defconfig @@ -118,7 +118,7 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" diff --git a/configs/zp214xpa/nsh/defconfig b/configs/zp214xpa/nsh/defconfig index 1f6698b93a..bce89c4e27 100644 --- a/configs/zp214xpa/nsh/defconfig +++ b/configs/zp214xpa/nsh/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" diff --git a/configs/zp214xpa/nxlines/defconfig b/configs/zp214xpa/nxlines/defconfig index 8358bb153b..1fcf35129f 100644 --- a/configs/zp214xpa/nxlines/defconfig +++ b/configs/zp214xpa/nxlines/defconfig @@ -116,7 +116,7 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEXR4 is not set # CONFIG_ARCH_CORTEXR4F is not set # CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set +# CONFIG_ARCH_CORTEXR5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="arm" From d9d32ac808e5608fa255c1de6b14411655590515 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 15 Jun 2017 11:16:28 -1000 Subject: [PATCH 39/55] samv7:twihs driver add reference counting --- arch/arm/src/samv7/sam_twihs.c | 66 +++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/arch/arm/src/samv7/sam_twihs.c b/arch/arm/src/samv7/sam_twihs.c index 4cbd19d396..05fa92cd71 100644 --- a/arch/arm/src/samv7/sam_twihs.c +++ b/arch/arm/src/samv7/sam_twihs.c @@ -151,7 +151,7 @@ struct twi_dev_s struct i2c_msg_s *msg; /* Message list */ uint32_t twiclk; /* TWIHS input clock frequency */ uint32_t frequency; /* TWIHS transfer clock frequency */ - bool initd; /* True :device has been initialized */ + int refs; /* Reference count */ uint8_t msgc; /* Number of message in the message list */ sem_t exclsem; /* Only one thread can access at a time */ @@ -1118,6 +1118,10 @@ static int twi_reset(FAR struct i2c_master_s *dev) DEBUGASSERT(priv != NULL); + /* Our caller must own a ref */ + + DEBUGASSERT(priv->refs > 0); + /* Get exclusive access to the TWIHS device */ twi_takesem(&priv->exclsem); @@ -1342,6 +1346,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) { struct twi_dev_s *priv; uint32_t frequency; + const struct twi_attr_s *attr = 0; irqstate_t flags; int ret; @@ -1352,8 +1357,8 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) { /* Select up TWIHS0 and setup invariant attributes */ - priv = &g_twi0; - priv->attr = &g_twi0attr; + priv = &g_twi0; + attr = &g_twi0attr; /* Select the (initial) TWIHS frequency */ @@ -1366,8 +1371,8 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) { /* Select up TWIHS1 and setup invariant attributes */ - priv = &g_twi1; - priv->attr = &g_twi1attr; + priv = &g_twi1; + attr = &g_twi1attr; /* Select the (initial) TWIHS frequency */ @@ -1380,8 +1385,8 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) { /* Select up TWIHS2 and setup invariant attributes */ - priv = &g_twi2; - priv->attr = &g_twi2attr; + priv = &g_twi2; + attr = &g_twi2attr; /* Select the (initial) TWIHS frequency */ @@ -1394,14 +1399,16 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) return NULL; } - /* Perform one-time TWIHS initialization */ - flags = enter_critical_section(); /* Has the device already been initialized? */ - if (!priv->initd) + if ((volatile int)priv->refs++ == 0) { + /* Perform one-time TWIHS initialization */ + + priv->attr = attr; + /* Allocate a watchdog timer */ priv->timeout = wd_create(); @@ -1438,10 +1445,6 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) /* Perform repeatable TWIHS hardware initialization */ twi_hw_initialize(priv, frequency); - - /* Now it has been initialized */ - - priv->initd = true; } leave_critical_section(flags); @@ -1452,6 +1455,7 @@ errout_with_wdog: priv->timeout = NULL; errout_with_irq: + priv->refs--; leave_critical_section(flags); return NULL; } @@ -1469,28 +1473,40 @@ int sam_i2cbus_uninitialize(FAR struct i2c_master_s *dev) struct twi_dev_s *priv = (struct twi_dev_s *) dev; irqstate_t flags; - i2cinfo("TWIHS%d Un-initializing\n", priv->attr->twi); + DEBUGASSERT(priv); + + /* Decrement reference count and check for underflow */ + + if (priv->refs == 0) + { + return ERROR; + } + + i2cinfo("TWIHS%d Un-initializing refs:%d\n", priv->attr->twi, priv->refs); /* Disable TWIHS interrupts */ flags = enter_critical_section(); - up_disable_irq(priv->attr->irq); - /* Reset data structures */ + if (--priv->refs == 0) + { + up_disable_irq(priv->attr->irq); - sem_destroy(&priv->exclsem); - sem_destroy(&priv->waitsem); + /* Reset data structures */ - /* Free the watchdog timer */ + sem_destroy(&priv->exclsem); + sem_destroy(&priv->waitsem); - wd_delete(priv->timeout); - priv->timeout = NULL; + /* Free the watchdog timer */ - /* Detach Interrupt Handler */ + wd_delete(priv->timeout); + priv->timeout = NULL; - (void)irq_detach(priv->attr->irq); + /* Detach Interrupt Handler */ + + (void)irq_detach(priv->attr->irq); + } - priv->initd = false; leave_critical_section(flags); return OK; } From af25740ca5d62080823db5ebdb41f35afc78e151 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 15 Jun 2017 16:37:18 -0600 Subject: [PATCH 40/55] Update README: --- configs/clicker2-stm32/README.txt | 35 ++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/configs/clicker2-stm32/README.txt b/configs/clicker2-stm32/README.txt index da2af00c6c..6cb6de615f 100644 --- a/configs/clicker2-stm32/README.txt +++ b/configs/clicker2-stm32/README.txt @@ -362,16 +362,24 @@ Configurations NOTES: - 1. This is another NSH example. If differs from the mrf24j40 - configuration in that this configuration, like the usbnsh - configuration, it uses a USB serial device for console I/O. - Such a configuration is useful on the Clicker2 STM32 which - has no builtin RS-232 drivers and tangle of cables and jumpers - needed to debug multi-board setups. + 1. This configuration differs from the mrf24j40-mac configuration in + that this configuration, like the usbnsh configuration, uses a USB + serial device for console I/O. Such a configuration is useful on the + Clicker2 STM32 which has no builtin RS-232 drivers and eliminates the + tangle of cables and jumpers needed to debug multi-board setups. - Other NOTES for the usbnsh configuration should appy. + Most other NOTES for the usbnsh configuration should apply. Specific + differences between the usbnsh or mrf24j40-mac configurations and this + configuration are listed in these NOTES. - 2. This configuration does have USART3 output enabled and set up as + 2. One most serial terminal programs that I have used, the USB + connection will be lost when the target board is reset. When that + happens, you may have to reset your serial terminal program to adapt + to the new USB connection. Using TeraTerm, I actually have to exit + the serial program and restart it in order to detect and select the + re-established USB serial connection. + + 3. This configuration does have USART3 output enabled and set up as the system logging device: CONFIG_SYSLOG_CHAR=y : Use a character device for system logging @@ -414,7 +422,14 @@ Configurations NOTES: - 1. This configuration does have USART3 output enabled and set up as + 1. One most serial terminal programs that I have used, the USB + connection will be lost when the target board is reset. When that + happens, you may have to reset your serial terminal program to adapt + to the new USB connection. Using TeraTerm, I actually have to exit + the serial program and restart it in order to detect and select the + re-established USB serial connection. + + 2. This configuration does have USART3 output enabled and set up as the system logging device: CONFIG_SYSLOG_CHAR=y : Use a character device for system logging @@ -424,7 +439,7 @@ Configurations configuration so nothing should appear on USART3 unless you enable some debug output or enable the USB monitor. - 2. Enabling USB monitor SYSLOG output. If tracing is enabled, the USB + 3. Enabling USB monitor SYSLOG output. If tracing is enabled, the USB device will save encoded trace output in in-memory buffer; if the USB monitor is enabled, that trace buffer will be periodically emptied and dumped to the system logging device (USART3 in this From 777964a0cf84cece3ab52b7cb1ce9b2e35f77abe Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jun 2017 07:49:23 -0600 Subject: [PATCH 41/55] Clicker2-STM32: Enable RAMLOG in mrf24j40-6lowpan configuration. Update README. --- configs/clicker2-stm32/README.txt | 58 +++++++++++++---- .../clicker2-stm32/mrf24j40-6lowpan/defconfig | 62 ++++--------------- configs/sama5d4-ek/README.txt | 2 - 3 files changed, 59 insertions(+), 63 deletions(-) diff --git a/configs/clicker2-stm32/README.txt b/configs/clicker2-stm32/README.txt index da2af00c6c..4196b89829 100644 --- a/configs/clicker2-stm32/README.txt +++ b/configs/clicker2-stm32/README.txt @@ -352,13 +352,31 @@ Configurations CONFIG_NSH_ARCHINIT=y + 8. Configuration instructions: WPAN configuration must be performed + using the i8sak program. Detailed instructions are provided in a + README.txt file at apps/wireless/ieee802154/i8sak. You should make + sure that you are familiar with the content of that README.txt file. + + Here is a quick "cheat sheet" for associated to setting up a + coordinator and associating wth the WPAN: + + 1. Configure the Coordinator. On coordinator device do: + + nsh> i8 /dev/ieee0 startpan + nsh> i8 acceptassoc + + 2. Assocate and endpoint device with the WPAN. On the endpoint + device: + + nsh> i8 /dev/ieee0 assoc + mrf24j40-6lowpan This is another version of nsh that is very similar to the mrf24j40-mac - configuration but is focused on testing the IEEE 802.15.4 MAC integration - with the 6loWPAN network stack. I derives directly from the mrf24j40-mac - and all NOTES provided there apply. Additional differences are summarized - below: + configuration but is focused on testing the IEEE 802.15.4 MAC + integration with the 6loWPAN network stack. It derives directly from the + mrf24j40-mac and all NOTES provided there apply. Additional differences + are summarized below: NOTES: @@ -371,15 +389,33 @@ Configurations Other NOTES for the usbnsh configuration should appy. - 2. This configuration does have USART3 output enabled and set up as - the system logging device: + 2. This configuration does NOT have USART3 output enabled. This + configuration supports logging of debug output to a circular + buffer in RAM. This feature is discussed fully in this Wiki page: http://nuttx.org/doku.php?id=wiki:howtos:syslog . Relevant + configuration settings are summarized below: - CONFIG_SYSLOG_CHAR=y : Use a character device for system logging - CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" : USART3 will be /dev/ttyS0 + Device Drivers: + CONFIG_RAMLOG=y : Enable the RAM-based logging feature. + CONFIG_RAMLOG_CONSOLE=n : (We don't use the RAMLOG console) + CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the + system logger. + CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg + CONFIG_RAMLOG_BUFSIZE=8192 : Buffer size is 8KiB - However, there is nothing to generate SYLOG output in the default - configuration so nothing should appear on USART3 unless you enable - some debug output or enable the USB monitor. + NOTE: This RAMLOG feature is really only of value if debug output + is enabled. But, by default, no debug output is disabled in this + configuration. Therefore, there is no logic that will add anything + to the RAM buffer. This feature is configured and in place only + to support any future debugging needs that you may have. + + If you don't plan on using the debug features, then by all means + disable this feature and save 16KiB of RAM! + + NOTE: There is an issue with capturing data in the RAMLOG: If + the system crashes, all of the crash dump information will go into + the RAMLOG and you will be unable to access it! You can tell that + the system has crashed because (a) it will be unresponsive and (b) + the LD2 will be blinking at about 2Hz. nsh: diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig index 6332ccc671..649fd33700 100644 --- a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig @@ -151,7 +151,6 @@ CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y CONFIG_ARMV7M_HAVE_STACKCHECK=y # CONFIG_ARMV7M_STACKCHECK is not set # CONFIG_ARMV7M_ITMSYSLOG is not set -# CONFIG_SERIAL_TERMIOS is not set # # STM32 Configuration Options @@ -450,7 +449,7 @@ CONFIG_STM32_SYSCFG=y # CONFIG_STM32_TIM14 is not set # CONFIG_STM32_USART1 is not set # CONFIG_STM32_USART2 is not set -CONFIG_STM32_USART3=y +# CONFIG_STM32_USART3 is not set # CONFIG_STM32_UART4 is not set # CONFIG_STM32_UART5 is not set # CONFIG_STM32_USART6 is not set @@ -490,27 +489,6 @@ CONFIG_STM32_CCMEXCLUDE=y # CONFIG_STM32_TIM12_CAP is not set # CONFIG_STM32_TIM13_CAP is not set # CONFIG_STM32_TIM14_CAP is not set -CONFIG_STM32_USART=y -CONFIG_STM32_SERIALDRIVER=y - -# -# U[S]ART Configuration -# - -# -# U[S]ART Device Configuration -# -CONFIG_STM32_USART3_SERIALDRIVER=y -# CONFIG_STM32_USART3_1WIREDRIVER is not set -# CONFIG_USART3_RS485 is not set - -# -# Serial Driver Configuration -# -# CONFIG_SERIAL_DISABLE_REORDERING is not set -# CONFIG_STM32_FLOWCONTROL_BROKEN is not set -# CONFIG_STM32_USART_BREAKS is not set -# CONFIG_STM32_USART_SINGLEWIRE is not set # # SPI Configuration @@ -845,35 +823,19 @@ CONFIG_SERIAL_REMOVABLE=y # CONFIG_USART0_SERIALDRIVER is not set # CONFIG_USART1_SERIALDRIVER is not set # CONFIG_USART2_SERIALDRIVER is not set -CONFIG_USART3_SERIALDRIVER=y +# CONFIG_USART3_SERIALDRIVER is not set # CONFIG_USART4_SERIALDRIVER is not set # CONFIG_USART5_SERIALDRIVER is not set # CONFIG_USART6_SERIALDRIVER is not set # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set -CONFIG_MCU_SERIAL=y +# CONFIG_MCU_SERIAL is not set CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set -CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y -# CONFIG_USART3_SERIAL_CONSOLE is not set -# CONFIG_OTHER_SERIAL_CONSOLE is not set -CONFIG_NO_SERIAL_CONSOLE=y - -# -# USART3 Configuration -# -CONFIG_USART3_RXBUFSIZE=256 -CONFIG_USART3_TXBUFSIZE=256 -CONFIG_USART3_BAUD=115200 -CONFIG_USART3_BITS=8 -CONFIG_USART3_PARITY=0 -CONFIG_USART3_2STOP=0 -# CONFIG_USART3_IFLOWCONTROL is not set -# CONFIG_USART3_OFLOWCONTROL is not set -# CONFIG_USART3_DMA is not set +# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set # CONFIG_PSEUDOTERM is not set CONFIG_USBDEV=y @@ -933,18 +895,18 @@ CONFIG_IEEE802154_MRF24J40=y # System Logging # # CONFIG_ARCH_SYSLOG is not set -CONFIG_SYSLOG_WRITE=y -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_BUFFER is not set -CONFIG_SYSLOG_INTBUFFER=y -CONFIG_SYSLOG_INTBUFSIZE=396 +# CONFIG_SYSLOG_WRITE is not set +CONFIG_RAMLOG=y +CONFIG_RAMLOG_BUFSIZE=8192 +# CONFIG_RAMLOG_CRLF is not set +CONFIG_RAMLOG_NONBLOCKING=y +# CONFIG_SYSLOG_INTBUFFER is not set # CONFIG_SYSLOG_TIMESTAMP is not set # CONFIG_SYSLOG_SERIAL_CONSOLE is not set -CONFIG_SYSLOG_CHAR=y +# CONFIG_SYSLOG_CHAR is not set +CONFIG_RAMLOG_SYSLOG=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set -CONFIG_SYSLOG_CHAR_CRLF=y -CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" # CONFIG_SYSLOG_CHARDEV is not set # diff --git a/configs/sama5d4-ek/README.txt b/configs/sama5d4-ek/README.txt index 839daa66df..42a3ef0fcd 100644 --- a/configs/sama5d4-ek/README.txt +++ b/configs/sama5d4-ek/README.txt @@ -4259,8 +4259,6 @@ Configurations http://nuttx.org/doku.php?id=wiki:howtos:syslog . Relevant configuration settings are summarized below: - File System: - Device Drivers: CONFIG_RAMLOG=y : Enable the RAM-based logging feature. CONFIG_RAMLOG_CONSOLE=n : (We don't use the RAMLOG console) From 31bde601b6930ed929e43a43645c8f4e93f5018d Mon Sep 17 00:00:00 2001 From: Oleg Evseev Date: Fri, 16 Jun 2017 14:43:11 +0000 Subject: [PATCH 42/55] Kconfig correction edited online with Bitbucket --- drivers/usbhost/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usbhost/Kconfig b/drivers/usbhost/Kconfig index e8a9a27934..b2cadb3812 100644 --- a/drivers/usbhost/Kconfig +++ b/drivers/usbhost/Kconfig @@ -98,7 +98,7 @@ config USBHOST_MSC default n depends on !BULK_DISABLE ---help--- - Enable support for the keyboard class driver. This also depends on + Enable support for the mass storage class driver. This also depends on NFILE_DESCRIPTORS > 0 && SCHED_WORKQUEUE=y config USBHOST_CDCACM From 4d9be9bc20f8b11e3fad30f7daf4484c8c988cd1 Mon Sep 17 00:00:00 2001 From: Sebastien Lorquet Date: Fri, 16 Jun 2017 08:46:34 -0600 Subject: [PATCH 43/55] STM32 F4 FLASH: Enable/disable the flash write protection on any sector. I have verified it to work on the stm32f427. --- arch/arm/src/stm32/chip/stm32_flash.h | 4 ++ arch/arm/src/stm32/stm32_flash.c | 83 +++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/arch/arm/src/stm32/chip/stm32_flash.h b/arch/arm/src/stm32/chip/stm32_flash.h index 13c966c05c..2c96c4ddbd 100644 --- a/arch/arm/src/stm32/chip/stm32_flash.h +++ b/arch/arm/src/stm32/chip/stm32_flash.h @@ -466,4 +466,8 @@ void stm32_flash_lock(void); void stm32_flash_unlock(void); +#ifdef CONFIG_STM32_STM32F40XX +int stm32_flash_writeprotect(size_t page, bool enabled); +#endif + #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_FLASH_H */ diff --git a/arch/arm/src/stm32/stm32_flash.c b/arch/arm/src/stm32/stm32_flash.c index 1dae18724c..6291154cc0 100644 --- a/arch/arm/src/stm32/stm32_flash.c +++ b/arch/arm/src/stm32/stm32_flash.c @@ -79,6 +79,8 @@ #else # define FLASH_KEY1 0x45670123 # define FLASH_KEY2 0xCDEF89AB +# define FLASH_OPTKEY1 0x08192A3B +# define FLASH_OPTKEY2 0x4C5D6E7F #endif #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) @@ -384,6 +386,87 @@ ssize_t stm32_eeprom_erase(size_t addr, size_t eraselen) #endif /* defined(CONFIG_STM32_STM32L15XX) */ +/************************************************************************************ + * Name: stm32_flash_writeprotect + * + * Description: + * Enable or disable the write protection of a flash sector. + * + ************************************************************************************/ + +#ifdef CONFIG_STM32_STM32F40XX +int stm32_flash_writeprotect(size_t page, bool enabled) +{ + uint32_t reg; + uint32_t val; + +#ifdef CONFIG_STM32_STM32F40XX + if (page >= STM32_FLASH_NPAGES) + { + return -EFAULT; + } +#else +# warning missing logic in stm32_flash_writeprotect +#endif + + /* Select the register that contains the bit to be changed */ + + if (page < 12) + { + reg = STM32_FLASH_OPTCR; + } +#if defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F40XX) + else + { + reg = STM32_FLASH_OPTCR1; + page -= 12; + } +#else + else + { + return -EFAULT; + } +#endif + + /* Read the option status */ + + val = getreg32(reg); + + /* Set or clear the protection */ + + if (enabled) + { + val &= ~(1 << (16+page) ); + } + else + { + val |= (1 << (16+page) ); + } + + /* Unlock options */ + + putreg32(FLASH_OPTKEY1, STM32_FLASH_OPTKEYR); + putreg32(FLASH_OPTKEY2, STM32_FLASH_OPTKEYR); + + /* Write options */ + + putreg32(val, reg); + + /* Trigger programmation */ + + modifyreg32(STM32_FLASH_OPTCR, 0, FLASH_OPTCR_OPTSTRT); + + /* Wait for completion */ + + while(getreg32(STM32_FLASH_SR) & FLASH_SR_BSY) up_waste(); + + /* Relock options */ + + modifyreg32(STM32_FLASH_OPTCR, 0, FLASH_OPTCR_OPTLOCK); + return 0; +} +#endif + #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) size_t up_progmem_pagesize(size_t page) { From 5245cbc6f51bd7b8814a960e4e3ade8e61f8f490 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jun 2017 09:34:22 -0600 Subject: [PATCH 44/55] STM32 SPI/I2S: Back out a bad pin mapping change from 4ab2a3661ea57211f4ae12fe21c5de3454ba0ef2. Try to staighten out some I2C3 and SPI3 pin configuration stuff. --- arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h | 2 +- arch/arm/src/stm32/stm32_i2s.c | 4 ++-- configs/stm32f4discovery/include/board.h | 13 +++---------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h index 1f7b5944ea..d44c664edb 100644 --- a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h @@ -615,7 +615,7 @@ #endif #define GPIO_SPI3_MISO_1 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN4) -#define GPIO_SPI3_MISO_2 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTC|GPIO_PIN7) +#define GPIO_SPI3_MISO_2 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTC|GPIO_PIN11) #define GPIO_SPI3_MOSI_1 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN5) #define GPIO_SPI3_MOSI_2 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTC|GPIO_PIN12) #define GPIO_SPI3_NSS_1 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN15) diff --git a/arch/arm/src/stm32/stm32_i2s.c b/arch/arm/src/stm32/stm32_i2s.c index 0f246f5763..1f5d348384 100644 --- a/arch/arm/src/stm32/stm32_i2s.c +++ b/arch/arm/src/stm32/stm32_i2s.c @@ -2333,7 +2333,7 @@ static int i2s_dma_allocate(struct stm32_i2s_s *priv) { /* Allocate an RX DMA channel */ - priv->rx.dma = stm32_dmachannel(DMAMAP_SPI3_RX_2); + priv->rx.dma = stm32_dmachannel(DMACHAN_I2S3_RX); if (!priv->rx.dma) { i2serr("ERROR: Failed to allocate the RX DMA channel\n"); @@ -2356,7 +2356,7 @@ static int i2s_dma_allocate(struct stm32_i2s_s *priv) { /* Allocate a TX DMA channel */ - priv->tx.dma = stm32_dmachannel(DMAMAP_SPI3_TX_2); + priv->tx.dma = stm32_dmachannel(DMACHAN_I2S3_TX); if (!priv->tx.dma) { i2serr("ERROR: Failed to allocate the TX DMA channel\n"); diff --git a/configs/stm32f4discovery/include/board.h b/configs/stm32f4discovery/include/board.h index 91077e674f..273c8945b2 100644 --- a/configs/stm32f4discovery/include/board.h +++ b/configs/stm32f4discovery/include/board.h @@ -310,21 +310,14 @@ #define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 #define GPIO_SPI2_SCK GPIO_SPI2_SCK_1 -/* SPI3 - Onboard devices use SPI3 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_2 -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 -#define GPIO_SPI3_NSS GPIO_SPI3_NSS_2 - -/* I2S3 - Onboard devices use I2S3 */ +/* I2S3 - CS43L22 configuration uses I2S3 */ #define GPIO_I2S3_SD GPIO_I2S3_SD_2 #define GPIO_I2S3_CK GPIO_I2S3_CK_2 #define GPIO_I2S3_WS GPIO_I2S3_WS_1 -#define DMACHAN_SPI3_RX DMAMAP_SPI3_RX_2 -#define DMACHAN_SPI3_TX DMAMAP_SPI3_TX_2 +#define DMACHAN_I2S3_RX DMAMAP_SPI3_RX_2 +#define DMACHAN_I2S3_TX DMAMAP_SPI3_TX_2 /* I2C config to use with Nunchuk PB7 (SDA) and PB8 (SCL) */ From ab2028d73eb8147d15476bf9e1888b7c82645c1f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jun 2017 09:55:21 -0600 Subject: [PATCH 45/55] Fix a long line in a README file --- configs/clicker2-stm32/README.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configs/clicker2-stm32/README.txt b/configs/clicker2-stm32/README.txt index c615f1dff8..da90fdd8ac 100644 --- a/configs/clicker2-stm32/README.txt +++ b/configs/clicker2-stm32/README.txt @@ -399,7 +399,8 @@ Configurations 3. This configuration does NOT have USART3 output enabled. This configuration supports logging of debug output to a circular - buffer in RAM. This feature is discussed fully in this Wiki page: http://nuttx.org/doku.php?id=wiki:howtos:syslog . Relevant + buffer in RAM. This feature is discussed fully in this Wiki page: + http://nuttx.org/doku.php?id=wiki:howtos:syslog . Relevant configuration settings are summarized below: Device Drivers: From 0b652d04515fcd44bf7e161e438b418ac284c165 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jun 2017 13:24:07 -0600 Subject: [PATCH 46/55] Update some Kconfig help comments --- net/sixlowpan/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/sixlowpan/Kconfig b/net/sixlowpan/Kconfig index 674eff01f6..ae977359e0 100644 --- a/net/sixlowpan/Kconfig +++ b/net/sixlowpan/Kconfig @@ -141,6 +141,12 @@ config NET_6LOWPAN_EXTENDEDADDR device's link layer address. If this option is selected, then an 8-byte extended address will be used. + All devices operating on a network have unique, 8-byte addresses, + referred to as extended addresses. A device will use either the + extended address for direct communication within the PAN or the + short 2-byte address that was allocated by the PAN coordinator when + the device associated. + config NET_6LOWPAN_MAXAGE int "Packet reassembly timeout" default 20 From 1f42ab7b7dbab8218d777476d1ec2a1499e3cd78 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jun 2017 15:40:00 -0600 Subject: [PATCH 47/55] Clicker2-stm32: Allow both IEEE 802.15.4 MAC character and network devices to be registered. --- configs/clicker2-stm32/src/stm32_mrf24j40.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configs/clicker2-stm32/src/stm32_mrf24j40.c b/configs/clicker2-stm32/src/stm32_mrf24j40.c index c89b28b838..1d5733edde 100644 --- a/configs/clicker2-stm32/src/stm32_mrf24j40.c +++ b/configs/clicker2-stm32/src/stm32_mrf24j40.c @@ -255,7 +255,7 @@ static int stm32_mrf24j40_devsetup(FAR struct stm32_priv_s *priv) return -ENODEV; } -#if defined(CONFIG_IEEE802154_NETDEV) +#ifdef CONFIG_IEEE802154_NETDEV /* Use the IEEE802.15.4 MAC interface instance to create a 6loWPAN * network interface by wrapping the MAC intrface instance in a * network device driver via mac802154dev_register(). @@ -268,7 +268,9 @@ static int stm32_mrf24j40_devsetup(FAR struct stm32_priv_s *priv) 0, ret); return ret; } -#elif defined(CONFIG_IEEE802154_MAC_DEV) +#endif + +#ifdef CONFIG_IEEE802154_MAC_DEV /* If want to call these APIs from userspace, you have to wrap the MAC * interface in a character device viamac802154dev_register(). */ From 4588226d7198a08ce792c4b694c8cf2233d10056 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jun 2017 16:47:27 -0600 Subject: [PATCH 48/55] Clicker2-STM32: Enable networking and 6loWPAN in the mrf24j40-6lowpan configuration. Fix a couple of new 6loWPAN compile issues revealed by this new configuration. --- configs/clicker2-stm32/README.txt | 12 +- .../clicker2-stm32/mrf24j40-6lowpan/defconfig | 240 +++++++++++++++++- net/Kconfig | 2 +- net/sixlowpan/sixlowpan_tcpsend.c | 2 + net/sixlowpan/sixlowpan_udpsend.c | 6 +- 5 files changed, 249 insertions(+), 13 deletions(-) diff --git a/configs/clicker2-stm32/README.txt b/configs/clicker2-stm32/README.txt index da90fdd8ac..274b9a2b0c 100644 --- a/configs/clicker2-stm32/README.txt +++ b/configs/clicker2-stm32/README.txt @@ -418,7 +418,7 @@ Configurations to support any future debugging needs that you may have. If you don't plan on using the debug features, then by all means - disable this feature and save 16KiB of RAM! + disable this feature and save 8KiB of RAM! NOTE: There is an issue with capturing data in the RAMLOG: If the system crashes, all of the crash dump information will go into @@ -426,6 +426,16 @@ Configurations the system has crashed because (a) it will be unresponsive and (b) the LD2 will be blinking at about 2Hz. + 4. IPv6 networking is enabled with TCP/IP, UDP, 6loWPAN, and NSH + Telnet support. + + 5. Configuration instructions: Basic PAN configuration is the same as + for the ieee802154-mac configuration with the exception that after + the PAN has been configured with the i8sak utility, you must + explicity bring the network up: + + nsh> ifup wpan0 + nsh: Configures the NuttShell (nsh) located at examples/nsh. This diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig index 649fd33700..37297ef9dd 100644 --- a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig @@ -800,6 +800,27 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_MODEM is not set # CONFIG_MTD is not set # CONFIG_EEPROM is not set +CONFIG_NETDEVICES=y + +# +# General Ethernet MAC Driver Options +# +# CONFIG_NETDEV_LOOPBACK is not set +CONFIG_NETDEV_TELNET=y +CONFIG_TELNET_RXBUFFER_SIZE=256 +CONFIG_TELNET_TXBUFFER_SIZE=256 +# CONFIG_NETDEV_MULTINIC is not set +# CONFIG_ARCH_HAVE_NETDEV_STATISTICS is not set +CONFIG_NETDEV_LATEINIT=y + +# +# External Ethernet MAC Device Support +# +# CONFIG_NET_DM90x0 is not set +# CONFIG_ENC28J60 is not set +# CONFIG_ENCX24J600 is not set +# CONFIG_NET_SLIP is not set +# CONFIG_NET_FTMAC100 is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set @@ -912,9 +933,129 @@ CONFIG_RAMLOG_SYSLOG=y # # Networking Support # -# CONFIG_ARCH_HAVE_NET is not set +CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set +CONFIG_NET=y +# CONFIG_NET_PROMISCUOUS is not set + +# +# Driver buffer configuration +# +CONFIG_NET_GUARDSIZE=2 + +# +# Data link support +# +# CONFIG_NET_MULTILINK is not set +# CONFIG_NET_ETHERNET is not set +CONFIG_NET_6LOWPAN=y +# CONFIG_NET_LOOPBACK is not set +# CONFIG_NET_TUN is not set +# CONFIG_NET_USRSOCK is not set + +# +# Network Device Operations +# +CONFIG_NETDEV_IOCTL=y +# CONFIG_NETDEV_PHY_IOCTL is not set +CONFIG_NETDEV_WIRELESS_IOCTL=y + +# +# Internet Protocol Selection +# +# CONFIG_NET_IPv4 is not set +CONFIG_NET_IPv6=y +CONFIG_NET_IPv6_NCONF_ENTRIES=8 + +# +# 6LoWPAN Configuration +# +CONFIG_NET_6LOWPAN_FRAG=y +CONFIG_NET_6LOWPAN_FRAMELEN=127 +# CONFIG_NET_6LOWPAN_COMPRESSION_IPv6 is not set +# CONFIG_NET_6LOWPAN_COMPRESSION_HC1 is not set +CONFIG_NET_6LOWPAN_COMPRESSION_HC06=y +CONFIG_NET_6LOWPAN_COMPRESSION_THRESHOLD=63 +CONFIG_NET_6LOWPAN_MAXADDRCONTEXT=1 +CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_0_0=0xaa +CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_0_1=0xaa +# CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREINIT_1 is not set +# CONFIG_NET_6LOWPAN_EXTENDEDADDR is not set +CONFIG_NET_6LOWPAN_MAXAGE=20 +CONFIG_NET_6LOWPAN_MAX_MACTRANSMITS=4 +CONFIG_NET_6LOWPAN_MTU=1294 +CONFIG_NET_6LOWPAN_TCP_RECVWNDO=1220 + +# +# Socket Support +# +CONFIG_NSOCKET_DESCRIPTORS=8 +CONFIG_NET_NACTIVESOCKETS=16 +CONFIG_NET_SOCKOPTS=y +# CONFIG_NET_SOLINGER is not set + +# +# Raw Socket Support +# +# CONFIG_NET_PKT is not set + +# +# Unix Domain Socket Support +# +# CONFIG_NET_LOCAL is not set + +# +# TCP/IP Networking +# +CONFIG_NET_TCP=y +# CONFIG_NET_TCP_NO_STACK is not set +# CONFIG_NET_TCPURGDATA is not set +CONFIG_NET_TCP_CONNS=8 +CONFIG_NET_MAX_LISTENPORTS=20 +CONFIG_NET_TCP_READAHEAD=y +CONFIG_NET_TCP_WRITE_BUFFERS=y +CONFIG_NET_TCP_NWRBCHAINS=8 +CONFIG_NET_TCP_RECVDELAY=0 +CONFIG_NET_TCPBACKLOG=y +# CONFIG_NET_SENDFILE is not set + +# +# UDP Networking +# +CONFIG_NET_UDP=y +# CONFIG_NET_UDP_NO_STACK is not set +CONFIG_NET_UDP_CHECKSUMS=y +CONFIG_NET_UDP_CONNS=8 +CONFIG_NET_BROADCAST=y +# CONFIG_NET_RXAVAIL is not set +CONFIG_NET_UDP_READAHEAD=y + +# +# ICMPv6 Networking Support +# +# CONFIG_NET_ICMPv6 is not set + +# +# IGMPv2 Client Support +# +# CONFIG_NET_IGMP is not set + +# +# ARP Configuration +# + +# +# User-space networking stack API +# +# CONFIG_NET_ARCH_INCR32 is not set +# CONFIG_NET_ARCH_CHKSUM is not set +CONFIG_NET_STATISTICS=y + +# +# Routing Table Configuration +# +# CONFIG_NET_ROUTE is not set +CONFIG_NET_HOSTNAME="MRF24J40" # # Crypto API @@ -959,6 +1100,7 @@ CONFIG_FS_PROCFS=y # CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set # CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set # CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set +# CONFIG_FS_PROCFS_EXCLUDE_NET is not set # CONFIG_FS_UNIONFS is not set # @@ -978,10 +1120,10 @@ CONFIG_MM_REGIONS=1 # Common I/O Buffer Support # CONFIG_MM_IOB=y -CONFIG_IOB_NBUFFERS=8 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=0 -CONFIG_IOB_THROTTLE=0 +CONFIG_IOB_NBUFFERS=32 +CONFIG_IOB_BUFSIZE=128 +CONFIG_IOB_NCHAINS=16 +CONFIG_IOB_THROTTLE=8 # # Audio Support @@ -999,6 +1141,8 @@ CONFIG_MAC802154_HPWORK=y CONFIG_IEEE802154_NTXDESC=3 CONFIG_IEEE802154_IND_PREALLOC=20 CONFIG_IEEE802154_IND_IRQRESERVE=10 +# CONFIG_IEEE802154_NETDEV is not set +# CONFIG_IEEE802154_LOOPBACK is not set # # Binary Loader @@ -1101,13 +1245,13 @@ CONFIG_ARCH_HAVE_TLS=y # Network-Related Options # # CONFIG_LIBC_IPv4_ADDRCONV is not set -# CONFIG_LIBC_IPv6_ADDRCONV is not set -# CONFIG_LIBC_NETDB is not set +CONFIG_LIBC_NETDB=y # # NETDB Support # # CONFIG_NETDB_HOSTFILE is not set +# CONFIG_NETDB_DNSCLIENT is not set # CONFIG_LIBC_IOCTL_VARIADIC is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 @@ -1158,6 +1302,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_DISCOVER is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FSTEST is not set # CONFIG_EXAMPLES_FTPC is not set @@ -1172,6 +1317,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_NETTEST is not set # CONFIG_EXAMPLES_NRF24L01TERM is not set CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y @@ -1202,6 +1348,8 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UDPBLASTER is not set # CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -1242,10 +1390,19 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # Network Utilities # # CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DISCOVER is not set # CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_JSON is not set +CONFIG_NETUTILS_NETLIB=y +# CONFIG_NETUTILS_NTPCLIENT is not set +# CONFIG_NETUTILS_PPPD is not set # CONFIG_NETUTILS_SMTP is not set +CONFIG_NETUTILS_TELNETD=y +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_WEBCLIENT is not set +# CONFIG_NETUTILS_WEBSERVER is not set +# CONFIG_NETUTILS_XMLRPC is not set # # NSH Library @@ -1343,10 +1500,72 @@ CONFIG_NSH_FILEIOSIZE=512 # CONFIG_NSH_CONSOLE=y # CONFIG_NSH_USBCONSOLE is not set -# CONFIG_NSH_ALTCONDEV is not set CONFIG_NSH_ARCHINIT=y + +# +# Networking Configuration +# +CONFIG_NSH_NETINIT=y +CONFIG_NSH_NETLOCAL=y + +# +# IP Address Configuration +# + +# +# Target IPv6 address +# +CONFIG_NSH_IPv6ADDR_1=0xfc00 +CONFIG_NSH_IPv6ADDR_2=0x0000 +CONFIG_NSH_IPv6ADDR_3=0x0000 +CONFIG_NSH_IPv6ADDR_4=0x0000 +CONFIG_NSH_IPv6ADDR_5=0x0000 +CONFIG_NSH_IPv6ADDR_6=0x00ff +CONFIG_NSH_IPv6ADDR_7=0xfe00 +CONFIG_NSH_IPv6ADDR_8=0xa9cd + +# +# Router IPv6 address +# +CONFIG_NSH_DRIPv6ADDR_1=0xfc00 +CONFIG_NSH_DRIPv6ADDR_2=0x0000 +CONFIG_NSH_DRIPv6ADDR_3=0x0000 +CONFIG_NSH_DRIPv6ADDR_4=0x0000 +CONFIG_NSH_DRIPv6ADDR_5=0x0000 +CONFIG_NSH_DRIPv6ADDR_6=0x00ff +CONFIG_NSH_DRIPv6ADDR_7=0xfe00 +CONFIG_NSH_DRIPv6ADDR_8=0x1034 + +# +# IPv6 Network mask +# +CONFIG_NSH_IPv6NETMASK_1=0xffff +CONFIG_NSH_IPv6NETMASK_2=0xffff +CONFIG_NSH_IPv6NETMASK_3=0xffff +CONFIG_NSH_IPv6NETMASK_4=0xffff +CONFIG_NSH_IPv6NETMASK_5=0xffff +CONFIG_NSH_IPv6NETMASK_6=0xffff +CONFIG_NSH_IPv6NETMASK_7=0xffff +CONFIG_NSH_IPv6NETMASK_8=0x0000 +CONFIG_NSH_NOMAC=y +CONFIG_NSH_SWMAC=y +CONFIG_NSH_MACADDR=0xabcd +CONFIG_NSH_PANID=0xface +CONFIG_NSH_MAX_ROUNDTRIP=20 + +# +# Telnet Configuration +# +CONFIG_NSH_TELNET=y +CONFIG_NSH_TELNETD_PORT=23 +CONFIG_NSH_TELNETD_DAEMONPRIO=100 +CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=2048 +CONFIG_NSH_TELNETD_CLIENTPRIO=100 +CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=2048 +CONFIG_NSH_IOBUFFER_SIZE=512 # CONFIG_NSH_LOGIN is not set # CONFIG_NSH_CONSOLE_LOGIN is not set +# CONFIG_NSH_TELNET_LOGIN is not set # # NxWidgets/NxWM @@ -1368,6 +1587,8 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set +# CONFIG_SYSTEM_NETDB is not set +# CONFIG_SYSTEM_NTPC is not set # CONFIG_SYSTEM_RAMTEST is not set CONFIG_READLINE_HAVE_EXTMATCH=y CONFIG_SYSTEM_READLINE=y @@ -1393,3 +1614,4 @@ CONFIG_IEEE802154_LIBUTILS=y CONFIG_IEEE802154_I8SAK=y CONFIG_IEEE802154_I8SAK_PRIORITY=100 CONFIG_IEEE802154_I8SAK_STACKSIZE=2048 +# CONFIG_WIRELESS_IWPAN is not set diff --git a/net/Kconfig b/net/Kconfig index c5f7d26117..62b5e5ae39 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -137,7 +137,7 @@ config NET_6LOWPAN select NETDEV_MULTINIC if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN select NET_MULTILINK if NET_ETHERNET || NET_LOOPBACK || NET_SLIP || NET_TUN select NETDEV_IOCTL - depends on EXPERIMENTAL && NET_IPv6 + depends on NET_IPv6 ---help--- Enable support for IEEE 802.15.4 Low power Wireless Personal Area Networking (6LoWPAN). diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c index 5ae5de0b81..d15e4f024a 100644 --- a/net/sixlowpan/sixlowpan_tcpsend.c +++ b/net/sixlowpan/sixlowpan_tcpsend.c @@ -263,7 +263,9 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf, /* Copy the source and destination addresses */ +#ifdef CONFIG_NETDEV_MULTINIC net_ipv6addr_hdrcopy(ipv6tcp.ipv6.srcipaddr, conn->u.ipv6.laddr); +#endif net_ipv6addr_hdrcopy(ipv6tcp.ipv6.destipaddr, conn->u.ipv6.raddr); ninfo("IPv6 length: %d\n", diff --git a/net/sixlowpan/sixlowpan_udpsend.c b/net/sixlowpan/sixlowpan_udpsend.c index 7036589e09..f9efd643cc 100644 --- a/net/sixlowpan/sixlowpan_udpsend.c +++ b/net/sixlowpan/sixlowpan_udpsend.c @@ -78,7 +78,7 @@ ****************************************************************************/ #ifdef CONFIG_NET_UDP_CHECKSUMS -static uint16_t sixlowpan_udp_chksum(FAR struct ipv6udp_hdr_s *ipv6udp, +static uint16_t sixlowpan_udp_chksum(FAR const struct ipv6udp_hdr_s *ipv6udp, FAR const uint8_t *buf, uint16_t buflen) { uint16_t upperlen; @@ -258,7 +258,9 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock, /* Copy the source and destination addresses */ net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr, to6->sin6_addr.in6_u.u6_addr16); +#ifdef CONFIG_NETDEV_MULTINIC net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, conn->u.ipv6.laddr); +#endif ninfo("IPv6 length: %d\n", ((int)ipv6udp.ipv6.len[0] << 8) + ipv6udp.ipv6.len[1]); @@ -275,7 +277,7 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock, ipv6udp.udp.udpchksum = 0; #ifdef CONFIG_NET_UDP_CHECKSUMS - ipv6udp.udp.udpchksum = ~sixlowpan_udp_chksum(ipv6udp, buf, buflen); + ipv6udp.udp.udpchksum = ~sixlowpan_udp_chksum(&ipv6udp, buf, buflen); if (ipv6udp.udp.udpchksum == 0) { ipv6udp.udp.udpchksum = 0xffff; From a0722750d8fdcb852b77ec69bcc647917bec9152 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jun 2017 18:02:46 -0600 Subject: [PATCH 49/55] clicker2-stm32: mrf24j40-6lowpan configuration needs to enabled the ieee 802.15.4 MAC network device as well. --- configs/clicker2-stm32/mrf24j40-6lowpan/defconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig index 37297ef9dd..4619b2291a 100644 --- a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig @@ -810,7 +810,8 @@ CONFIG_NETDEV_TELNET=y CONFIG_TELNET_RXBUFFER_SIZE=256 CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NETDEV_MULTINIC is not set -# CONFIG_ARCH_HAVE_NETDEV_STATISTICS is not set +CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y +CONFIG_NETDEV_STATISTICS=y CONFIG_NETDEV_LATEINIT=y # @@ -1141,7 +1142,8 @@ CONFIG_MAC802154_HPWORK=y CONFIG_IEEE802154_NTXDESC=3 CONFIG_IEEE802154_IND_PREALLOC=20 CONFIG_IEEE802154_IND_IRQRESERVE=10 -# CONFIG_IEEE802154_NETDEV is not set +CONFIG_IEEE802154_NETDEV=y +CONFIG_IEEE802154_NETDEV_HPWORK=y # CONFIG_IEEE802154_LOOPBACK is not set # From c79d4d19888d82024de7bc3795972f533d802b52 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 16 Jun 2017 13:46:09 -1000 Subject: [PATCH 50/55] stm32:flash add CONFIG_STM32_STM32F469 to list defining OPTCR1 --- arch/arm/src/stm32/chip/stm32_flash.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32/chip/stm32_flash.h b/arch/arm/src/stm32/chip/stm32_flash.h index 2c96c4ddbd..89e60e39a5 100644 --- a/arch/arm/src/stm32/chip/stm32_flash.h +++ b/arch/arm/src/stm32/chip/stm32_flash.h @@ -254,7 +254,8 @@ # endif #endif -#if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) +#if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) || \ + defined(CONFIG_STM32_STM32F469) # define STM32_FLASH_OPTCR1_OFFSET 0x0018 #endif @@ -287,7 +288,8 @@ # elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) # define STM32_FLASH_OPTCR (STM32_FLASHIF_BASE+STM32_FLASH_OPTCR_OFFSET) # endif -# if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) +# if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) || \ + defined(CONFIG_STM32_STM32F469) # define STM32_FLASH_OPTCR1 (STM32_FLASHIF_BASE+STM32_FLASH_OPTCR1_OFFSET) # endif #endif From c27cee2a94b68a94718213da023f46de6f312c0c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 17 Jun 2017 07:34:35 -0600 Subject: [PATCH 51/55] configs/sim/sixlowpan: Refresh configuration. --- configs/sim/sixlowpan/defconfig | 51 +++++++++++++++---- .../wireless/ieee802154/ieee802154_ioctl.h | 4 -- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/configs/sim/sixlowpan/defconfig b/configs/sim/sixlowpan/defconfig index 713c8b1f50..3046c8af7a 100644 --- a/configs/sim/sixlowpan/defconfig +++ b/configs/sim/sixlowpan/defconfig @@ -34,6 +34,7 @@ CONFIG_BUILD_FLAT=y # CONFIG_MOTOROLA_SREC is not set CONFIG_RAW_BINARY=y # CONFIG_UBOOT_UIMAGE is not set +# CONFIG_DFU_BINARY is not set # # Customize Header Files @@ -88,6 +89,8 @@ CONFIG_SIM_X8664_MICROSOFT=y # CONFIG_SIM_FRAMEBUFFER is not set # CONFIG_SIM_SPIFLASH is not set # CONFIG_SIM_QSPIFLASH is not set +# CONFIG_ARCH_TOOLCHAIN_IAR is not set +# CONFIG_ARCH_TOOLCHAIN_GNU is not set # # Architecture Options @@ -108,6 +111,7 @@ CONFIG_ARCH_HAVE_MULTICPU=y # CONFIG_ARCH_HAVE_EXTCLK is not set CONFIG_ARCH_HAVE_POWEROFF=y # CONFIG_ARCH_HAVE_RESET is not set +# CONFIG_ARCH_HAVE_RTC_SUBSECONDS is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set @@ -294,15 +298,6 @@ CONFIG_DEV_NULL=y # # Buffering # - -# -# Common I/O Buffer Support -# -CONFIG_MM_IOB=y -CONFIG_IOB_NBUFFERS=36 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=8 -CONFIG_IOB_THROTTLE=8 # CONFIG_DRVR_WRITEBUFFER is not set # CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set @@ -481,14 +476,21 @@ CONFIG_STANDARD_SERIAL=y # CONFIG_USBHOST is not set # CONFIG_USBMISC is not set # CONFIG_HAVE_USBTRACE is not set -# CONFIG_DRIVERS_WIRELESS is not set +CONFIG_DRIVERS_WIRELESS=y +# CONFIG_WL_CC1101 is not set +# CONFIG_WL_CC3000 is not set +# CONFIG_DRIVERS_IEEE802154 is not set +# CONFIG_DRIVERS_IEEE80211 is not set +# CONFIG_WL_NRF24L01 is not set # CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging # # CONFIG_ARCH_SYSLOG is not set +CONFIG_SYSLOG_WRITE=y # CONFIG_RAMLOG is not set +# CONFIG_SYSLOG_BUFFER is not set # CONFIG_SYSLOG_INTBUFFER is not set # CONFIG_SYSLOG_TIMESTAMP is not set CONFIG_SYSLOG_SERIAL_CONSOLE=y @@ -527,6 +529,7 @@ CONFIG_NET_6LOWPAN=y # CONFIG_NETDEV_IOCTL=y CONFIG_NETDEV_PHY_IOCTL=y +# CONFIG_NETDEV_WIRELESS_IOCTL is not set # # Internet Protocol Selection @@ -687,6 +690,15 @@ CONFIG_MM_REGIONS=1 # CONFIG_ARCH_HAVE_HEAP2 is not set # CONFIG_GRAN is not set +# +# Common I/O Buffer Support +# +CONFIG_MM_IOB=y +CONFIG_IOB_NBUFFERS=36 +CONFIG_IOB_BUFSIZE=196 +CONFIG_IOB_NCHAINS=8 +CONFIG_IOB_THROTTLE=8 + # # Audio Support # @@ -697,6 +709,13 @@ CONFIG_MM_REGIONS=1 # CONFIG_WIRELESS=y CONFIG_WIRELESS_IEEE802154=y +CONFIG_IEEE802154_DEFAULT_EADDR=0x00fade00deadbeef +# CONFIG_IEEE802154_MAC_DEV is not set +CONFIG_MAC802154_HPWORK=y +CONFIG_IEEE802154_NTXDESC=3 +CONFIG_IEEE802154_IND_PREALLOC=20 +CONFIG_IEEE802154_IND_IRQRESERVE=10 +# CONFIG_IEEE802154_NETDEV is not set CONFIG_IEEE802154_LOOPBACK=y CONFIG_IEEE802154_LOOPBACK_HPWORK=y @@ -897,6 +916,7 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_5=0x0000 CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_6=0x00ff CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_7=0xfe00 CONFIG_EXAMPLES_NETTEST_CLIENTIPv6ADDR_8=0x1034 +# CONFIG_EXAMPLES_NRF24L01TERM is not set CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set @@ -1117,6 +1137,7 @@ CONFIG_NSH_ARCHINIT=y # Networking Configuration # CONFIG_NSH_NETINIT=y +# CONFIG_NSH_NETLOCAL is not set # CONFIG_NSH_NETINIT_THREAD is not set # @@ -1195,6 +1216,7 @@ CONFIG_I2CTOOL_DEFFREQ=400000 # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_MDIO is not set # CONFIG_SYSTEM_NETDB is not set +# CONFIG_SYSTEM_NTPC is not set # CONFIG_SYSTEM_RAMTEST is not set CONFIG_READLINE_HAVE_EXTMATCH=y CONFIG_SYSTEM_READLINE=y @@ -1211,3 +1233,12 @@ CONFIG_READLINE_ECHO=y # # Wireless Libraries and NSH Add-Ons # + +# +# IEEE 802.15.4 applications +# +CONFIG_IEEE802154_LIBMAC=y +# CONFIG_IEEE802154_LIBUTILS is not set +# CONFIG_IEEE802154_I8SAK is not set +# CONFIG_WIRELESS_IWPAN is not set +# CONFIG_WIRELESS_WAPI is not set diff --git a/include/nuttx/wireless/ieee802154/ieee802154_ioctl.h b/include/nuttx/wireless/ieee802154/ieee802154_ioctl.h index 318289b4db..f14ce00559 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_ioctl.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_ioctl.h @@ -56,12 +56,8 @@ * Pre-processor Definitions ************************************************************************************/ -/* IEEE 802.15.4 Radio Character Driver IOCTL commands ******************************/ -/* None defined */ - /* IEEE 802.15.4 MAC Character Driver IOCTL commands ********************************/ - #define MAC802154IOC_NOTIFY_REGISTER _WLCIOC(IEEE802154_FIRST) #define MAC802154IOC_GET_EVENT _WLCIOC(IEEE802154_FIRST+1) #define MAC802154IOC_ENABLE_EVENTS _WLCIOC(IEEE802154_FIRST+2) From a728fc0444695f164a014c0f820ec582a41a5e83 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 17 Jun 2017 08:54:50 -0600 Subject: [PATCH 52/55] ieee802.15.4 loopback: Better simulation addressing: sort, extended, panid, and IP address conversion --- wireless/ieee802154/mac802154_loopback.c | 130 ++++++++++++++++++++++- 1 file changed, 127 insertions(+), 3 deletions(-) diff --git a/wireless/ieee802154/mac802154_loopback.c b/wireless/ieee802154/mac802154_loopback.c index 47940329c7..2954019ceb 100644 --- a/wireless/ieee802154/mac802154_loopback.c +++ b/wireless/ieee802154/mac802154_loopback.c @@ -116,10 +116,22 @@ struct lo_driver_s static struct lo_driver_s g_loopback; static uint8_t g_iobuffer[CONFIG_NET_6LOWPAN_MTU + CONFIG_NET_GUARDSIZE]; +static uint8_t g_eaddr[8] = +{ + 0x00, 0xfa, 0xde, 0x00, 0xde, 0xad, 0xbe, 0xef +}; + +static uint16_t g_saddr = 0xabcd; +static uint16_t g_panid = 0xcafe; + /**************************************************************************** * Private Function Prototypes ****************************************************************************/ +/* IP address conversion */ + +static void lo_addr2ip(FAR struct net_driver_s *dev); + /* Polling logic */ static int lo_loopback(FAR struct net_driver_s *dev); @@ -153,6 +165,48 @@ static int lo_req_data(FAR struct ieee802154_driver_s *netdev, * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: lo_addr2ip + * + * Description: + * Create a MAC-based IP address from the IEEE 802.15.14 short or extended + * address of the MAC. + * + * 128 112 96 80 64 48 32 16 + * ---- ---- ---- ---- ---- ---- ---- ---- + * fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte short address IEEE 48-bit MAC + * fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64 + * + ****************************************************************************/ + +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR +static void lo_addr2ip(FAR struct net_driver_s *dev) +{ + dev->d_ipv6addr[0] = HTONS(0xfe80); + dev->d_ipv6addr[1] = 0; + dev->d_ipv6addr[2] = 0; + dev->d_ipv6addr[3] = 0; + dev->d_ipv6addr[4] = (uint16_t)g_eaddr[0] << 8 | (uint16_t)g_eaddr[1]; + dev->d_ipv6addr[5] = (uint16_t)g_eaddr[2] << 8 | (uint16_t)g_eaddr[3]; + dev->d_ipv6addr[6] = (uint16_t)g_eaddr[4] << 8 | (uint16_t)g_eaddr[5]; + dev->d_ipv6addr[6] = (uint16_t)g_eaddr[6] << 8 | (uint16_t)g_eaddr[6]; + dev->d_ipv6addr[6] ^= 0x200; +} +#else +static void lo_addr2ip(FAR struct net_driver_s *dev) +{ + dev->d_ipv6addr[0] = HTONS(0xfe80); + dev->d_ipv6addr[1] = 0; + dev->d_ipv6addr[2] = 0; + dev->d_ipv6addr[3] = 0; + dev->d_ipv6addr[4] = 0; + dev->d_ipv6addr[5] = HTONS(0x00ff); + dev->d_ipv6addr[0] = HTONS(0xfe00); + dev->d_ipv6addr[0] = htons(g_saddr) ^ 0x0200; + dev->d_ipv6addr[6] ^= 0x200; +} +#endif + /**************************************************************************** * Name: lo_loopback * @@ -580,8 +634,12 @@ static int lo_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac) static int lo_ioctl(FAR struct net_driver_s *dev, int cmd, unsigned long arg) { -#if 0 - FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)dev->d_private; + FAR struct lo_driver_s *priv; + + DEBUGASSERT(dev != NULL && dev->d_private != NULL); + priv = (FAR struct lo_driver_s *)dev->d_private; + + UNUSED(priv); /* Check for IOCTLs aimed at the IEEE802.15.4 MAC layer */ @@ -589,9 +647,71 @@ static int lo_ioctl(FAR struct net_driver_s *dev, int cmd, { FAR struct ieee802154_netmac_s *netmac = (FAR struct ieee802154_netmac_s *)arg; + + DEBUGASSERT(netmac != NULL); + + if (cmd == MAC802154IOC_MLME_SET_REQUEST) + { + FAR struct ieee802154_set_req_s *setreq = &netmac->u.setreq; + + switch (setreq->attr) + { + case IEEE802154_ATTR_MAC_PANID: + g_panid = setreq->attrval.mac.panid; + break; + + case IEEE802154_ATTR_MAC_EXTENDED_ADDR: + memcpy(setreq->attrval.mac.eaddr, g_eaddr, 8); +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR + lo_addr2ip(dev); +#endif + break; + + case IEEE802154_ATTR_MAC_SHORT_ADDRESS: + g_saddr = setreq->attrval.mac.saddr; +#ifndef CONFIG_NET_6LOWPAN_EXTENDEDADDR + lo_addr2ip(dev); +#endif + break; + + default: + return -ENOTTY; + } + + return OK; + } + else if (cmd == MAC802154IOC_MLME_GET_REQUEST) + { + FAR struct ieee802154_get_req_s *getreq = &netmac->u.getreq; + + switch (getreq->attr) + { + case IEEE802154_ATTR_MAC_PANID: + getreq->attrval.mac.panid = g_panid; + break; + + case IEEE802154_ATTR_MAC_EXTENDED_ADDR: + memcpy(g_eaddr, getreq->attrval.mac.eaddr, 8); + break; + + case IEEE802154_ATTR_MAC_SHORT_ADDRESS: + getreq->attrval.mac.saddr = g_saddr; + break; + + default: + return -ENOTTY; + } + + return OK; + } + else + { + /* Not a supported IEEE 802.15.4 MAC IOCTL command */ + + return -ENOTTY; + } } else -#endif { /* Not a valid IEEE 802.15.4 MAC IOCTL command */ @@ -741,6 +861,10 @@ int ieee8021514_loopback(void) dev->d_buf = g_iobuffer; /* Attach the IO buffer */ dev->d_private = (FAR void *)priv; /* Used to recover private state from dev */ + /* Advertise our MAC-based IP address */ + + lo_addr2ip(dev); + /* Initialize the Network frame-related callbacks */ ieee->i_get_mhrlen = lo_get_mhrlen; /* Get MAC header length */ From 19b0aa3145e0d10e90ed60c3e5af91b2eacd7c13 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 17 Jun 2017 09:04:09 -0600 Subject: [PATCH 53/55] ieee802154 MAC: Fix a warning when compiled for a target with 64-bit addressing --- wireless/ieee802154/mac802154.c | 7 ++++--- wireless/ieee802154/mac802154_loopback.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index 755cdc035e..127fe6bfd3 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -95,7 +95,7 @@ static void mac802154_purge_worker(FAR void *arg); /* Watchdog Timeout Functions */ -static void mac802154_timeout_expiry(int argc, uint32_t arg, ...); +static void mac802154_timeout_expiry(int argc, wdparm_t arg, ...); static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv, uint32_t symbols); @@ -1271,7 +1271,8 @@ int mac802154_timerstart(FAR struct ieee802154_privmac_s *priv, /* Start the watchdog */ - wd_start(priv->timeout, (int32_t)ticks, mac802154_timeout_expiry, 1, (uint32_t)priv); + wd_start(priv->timeout, (int32_t)ticks, mac802154_timeout_expiry, + 1, (wdparm_t)priv); return OK; } @@ -1294,7 +1295,7 @@ int mac802154_timerstart(FAR struct ieee802154_privmac_s *priv, * ****************************************************************************/ -static void mac802154_timeout_expiry(int argc, uint32_t arg, ...) +static void mac802154_timeout_expiry(int argc, wdparm_t arg, ...) { FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)arg; diff --git a/wireless/ieee802154/mac802154_loopback.c b/wireless/ieee802154/mac802154_loopback.c index 2954019ceb..33bbb3f614 100644 --- a/wireless/ieee802154/mac802154_loopback.c +++ b/wireless/ieee802154/mac802154_loopback.c @@ -683,7 +683,7 @@ static int lo_ioctl(FAR struct net_driver_s *dev, int cmd, else if (cmd == MAC802154IOC_MLME_GET_REQUEST) { FAR struct ieee802154_get_req_s *getreq = &netmac->u.getreq; - + switch (getreq->attr) { case IEEE802154_ATTR_MAC_PANID: From 8d4439e683c44fabc298af82bfd2fda489899ad6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 17 Jun 2017 11:29:25 -0600 Subject: [PATCH 54/55] Update some 6loWPAN configurations based on changes to NSH Kconfig --- .../clicker2-stm32/mrf24j40-6lowpan/defconfig | 43 +------------------ configs/sim/sixlowpan/defconfig | 43 +------------------ 2 files changed, 2 insertions(+), 84 deletions(-) diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig index 4619b2291a..b202b30aa8 100644 --- a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig @@ -1509,50 +1509,9 @@ CONFIG_NSH_ARCHINIT=y # CONFIG_NSH_NETINIT=y CONFIG_NSH_NETLOCAL=y - -# -# IP Address Configuration -# - -# -# Target IPv6 address -# -CONFIG_NSH_IPv6ADDR_1=0xfc00 -CONFIG_NSH_IPv6ADDR_2=0x0000 -CONFIG_NSH_IPv6ADDR_3=0x0000 -CONFIG_NSH_IPv6ADDR_4=0x0000 -CONFIG_NSH_IPv6ADDR_5=0x0000 -CONFIG_NSH_IPv6ADDR_6=0x00ff -CONFIG_NSH_IPv6ADDR_7=0xfe00 -CONFIG_NSH_IPv6ADDR_8=0xa9cd - -# -# Router IPv6 address -# -CONFIG_NSH_DRIPv6ADDR_1=0xfc00 -CONFIG_NSH_DRIPv6ADDR_2=0x0000 -CONFIG_NSH_DRIPv6ADDR_3=0x0000 -CONFIG_NSH_DRIPv6ADDR_4=0x0000 -CONFIG_NSH_DRIPv6ADDR_5=0x0000 -CONFIG_NSH_DRIPv6ADDR_6=0x00ff -CONFIG_NSH_DRIPv6ADDR_7=0xfe00 -CONFIG_NSH_DRIPv6ADDR_8=0x1034 - -# -# IPv6 Network mask -# -CONFIG_NSH_IPv6NETMASK_1=0xffff -CONFIG_NSH_IPv6NETMASK_2=0xffff -CONFIG_NSH_IPv6NETMASK_3=0xffff -CONFIG_NSH_IPv6NETMASK_4=0xffff -CONFIG_NSH_IPv6NETMASK_5=0xffff -CONFIG_NSH_IPv6NETMASK_6=0xffff -CONFIG_NSH_IPv6NETMASK_7=0xffff -CONFIG_NSH_IPv6NETMASK_8=0x0000 CONFIG_NSH_NOMAC=y CONFIG_NSH_SWMAC=y -CONFIG_NSH_MACADDR=0xabcd -CONFIG_NSH_PANID=0xface +CONFIG_NSH_MACADDR=0x00fade00deadbeef CONFIG_NSH_MAX_ROUNDTRIP=20 # diff --git a/configs/sim/sixlowpan/defconfig b/configs/sim/sixlowpan/defconfig index 3046c8af7a..5613379e8e 100644 --- a/configs/sim/sixlowpan/defconfig +++ b/configs/sim/sixlowpan/defconfig @@ -1139,51 +1139,10 @@ CONFIG_NSH_ARCHINIT=y CONFIG_NSH_NETINIT=y # CONFIG_NSH_NETLOCAL is not set # CONFIG_NSH_NETINIT_THREAD is not set - -# -# IP Address Configuration -# - -# -# Target IPv6 address -# -CONFIG_NSH_IPv6ADDR_1=0xfe80 -CONFIG_NSH_IPv6ADDR_2=0x0000 -CONFIG_NSH_IPv6ADDR_3=0x0000 -CONFIG_NSH_IPv6ADDR_4=0x0000 -CONFIG_NSH_IPv6ADDR_5=0x0000 -CONFIG_NSH_IPv6ADDR_6=0x00ff -CONFIG_NSH_IPv6ADDR_7=0xfe00 -CONFIG_NSH_IPv6ADDR_8=0xa9cd - -# -# Router IPv6 address -# -CONFIG_NSH_DRIPv6ADDR_1=0xfe80 -CONFIG_NSH_DRIPv6ADDR_2=0x0000 -CONFIG_NSH_DRIPv6ADDR_3=0x0000 -CONFIG_NSH_DRIPv6ADDR_4=0x0000 -CONFIG_NSH_DRIPv6ADDR_5=0x0000 -CONFIG_NSH_DRIPv6ADDR_6=0x00ff -CONFIG_NSH_DRIPv6ADDR_7=0xfe00 -CONFIG_NSH_DRIPv6ADDR_8=0x1034 - -# -# IPv6 Network mask -# -CONFIG_NSH_IPv6NETMASK_1=0xffff -CONFIG_NSH_IPv6NETMASK_2=0xffff -CONFIG_NSH_IPv6NETMASK_3=0xffff -CONFIG_NSH_IPv6NETMASK_4=0xffff -CONFIG_NSH_IPv6NETMASK_5=0xffff -CONFIG_NSH_IPv6NETMASK_6=0xffff -CONFIG_NSH_IPv6NETMASK_7=0xffff -CONFIG_NSH_IPv6NETMASK_8=0x0000 # CONFIG_NSH_DNS is not set CONFIG_NSH_NOMAC=y CONFIG_NSH_SWMAC=y -CONFIG_NSH_MACADDR=0xabcd -CONFIG_NSH_PANID=0xface +CONFIG_NSH_MACADDR=0x00fade00deadbeef CONFIG_NSH_MAX_ROUNDTRIP=20 # CONFIG_NSH_LOGIN is not set # CONFIG_NSH_CONSOLE_LOGIN is not set From 9396317ac431674a2def21602bd3c2a3c9b7aea9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 17 Jun 2017 14:10:37 -0600 Subject: [PATCH 55/55] Update TODO list. Make sure that all Bitbucket issues are included in the TODO list. --- TODO | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 208 insertions(+), 30 deletions(-) diff --git a/TODO b/TODO index 46f6c597e4..6f1e540fe6 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated June 14, 2017) +NuttX TODO List (Last updated June 17, 2017) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -9,22 +9,22 @@ issues related to each board port. nuttx/: - (11) Task/Scheduler (sched/) + (12) Task/Scheduler (sched/) (1) SMP (1) Memory Management (mm/) (0) Power Management (drivers/pm) (3) Signals (sched/signal, arch/) - (3) pthreads (sched/pthread) + (4) pthreads (sched/pthread) (0) Message Queues (sched/mqueue) (8) Kernel/Protected Build (3) C++ Support (6) Binary loaders (binfmt/) - (14) Network (net/, drivers/net) + (16) Network (net/, drivers/net) (4) USB (drivers/usbdev, drivers/usbhost) (0) Other drivers (drivers/) - (12) Libraries (libc/, libm/) + (13) Libraries (libc/, libm/) (10) File system/Generic drivers (fs/, drivers/) - (9) Graphics Subsystem (graphics/) + (10) Graphics Subsystem (graphics/) (3) Build system / Toolchains (3) Linux/Cywgin simulation (arch/sim) (4) ARM (arch/arm/) @@ -34,6 +34,7 @@ apps/ and other Add-Ons: (2) Network Utilities (apps/netutils/) (1) NuttShell (NSH) (apps/nshlib) (1) System libraries apps/system (apps/system) + (1) Modbus (apps/modbus) (1) Pascal add-on (pcode/) (4) Other Applications & Tests (apps/examples/) @@ -234,32 +235,65 @@ o Task/Scheduler (sched/) could be improved and made a little more efficient with this change. - Title: INAPPROPRIATE USE OF sched_lock() BY pthreads - Description: In implementation of standard pthread functions, the non- - standard, NuttX function sched_lock() is used. This is very - strong sense it disables pre-emption for all threads in all - task groups. I believe it is only really necessary in most - cases to lock threads in the task group with a new non- - standard interface, say pthread_lock(). + Task: IDLE THREAD TCB SETUP + Description: There are issues with setting IDLE thread stacks: - This is because the OS resources used by a thread such as - mutexes, condition variable, barriers, etc. are only - meaningful from within the task group. So, in order to - performance exclusive operations on these resources, it is - only necessary to block other threads executing within the - task group. + 1. One problem is stack-related data in the IDLE threads TCB. + A solution might be to standardize the use of g_idle_topstack. + That you could add initialization like this in os_start: - This is an easy change: pthread_lock() and pthread_unlock() - would simply operate on a semaphore retained in the task - group structure. I am, however, hesitant to make this change: - I the flat build model, there is nothing that prevents people - from accessing the inter-thread controls from threads in - differnt task groups. Making this change, while correct, - might introduce subtle bugs in code by people who are not - using NuttX correctly. - Status: Open - Priority: Low. This change would improve real-time performance of the - OS but is not otherwise required. + @@ -344,6 +347,11 @@ void os_start(void) + g_idleargv[1] = NULL; + g_idletcb.argv = g_idleargv; + + + /* Set the IDLE task stack size */ + + + + g_idletcb.cmn.adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE; + + g_idletcb.cmn.stack_alloc_ptr = (void *)(g_idle_topstack - CONFIG_IDLETHREAD_STACKSIZE); + + + /* Then add the idle task's TCB to the head of the ready to run list */ + + dq_addfirst((FAR dq_entry_t *)&g_idletcb, (FAR dq_queue_t *)&g_readytorun); + + The g_idle_topstack variable is available for almost all architectures: + + $ find . -name *.h | xargs grep g_idle_top + ./arm/src/common/up_internal.h:EXTERN const uint32_t g_idle_topstack; + ./avr/src/avr/avr.h:extern uint16_t g_idle_topstack; + ./avr/src/avr32/avr32.h:extern uint32_t g_idle_topstack; + ./hc/src/common/up_internal.h:extern uint16_t g_idle_topstack; + ./mips/src/common/up_internal.h:extern uint32_t g_idle_topstack; + ./misoc/src/lm32/lm32.h:extern uint32_t g_idle_topstack; + ./renesas/src/common/up_internal.h:extern uint32_t g_idle_topstack; + ./renesas/src/m16c/chip.h:extern uint32_t g_idle_topstack; /* Start of the heap */ + ./risc-v/src/common/up_internal.h:EXTERN uint32_t g_idle_topstack; + ./x86/src/common/up_internal.h:extern uint32_t g_idle_topstack; + + That omits there architectures: sh1, sim, xtensa, z16, z80, + ez80, and z8. All would have to support this common + globlal variable. + + Also, the stack itself may be 8-, 16-, or 32-bits wide, + depending upon the architecture. + + 2. Another problem is colorizing that stack to use with + stack usage monitoring logic. There is logic in some + start functions to do this in a function called go_os_start. + It is available in these architectures: + + ./arm/src/efm32/efm32_start.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/kinetis/kinetis_start.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/sam34/sam_start.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/samv7/sam_start.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/stm32/stm32_start.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/stm32f7/stm32_start.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/stm32l4/stm32l4_start.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/tms570/tms570_boot.c:static void go_os_start(void *pv, unsigned int nbytes) + ./arm/src/xmc4/xmc4_start.c:static void go_os_start(void *pv, unsigned int nbytes) + + But no others. + Status: Open + Priority: Low, only needed for more complete debug. o SMP ^^^ @@ -534,6 +568,33 @@ o pthreads (sched/pthreads) Priority: Medium-low. Priority may be higher if system call overheade becomes an issue. + Title: INAPPROPRIATE USE OF sched_lock() BY pthreads + Description: In implementation of standard pthread functions, the non- + standard, NuttX function sched_lock() is used. This is very + strong sense it disables pre-emption for all threads in all + task groups. I believe it is only really necessary in most + cases to lock threads in the task group with a new non- + standard interface, say pthread_lock(). + + This is because the OS resources used by a thread such as + mutexes, condition variable, barriers, etc. are only + meaningful from within the task group. So, in order to + performance exclusive operations on these resources, it is + only necessary to block other threads executing within the + task group. + + This is an easy change: pthread_lock() and pthread_unlock() + would simply operate on a semaphore retained in the task + group structure. I am, however, hesitant to make this change: + I the flat build model, there is nothing that prevents people + from accessing the inter-thread controls from threads in + differnt task groups. Making this change, while correct, + might introduce subtle bugs in code by people who are not + using NuttX correctly. + Status: Open + Priority: Low. This change would improve real-time performance of the + OS but is not otherwise required. + o Message Queues (sched/mqueue) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1171,6 +1232,30 @@ o Network (net/, drivers/net) deal with a list of devices. That would be a huge effect and certainly doesn't dount as a "simple solution". + Title: ICMPv6 FOR 6loWPAN + Description: The current ICMPv6 and neighbor-related logic only works with + Ethernet MAC. For 6loWPAN, a new more conservative ICMPv6 + definitions is provided by RFC 6775. This RFC needs to be + supported in order to support ping6 on a 6loWPAN network. + Status: Open + Priority: Low for now. + + Title: ETHERNET LOCAL BROADCAST DOES NOT WORK + + Description: In case of "local broadcast" the system still send ARP + request to the destination, but it shouldn't, it should + broadcast. For Example, the system has network with IP + 10.0.0.88, netmask of 255.255.255.0, it should send + messages for 10.0.0.255 as broadcast, and not send ARP + for 10.0.0.255 + + For more easier networking, the next line should have give + me the broadcast address of the network, but it doesn't: + + ioctl(_socket_fd, SIOCGIFBRDADDR, &bc_addr); + Status: Open + Priority: Medium + o USB (drivers/usbdev, drivers/usbhost) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1532,6 +1617,64 @@ o Libraries (libc/, libm/) Status: Open Priority: Low + Title: FORMATTING FIXED WIDTH INTEGERS + Description: Formats like this: lib_vsprintf(_, "%6.6u", 0) do not work. + There is no support for the precision/width option with + integer types. The format is simply is ignored and so can + even cause crashes. + + For example: + + int hello_main(int argc, char *argv[]) + { + printf("Hello, World!!\n"); + printf("%3.3u %3.3u %3.3u %3.3u %3.3u\n", 9, 99, 999, 9999, 99999); + return 0; + } + + Generates this incorrect output: + + + NuttShell (NSH) NuttX-7.20 + nsh> hello + Hello, World!! + 9 99 999 9999 99999 + nsh> + + That output, of course, should have been: + + 9 99 999 999 999 + + The period and the precision value were being ignored (if + floating point was disabled). In that case, parsing of the + variable arguments could get out of sync. But a side + effect of the referenced change is that precision value is + now always parsed (but still incorrectly ignored for the + case of integer formats). + + The fix would not be too difficult but would involve change + several functions. It would involve clipping the size of the + number string. For example: + + /* Get the width of the output */ + + uwidth = getusize(FMT_CHAR, flags, n); + if (trunc > 0 && uwidth > trunc) + { + uwidth = trunc; + } + + Then limiting the length of the output string to uwidth. + This would probably mean passing an additional parameter to + the many *toascii() functions like: + + /* Output the number */ + + utoascii(obj, FMT_CHAR, flags, (unsigned int)n, uwidth); + + Status: Open + Priority: Low + o File system / Generic drivers (fs/, drivers/) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1830,6 +1973,16 @@ o Graphics Subsystem (graphics/) the single user mode, it will be yanked out from under your feet in the not-so-distant future. + Title: WIDE-FOUNT SUPPORT + Description: Wide fonts are not currently supported by the NuttX graphics sub- + system. There is some discussion here: + + https://groups.yahoo.com/neo/groups/nuttx/conversations/topics/3507 + http://www.nuttx.org/doku.php?id=wiki:graphics:wide-fonts + + Status: Open + Priority: Low for many, but I imagine higher in countries that use wide fonts + o Build system ^^^^^^^^^^^^ @@ -1926,6 +2079,7 @@ o Build system The .archive file would have to be removed on 'make clean' and would also need to appear in .gitignore files. + o Other drivers (drivers/) ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2151,6 +2305,30 @@ o System libraries apps/system (apps/system) Priority: Low (unless you are using mixed C-buffered I/O with readline and fgetc, for example). +o Modbus (apps/modbus) + ^^^^^^^^^^^^^^^^^^^^ + + Title: MODBUS NOT USABLE WITH USB SERIAL + Description: Modbus can be used with USB serial, however, if the USB + serial connectiont is lost, Modbus will hang in an infinite + loop. + + This is a problem in the handling of select() and read() + and could probabaly resolved by studying the Modbus error + handling. + + A more USB-friendly solution would be to: (1) Re-connect and + (2) re-open the serial drviers. That is what is done is NSH. + When the serial USB device is removed, this terminates the + session and NSH will then try to re-open the USB device. See + the function nsh_waitusbready() in the file + apps/nshlib/nsh_usbconsole.c. When the USB serial is + reconnected the open() in the function will succeed and a new + session will be started. + Status: Open + Priority: Low. This is really an enhancement request: Modbus was never + designed to work with removable serial devices. + o Pascal Add-On (pcode/) ^^^^^^^^^^^^^^^^^^^^^^