diff --git a/arch/arm/include/stm32/chip.h b/arch/arm/include/stm32/chip.h index a9eca2813fb..bf3a742af6e 100644 --- a/arch/arm/include/stm32/chip.h +++ b/arch/arm/include/stm32/chip.h @@ -92,7 +92,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -133,7 +133,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -174,7 +174,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -215,7 +215,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -256,7 +256,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -297,7 +297,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -337,7 +337,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -377,7 +377,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -417,7 +417,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */ @@ -457,7 +457,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-4 with DMA @@ -498,7 +498,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* No advanced timers */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-4 with DMA @@ -543,7 +543,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* 16-bit general timers TIM2-4 with DMA */ @@ -582,7 +582,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* 16-bit general timers TIM2-4 with DMA */ @@ -624,7 +624,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -664,7 +664,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -703,7 +703,7 @@ # undef CONFIG_STM32_CONNECTIVITYLINE /* STM32F105x and STM32F107x */ # undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 0 /* No advanced timer TIM1 */ # define STM32_NGTIM 3 /* 16-bit general timers TIM2-4 */ @@ -743,7 +743,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 2 /* General timers TIM2,3 */ @@ -782,7 +782,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* General timers TIM2-4 */ @@ -821,7 +821,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* General timers TIM2-4 */ @@ -860,7 +860,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 3 /* General timers TIM2-4 */ @@ -904,7 +904,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and TIM8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -946,7 +946,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and TIM8 */ # define STM32_NGTIM 4 /* General timers TIM2-5 */ @@ -988,7 +988,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timer TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1028,7 +1028,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1066,7 +1066,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1104,7 +1104,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */ @@ -1144,7 +1144,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1183,7 +1183,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1222,7 +1222,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1269,7 +1269,7 @@ # undef CONFIG_STM32_CONNECTIVITYLINE /* STM32F105x and STM32F107x */ # undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1310,7 +1310,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1351,7 +1351,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1392,7 +1392,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 (no TIM8) */ # define STM32_NGTIM 6 /* (2) 16-bit general timers with DMA: TIM3 and TIM4 @@ -1433,7 +1433,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 */ @@ -1474,7 +1474,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* (1) Advanced 16-bit timers with DMA: TIM1 */ @@ -1515,7 +1515,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1556,7 +1556,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1597,7 +1597,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1638,7 +1638,7 @@ # define CONFIG_STM32_STM32F30XX 1 /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* (2) Advanced 16-bit timers with DMA: TIM1 and TIM8 */ @@ -1679,7 +1679,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # define CONFIG_STM32_STM32F33XX 1 /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_HRTIM 1 /* (1) High-resolution timer 16-bit, 10 channels: HRTIM1 */ @@ -1723,7 +1723,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # define CONFIG_STM32_STM32F33XX 1 /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_HRTIM 1 /* (1) High-resolution timer 16-bit, 10 channels: HRTIM1 */ @@ -1767,7 +1767,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # define CONFIG_STM32_STM32F33XX 1 /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_HRTIM 1 /* (1) High-resolution timer 16-bit, 10 channels: HRTIM1 */ @@ -1810,7 +1810,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # define CONFIG_STM32_STM32F37XX 1 /* STM32F37xxx family */ -# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */ +# undef CONFIG_STM32_STM32F4XXX /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 0 /* (0) Advanced 16-bit timers with DMA: */ @@ -1856,7 +1856,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1894,7 +1894,7 @@ # undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1933,7 +1933,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -1972,7 +1972,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 1 /* One advanced timers TIM1 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2011,7 +2011,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* No FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2050,7 +2050,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2089,7 +2089,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2128,7 +2128,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2167,7 +2167,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2206,7 +2206,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2245,7 +2245,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2284,7 +2284,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2323,7 +2323,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx and STM32407xx */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2362,7 +2362,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2401,7 +2401,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2440,7 +2440,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2479,7 +2479,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2518,7 +2518,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437/429/439 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2557,7 +2557,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2596,7 +2596,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2635,7 +2635,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 0 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2674,7 +2674,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2713,7 +2713,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 STM32F466 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2752,7 +2752,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA @@ -2794,7 +2794,7 @@ # undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ # undef CONFIG_STM32_STM32F33XX /* STM32F33xxx family */ # undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */ -# define CONFIG_STM32_STM32F40XX 1 /* STM32F405xx, STM32407xx and STM32F427/437 */ +# define CONFIG_STM32_STM32F4XXX 1 /* STM32F4xxxx family */ # define STM32_NFSMC 1 /* FSMC */ # define STM32_NATIM 2 /* Two advanced timers TIM1 and 8 */ # define STM32_NGTIM 4 /* 16-bit general timers TIM3 and 4 with DMA diff --git a/arch/arm/include/stm32/irq.h b/arch/arm/include/stm32/irq.h index ed369355a14..54e2d0f2950 100644 --- a/arch/arm/include/stm32/irq.h +++ b/arch/arm/include/stm32/irq.h @@ -89,7 +89,7 @@ # include #elif defined(CONFIG_STM32_STM32F37XX) # include -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include #else # error "Unsupported STM32 chip" diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index ba6bdb4b790..910922000bf 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -968,189 +968,189 @@ config ARCH_CHIP_STM32F373VC config ARCH_CHIP_STM32F401RE bool "STM32F401RE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F401 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F410RB bool "STM32F410RB" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F410 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F411RE bool "STM32F411RE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F411 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F411VE bool "STM32F411VE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F411 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F405RG bool "STM32F405RG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F405 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F405VG bool "STM32F405VG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F405 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F405ZG bool "STM32F405ZG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F405 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407VE bool "STM32F407VE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407VG bool "STM32F407VG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407ZE bool "STM32F407ZE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407ZG bool "STM32F407ZG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407IE bool "STM32F407IE" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F407IG bool "STM32F407IG" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F407 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F427V bool "STM32F427V" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F427 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F427Z bool "STM32F427Z" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F427 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F427I bool "STM32F427I" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F427 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429V bool "STM32F429V" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429Z bool "STM32F429Z" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429I bool "STM32F429I" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429B bool "STM32F429B" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F429N bool "STM32F429N" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F429 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446M bool "STM32F446M" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446R bool "STM32F446R" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446V bool "STM32F446V" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F446Z bool "STM32F446Z" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F446 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F469A bool "STM32F469A" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU config ARCH_CHIP_STM32F469I bool "STM32F469I" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU select STM32_HAVE_ETHMAC @@ -1158,7 +1158,7 @@ config ARCH_CHIP_STM32F469I config ARCH_CHIP_STM32F469B bool "STM32F469B" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU select STM32_HAVE_ETHMAC @@ -1166,7 +1166,7 @@ config ARCH_CHIP_STM32F469B config ARCH_CHIP_STM32F469N bool "STM32F469N" select ARCH_CORTEXM4 - select STM32_STM32F40XX + select STM32_STM32F4XXX select STM32_STM32F469 select ARCH_HAVE_FPU select STM32_HAVE_ETHMAC @@ -1522,23 +1522,19 @@ config STM32_STM32F37XX select STM32_HAVE_SPI3 select STM32_HAVE_USART3 -config STM32_STM32F40XX +config STM32_STM32F4XXX bool default n - select STM32_HAVE_OTGFS - select STM32_HAVE_TIM3 - select STM32_HAVE_TIM4 select STM32_HAVE_SPI2 - select STM32_HAVE_SPI3 - select STM32_HAVE_I2S3 select STM32_HAVE_I2C2 - select STM32_HAVE_I2C3 config STM32_STM32F401 bool default n select STM32_HAVE_USART6 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM9 select STM32_HAVE_TIM10 @@ -1546,6 +1542,8 @@ config STM32_STM32F401 select STM32_HAVE_SPI2 select STM32_HAVE_SPI3 select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS config STM32_STM32F410 bool @@ -1557,21 +1555,26 @@ config STM32_STM32F410 select STM32_HAVE_TIM9 select STM32_HAVE_TIM11 select STM32_HAVE_SPI5 + select STM32_HAVE_DAC1 config STM32_STM32F411 bool default n select STM32_HAVE_USART6 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM9 select STM32_HAVE_TIM10 select STM32_HAVE_TIM11 select STM32_HAVE_SPI2 select STM32_HAVE_SPI3 - select STM32_HAVE_I2S3 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS config STM32_STM32F405 bool @@ -1583,6 +1586,8 @@ config STM32_STM32F405 select STM32_HAVE_UART5 select STM32_HAVE_USART6 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1599,7 +1604,11 @@ config STM32_STM32F405 select STM32_HAVE_CAN2 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 + select STM32_HAVE_SPI3 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 select STM32_HAVE_RNG + select STM32_HAVE_OTGFS config STM32_STM32F407 bool @@ -1612,6 +1621,8 @@ config STM32_STM32F407 select STM32_HAVE_USART6 select STM32_HAVE_TIM1 select STM32_HAVE_TIM2 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1628,10 +1639,15 @@ config STM32_STM32F407 select STM32_HAVE_CAN2 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 + select STM32_HAVE_SPI3 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 select STM32_HAVE_RNG select STM32_HAVE_ETHMAC + select STM32_HAVE_OTGFS # This is really 427/437, but we treat the two the same. + config STM32_STM32F427 bool default n @@ -1644,6 +1660,8 @@ config STM32_STM32F427 select STM32_HAVE_UART7 select STM32_HAVE_UART8 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1664,12 +1682,15 @@ config STM32_STM32F427 select STM32_HAVE_ETHMAC select STM32_HAVE_SPI2 select STM32_HAVE_SPI3 - select STM32_HAVE_I2S3 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS select STM32_HAVE_SPI6 # This is really 429/439, but we treat the two the same. + config STM32_STM32F429 bool default n @@ -1683,6 +1704,8 @@ config STM32_STM32F429 select STM32_HAVE_UART7 select STM32_HAVE_UART8 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 @@ -1707,6 +1730,9 @@ config STM32_STM32F429 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 select STM32_HAVE_SPI6 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS config STM32_STM32F446 bool @@ -1735,11 +1761,16 @@ config STM32_STM32F446 select STM32_HAVE_CAN2 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 + select STM32_HAVE_SPI3 select STM32_HAVE_SPI4 + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 + select STM32_HAVE_OTGFS select STM32_HAVE_SAIPLL select STM32_HAVE_I2SPLL # This is really 469/479, but we treat the two the same. + config STM32_STM32F469 bool default n @@ -1773,12 +1804,15 @@ config STM32_STM32F469 select STM32_HAVE_DAC1 select STM32_HAVE_DAC2 select STM32_HAVE_RNG + select STM32_HAVE_SPI3 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 select STM32_HAVE_SPI6 + select STM32_HAVE_OTGFS select STM32_HAVE_SAIPLL select STM32_HAVE_I2SPLL - + select STM32_HAVE_I2S3 + select STM32_HAVE_I2C3 config STM32_DFU bool "DFU bootloader" @@ -2169,7 +2203,7 @@ config STM32_BKP config STM32_BKPSRAM bool "Enable BKP RAM Domain" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_CAN1 bool "CAN1" @@ -2188,7 +2222,7 @@ config STM32_CAN2 config STM32_CCMDATARAM bool "CMD/DATA RAM" default n - depends on STM32_STM32F40XX + depends on STM32_STM32F4XXX config STM32_AES bool "128-bit AES" @@ -2209,7 +2243,7 @@ config STM32_CRC config STM32_CRYP bool "CRYP" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_DMA1 bool "DMA1" @@ -2237,7 +2271,7 @@ config STM32_DAC2 config STM32_DCMI bool "DCMI" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_ETHMAC bool "Ethernet MAC" @@ -2254,7 +2288,7 @@ config STM32_FSMC config STM32_HASH bool "HASH" default n - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX config STM32_HRTIM1 bool "HRTIM1" @@ -2329,7 +2363,7 @@ config STM32_OTGFS config STM32_OTGHS bool "OTG HS" default n - depends on STM32_STM32F205 || STM32_STM32F207 || STM32_STM32F40XX || STM32_STM32F429 + depends on STM32_STM32F205 || STM32_STM32F207 || STM32_STM32F4XXX || STM32_STM32F429 select USBHOST_HAVE_ASYNCH if USBHOST config STM32_PWR @@ -2401,7 +2435,7 @@ config STM32_SPI6 config STM32_SYSCFG bool "SYSCFG" default y - depends on STM32_STM32L15XX || STM32_STM32F30XX || STM32_STM32F37XX || STM32_STM32F207 || STM32_STM32F40XX || STM32_CONNECTIVITYLINE + depends on STM32_STM32L15XX || STM32_STM32F30XX || STM32_STM32F37XX || STM32_STM32F207 || STM32_STM32F4XXX || STM32_CONNECTIVITYLINE config STM32_TIM1 bool "TIM1" @@ -2770,7 +2804,7 @@ endmenu config STM32_FLASH_PREFETCH bool "Enable FLASH Pre-fetch" - depends on STM32_STM32F207 || STM32_STM32F40XX + depends on STM32_STM32F207 || STM32_STM32F4XXX default y if STM32_STM32F427 || STM32_STM32F429 || STM32_STM32F446 default n ---help--- @@ -2868,8 +2902,8 @@ config STM32_CCM_PROCFS config STM32_DMACAPABLE bool "Workaround non-DMA capable memory" depends on ARCH_DMA - default y if STM32_STM32F40XX && !STM32_CCMEXCLUDE - default n if !STM32_STM32F40XX || STM32_CCMEXCLUDE + default y if STM32_STM32F4XXX && !STM32_CCMEXCLUDE + default n if !STM32_STM32F4XXX || STM32_CCMEXCLUDE ---help--- This option enables the DMA interface stm32_dmacapable that can be used to check if it is possible to do DMA from the selected address. @@ -6412,7 +6446,7 @@ config STM32_I2C_DUTY16_9 config STM32_I2C_DMA bool "I2C DMA Support" default n - depends on STM32_I2C && STM32_STM32F40XX && STM32_DMA1 && !I2C_POLLED + depends on STM32_I2C && STM32_STM32F4XXX && STM32_DMA1 && !I2C_POLLED ---help--- This option enables the DMA for I2C transfers. Note: The user can define CONFIG_I2C_DMAPRIO: a custom priority value for the @@ -6551,7 +6585,7 @@ config STM32_MII choice prompt "MII clock configuration" default STM32_MII_MCO if STM32_STM32F10XX - default STM32_MII_MCO1 if STM32_STM32F207 || STM32_STM32F40XX + default STM32_MII_MCO1 if STM32_STM32F207 || STM32_STM32F4XXX depends on STM32_MII config STM32_MII_MCO @@ -6562,13 +6596,13 @@ config STM32_MII_MCO config STM32_MII_MCO1 bool "Use MC01 as MII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO1 to clock the MII interface. Default: Use MC01 config STM32_MII_MCO2 bool "Use MC02 as MII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO2 to clock the MII interface. Default: Use MC01 @@ -6699,7 +6733,7 @@ config STM32_RMII choice prompt "RMII clock configuration" default STM32_RMII_MCO if STM32_STM32F10XX - default STM32_RMII_MCO1 if STM32_STM32F207 || STM32_STM32F40XX + default STM32_RMII_MCO1 if STM32_STM32F207 || STM32_STM32F4XXX depends on STM32_RMII config STM32_RMII_MCO @@ -6710,13 +6744,13 @@ config STM32_RMII_MCO config STM32_RMII_MCO1 bool "Use MC01 as RMII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO1 to clock the RMII interface. Default: Use MC01 config STM32_RMII_MCO2 bool "Use MC02 as RMII clock" - depends on (STM32_STM32F207 || STM32_STM32F40XX) + depends on (STM32_STM32F207 || STM32_STM32F4XXX) ---help--- Use MCO2 to clock the RMII interface. Default: Use MC01 diff --git a/arch/arm/src/stm32/Make.defs b/arch/arm/src/stm32/Make.defs index 11f5c3dc1d9..e7817c8c532 100644 --- a/arch/arm/src/stm32/Make.defs +++ b/arch/arm/src/stm32/Make.defs @@ -140,7 +140,7 @@ else ifeq ($(CONFIG_STM32_STM32F30XX),y) CHIP_CSRCS += stm32f30xxx_i2c.c else ifeq ($(CONFIG_STM32_STM32F37XX),y) CHIP_CSRCS += stm32f30xxx_i2c.c -else ifeq ($(CONFIG_STM32_STM32F40XX),y) +else ifeq ($(CONFIG_STM32_STM32F4XXX),y) CHIP_CSRCS += stm32f40xxx_i2c.c else CHIP_CSRCS += stm32_i2c.c diff --git a/arch/arm/src/stm32/chip.h b/arch/arm/src/stm32/chip.h index 64ec1db6049..58ede7d4be0 100644 --- a/arch/arm/src/stm32/chip.h +++ b/arch/arm/src/stm32/chip.h @@ -134,7 +134,7 @@ /* STM32 F4 Family ******************************************************************/ -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_pinmap.h" #else # error "No pinmap file for this STM32 chip" @@ -157,7 +157,7 @@ # include "chip/stm32f33xxx_vectors.h" # elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_vectors.h" -# elif defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" # else # error "No vector file for this STM32 family" diff --git a/arch/arm/src/stm32/chip/stm32_adc.h b/arch/arm/src/stm32/chip/stm32_adc.h index 8a9eb956b67..6c84c513be2 100644 --- a/arch/arm/src/stm32/chip/stm32_adc.h +++ b/arch/arm/src/stm32/chip/stm32_adc.h @@ -93,7 +93,7 @@ # define STM32_ADC_SMPR0_OFFSET 0X005c /* ADC sample time register 3 (32-bit) */ #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define STM32_ADC_CSR_OFFSET 0x0000 /* Common status register */ # define STM32_ADC_CCR_OFFSET 0x0004 /* Common control register */ # ifndef CONFIG_STM32_STM32L15XX @@ -186,7 +186,7 @@ # define STM32_ADC3_DR (STM32_ADC3_BASE+STM32_ADC_DR_OFFSET) #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define STM32_ADC_CSR (STM32_ADCCMN_BASE+STM32_ADC_CSR_OFFSET) # define STM32_ADC_CCR (STM32_ADCCMN_BASE+STM32_ADC_CCR_OFFSET) # ifndef CONFIG_STM32_STM32L15XX @@ -203,7 +203,7 @@ #define ADC_SR_JEOC (1 << 2) /* Bit 2 : Injected channel end of conversion */ #define ADC_SR_JSTRT (1 << 3) /* Bit 3 : Injected channel Start flag */ #define ADC_SR_STRT (1 << 4) /* Bit 4 : Regular channel Start flag */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define ADC_SR_OVR (1 << 5) /* Bit 5 : Overrun */ #endif #if defined(CONFIG_STM32_STM32L15XX) @@ -253,7 +253,7 @@ #define ADC_CR1_JAWDEN (1 << 22) /* Bit 22: Analog watchdog enable on injected channels */ #define ADC_CR1_AWDEN (1 << 23) /* Bit 23: Analog watchdog enable on regular channels */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define ADC_CR1_RES_SHIFT (24) /* Bits 24-25: Resolution */ # define ADC_CR1_RES_MASK (3 << ADC_CR1_RES_SHIFT) # define ADC_CR1_RES_12BIT (0 << ADC_CR1_RES_SHIFT) /* 15 ADCCLK cycles. For STM32L15XX: 12 ADCCLK cycles */ @@ -298,14 +298,14 @@ #define ADC_CR2_DMA (1 << 8) /* Bit 8: Direct Memory access mode */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # define ADC_CR2_DDS (1 << 9) /* Bit 9: DMA disable selection (for single ADC mode) */ # define ADC_CR2_EOCS (1 << 10) /* Bit 10: End of conversion selection */ #endif #define ADC_CR2_ALIGN (1 << 11) /* Bit 11: Data Alignment */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) /* Bits 12-15: Reserved */ # define ADC_CR2_JEXTSEL_SHIFT (16) /* Bits 16-19: External event select for injected group */ # define ADC_CR2_JEXTSEL_MASK (0x0F << ADC_CR2_JEXTSEL_SHIFT) @@ -425,7 +425,7 @@ /* ADC sample time register 1 */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_SMPR_3 0 /* 000: 3 cycles */ # define ADC_SMPR_15 1 /* 001: 15 cycles */ @@ -436,7 +436,7 @@ # define ADC_SMPR_144 6 /* 110: 144 cycles */ # define ADC_SMPR_480 7 /* 111: 480 cycles */ -#elif !defined(CONFIG_STM32_STM32L15XX) && !defined(CONFIG_STM32_STM32F20XX) && !defined(CONFIG_STM32_STM32F40XX) +#elif !defined(CONFIG_STM32_STM32L15XX) && !defined(CONFIG_STM32_STM32F20XX) && !defined(CONFIG_STM32_STM32F4XXX) # define ADC_SMPR_1p5 0 /* 000: 1.5 cycles */ # define ADC_SMPR_7p5 1 /* 001: 7.5 cycles */ @@ -477,7 +477,7 @@ # define ADC_SMPR1_SMP16_MASK (7 << ADC_SMPR1_SMP16_SHIFT) # define ADC_SMPR1_SMP17_SHIFT (21) /* Bits 21-23: Channel 17 Sample time selection */ # define ADC_SMPR1_SMP17_MASK (7 << ADC_SMPR1_SMP17_SHIFT) -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_SMPR1_SMP18_SHIFT (24) /* Bits 24-26: Channel 18 Sample time selection */ # define ADC_SMPR1_SMP18_MASK (7 << ADC_SMPR1_SMP17_SHIFT) # endif @@ -784,7 +784,7 @@ /* Common status register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) # # define ADC_CSR_AWD1 (1 << 0) /* Bit 0: Analog watchdog flag of ADC1 (copy of AWD in ADC1_SR) */ # define ADC_CSR_EOC1 (1 << 1) /* Bit 1: End of conversion of ADC1 (copy of EOC in ADC1_SR) */ @@ -818,7 +818,7 @@ /* Common control register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_CCR_MULTI_SHIFT (0) /* Bits 0-4: Multi ADC mode selection */ # define ADC_CCR_MULTI_MASK (31 << ADC_CCR_MULTI_SHIFT) # define ADC_CCR_MULTI_NONE (0 << ADC_CCR_MULTI_SHIFT) /* 00000: Independent mode */ diff --git a/arch/arm/src/stm32/chip/stm32_can.h b/arch/arm/src/stm32/chip/stm32_can.h index c1e3500d5e6..2f45b8152bf 100644 --- a/arch/arm/src/stm32/chip/stm32_can.h +++ b/arch/arm/src/stm32/chip/stm32_can.h @@ -62,7 +62,7 @@ /* Number of filters depends on silicon */ #if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_NFILTERS 28 #else # define CAN_NFILTERS 14 @@ -449,14 +449,14 @@ /* CAN filter master register */ #define CAN_FMR_FINIT (1 << 0) /* Bit 0: Filter Init Mode */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FMR_CAN2SB_SHIFT (8) /* Bits 13-8: CAN2 start bank */ # define CAN_FMR_CAN2SB_MASK (0x3f << CAN_FMR_CAN2SB_SHIFT) #endif /* CAN filter mode register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FM1R_FBM_SHIFT (0) /* Bits 13:0: Filter Mode */ # define CAN_FM1R_FBM_MASK (0x3fff << CAN_FM1R_FBM_SHIFT) #else @@ -466,7 +466,7 @@ /* CAN filter scale register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FS1R_FSC_SHIFT (0) /* Bits 13:0: Filter Scale Configuration */ # define CAN_FS1R_FSC_MASK (0x3fff << CAN_FS1R_FSC_SHIFT) #else @@ -476,7 +476,7 @@ /* CAN filter FIFO assignment register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FFA1R_FFA_SHIFT (0) /* Bits 13:0: Filter FIFO Assignment */ # define CAN_FFA1R_FFA_MASK (0x3fff << CAN_FFA1R_FFA_SHIFT) #else @@ -486,7 +486,7 @@ /* CAN filter activation register */ -#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_CONNECTIVITYLINE) || defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CAN_FA1R_FACT_SHIFT (0) /* Bits 13:0: Filter Active */ # define CAN_FA1R_FACT_MASK (0x3fff << CAN_FA1R_FACT_SHIFT) #else diff --git a/arch/arm/src/stm32/chip/stm32_dbgmcu.h b/arch/arm/src/stm32/chip/stm32_dbgmcu.h index af80113a737..30e9d459602 100644 --- a/arch/arm/src/stm32/chip/stm32_dbgmcu.h +++ b/arch/arm/src/stm32/chip/stm32_dbgmcu.h @@ -53,7 +53,7 @@ #define STM32_DBGMCU_IDCODE 0xe0042000 /* MCU identifier */ #define STM32_DBGMCU_CR 0xe0042004 /* MCU debug */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) # define STM32_DBGMCU_APB1_FZ 0xe0042008 /* Debug MCU APB1 freeze register */ # define STM32_DBGMCU_APB2_FZ 0xe004200c /* Debug MCU APB2 freeze register */ @@ -101,7 +101,7 @@ /* Debug MCU APB1 freeze register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DBGMCU_APB1_TIM2STOP (1 << 0) /* Bit 0: TIM2 stopped when core is halted */ # define DBGMCU_APB1_TIM3STOP (1 << 1) /* Bit 1: TIM3 stopped when core is halted */ # define DBGMCU_APB1_TIM4STOP (1 << 2) /* Bit 2: TIM4 stopped when core is halted */ @@ -138,7 +138,7 @@ /* Debug MCU APB2 freeze register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DBGMCU_APB2_TIM1STOP (1 << 0) /* Bit 0: TIM1 stopped when core is halted */ # define DBGMCU_APB2_TIM8STOP (1 << 1) /* Bit 1: TIM8 stopped when core is halted */ # define DBGMCU_APB2_TIM9STOP (1 << 16) /* Bit 16: TIM9 stopped when core is halted */ diff --git a/arch/arm/src/stm32/chip/stm32_eth.h b/arch/arm/src/stm32/chip/stm32_eth.h index ac078aacbee..5ac1f752d00 100644 --- a/arch/arm/src/stm32/chip/stm32_eth.h +++ b/arch/arm/src/stm32/chip/stm32_eth.h @@ -62,7 +62,7 @@ #define STM32_ETH_MACVLANTR_OFFSET 0x001c /* Ethernet MAC VLAN tag register */ #define STM32_ETH_MACRWUFFR_OFFSET 0x0028 /* Ethernet MAC remote wakeup frame filter reg */ #define STM32_ETH_MACPMTCSR_OFFSET 0x002c /* Ethernet MAC PMT control and status register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_ETH_MACDBGR_OFFSET 0x0034 /* Ethernet MAC debug register */ #endif #define STM32_ETH_MACSR_OFFSET 0x0038 /* Ethernet MAC interrupt status register */ @@ -134,7 +134,7 @@ #define STM32_ETH_MACVLANTR (STM32_ETHERNET_BASE+STM32_ETH_MACVLANTR_OFFSET) #define STM32_ETH_MACRWUFFR (STM32_ETHERNET_BASE+STM32_ETH_MACRWUFFR_OFFSET) #define STM32_ETH_MACPMTCSR (STM32_ETHERNET_BASE+STM32_ETH_MACPMTCSR_OFFSET) -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_ETH_MACDBGR (STM32_ETHERNET_BASE+STM32_ETH_MACDBGR_OFFSET) #endif #define STM32_ETH_MACSR (STM32_ETHERNET_BASE+STM32_ETH_MACSR_OFFSET) @@ -220,7 +220,7 @@ # define ETH_MACCR_IFG(n) ((12-((n) >> 3)) << ETH_MACCR_IFG_SHIFT) /* n bit times, n=40,48,..96 */ #define ETH_MACCR_JD (1 << 22) /* Bit 22: Jabber disable */ #define ETH_MACCR_WD (1 << 23) /* Bit 23: Watchdog disable */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_MACCR_CSTF (1 << 25) /* Bits 25: CRC stripping for Type frames */ #endif @@ -309,7 +309,7 @@ /* Ethernet MAC debug register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define ETH_MACDBGR_MMRPEA (1 << 0) /* Bit 0: MAC MII receive protocol engine active */ #define ETH_MACDBGR_MSFRWCS_SHIFT (1) /* Bits 1-2: MAC small FIFO read / write controllers status */ @@ -429,7 +429,7 @@ #define ETH_MMCCR_ROR (1 << 2) /* Bit 2: Reset on read */ #define ETH_MMCCR_MCF (1 << 3) /* Bit 3: MMC counter freeze */ #define ETH_MMCCR_MCP (1 << 4) /* Bit 4: MMC counter preset */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_MMCCR_MCFHP (1 << 5) /* Bit 5: MMC counter Full-Half preset */ #endif @@ -466,7 +466,7 @@ #define ETH_PTPTSCR_TSITE (1 << 4) /* Bit 4: Time stamp interrupt trigger enable */ #define ETH_PTPTSCR_TSARU (1 << 5) /* Bit 5: Time stamp addend register update */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define ETH_PTPTSCR_TSSARFE (1 << 8) /* Bit 8: Time stamp snapshot for all received frames enable */ #define ETH_PTPTSCR_TSSSR (1 << 9) /* Bit 9: Time stamp subsecond rollover: digital or binary rollover control */ #define ETH_PTPTSCR_TSPTPPSV2E (1 << 10) /* Bit 10: Time stamp PTP packet snooping for version2 format enable */ @@ -558,7 +558,7 @@ #define ETH_DMABMR_USP (1 << 23) /* Bit 23: Use separate PBL */ #define ETH_DMABMR_FPM (1 << 24) /* Bit 24: 4xPBL mode */ #define ETH_DMABMR_AAB (1 << 25) /* Bit 25: Address-aligned beats */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_DMABMR_MB (1 << 26) /* Bit 26: Mixed burst */ #endif @@ -711,7 +711,7 @@ /* RDES0: Receive descriptor Word0 */ #define ETH_RDES0_PCE (1 << 0) /* Bit 0: Payload checksum error */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ETH_RDES0_ESA (1 << 0) /* Bit 0: Extended status available */ #endif #define ETH_RDES0_CE (1 << 1) /* Bit 1: CRC error */ diff --git a/arch/arm/src/stm32/chip/stm32_exti.h b/arch/arm/src/stm32/chip/stm32_exti.h index e18b60cf71b..44750101070 100644 --- a/arch/arm/src/stm32/chip/stm32_exti.h +++ b/arch/arm/src/stm32/chip/stm32_exti.h @@ -60,7 +60,7 @@ # define STM32_EXTI1_MASK 0xffffffff # define STM32_NEXTI2 4 # define STM32_EXTI2_MASK 0x0000000f -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_NEXTI 23 # define STM32_EXTI_MASK 0x007fffff #endif @@ -137,7 +137,7 @@ # define EXTI_RTC_CMP1 (1 << 21) /* EXTI line 21 is connected to the Comparator 1 wakeup event */ # define EXTI_RTC_CMP2 (1 << 22) /* EXTI line 22 is connected to the Comparator 2 wakeup event */ # define EXTI_RTC_ACQUIRE (1 << 23) /* EXTI line 23 is connected to the channel acquisition interrupt */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define EXTI_PVD_LINE (1 << 16) /* EXTI line 16 is connected to the PVD output */ # define EXTI_RTC_ALARM (1 << 17) /* EXTI line 17 is connected to the RTC Alarm event */ # define EXTI_OTGFS_WAKEUP (1 << 18) /* EXTI line 18 is connected to the USB OTG FS Wakeup event */ diff --git a/arch/arm/src/stm32/chip/stm32_flash.h b/arch/arm/src/stm32/chip/stm32_flash.h index 89e60e39a5e..6608ab99b31 100644 --- a/arch/arm/src/stm32/chip/stm32_flash.h +++ b/arch/arm/src/stm32/chip/stm32_flash.h @@ -115,7 +115,7 @@ # define STM32_FLASH_NPAGES 128 # define STM32_FLASH_PAGESIZE 2048 -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_NPAGES 8 # define STM32_FLASH_SIZE _K((4 * 16) + (1 * 64) + (3 * 128)) # define STM32_FLASH_SIZES {_K(16), _K(16), _K(16), _K(16), \ @@ -133,7 +133,7 @@ /* Define the Valid Configuration the F2 and F4 */ -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if defined(CONFIG_STM32_FLASH_CONFIG_B) # define STM32_FLASH_NPAGES 5 @@ -147,7 +147,7 @@ # define STM32_FLASH_SIZES {_K(16), _K(16), _K(16), _K(16), \ _K(64), _K(128)} -# elif defined(CONFIG_STM32_FLASH_CONFIG_D) && defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_FLASH_CONFIG_D) && defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_NPAGES 7 # define STM32_FLASH_SIZE _K((4 * 16) + (1 * 64) + (2 * 128)) # define STM32_FLASH_SIZES {_K(16), _K(16), _K(16), _K(16), \ @@ -173,7 +173,7 @@ _K(64), _K(128), _K(128), _K(128), \ _K(128), _K(128), _K(128), _K(128)} -# elif defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_NPAGES 24 # define STM32_FLASH_SIZE _K((4 * 16) + (1 * 64) + (7 * 128)) + \ _K((4 * 16) + (1 * 64) + (7 * 128)) @@ -249,7 +249,7 @@ # define STM32_FLASH_AR_OFFSET 0x0014 # define STM32_FLASH_OBR_OFFSET 0x001c # define STM32_FLASH_WRPR_OFFSET 0x0020 -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_OPTCR_OFFSET 0x0014 # endif #endif @@ -285,7 +285,7 @@ # define STM32_FLASH_AR (STM32_FLASHIF_BASE+STM32_FLASH_AR_OFFSET) # define STM32_FLASH_OBR (STM32_FLASHIF_BASE+STM32_FLASH_OBR_OFFSET) # define STM32_FLASH_WRPR (STM32_FLASHIF_BASE+STM32_FLASH_WRPR_OFFSET) -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_FLASH_OPTCR (STM32_FLASHIF_BASE+STM32_FLASH_OPTCR_OFFSET) # endif # if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) || \ @@ -324,7 +324,7 @@ defined(CONFIG_STM32_STM32F37XX) # define FLASH_ACR_PRFTBS (1 << 5) /* Bit 5: FLASH prefetch buffer status */ # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_ACR_PRFTEN (1 << 8) /* FLASH prefetch enable */ # define FLASH_ACR_ICEN (1 << 9) /* Bit 9: Instruction cache enable */ # define FLASH_ACR_DCEN (1 << 10) /* Bit 10: Data cache enable */ @@ -341,7 +341,7 @@ # define FLASH_SR_PGERR (1 << 2) /* Programming Error */ # define FLASH_SR_WRPRT_ERR (1 << 4) /* Write Protection Error */ # define FLASH_SR_EOP (1 << 5) /* End of Operation */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_SR_EOP (1 << 0) /* Bit 0: End of operation */ # define FLASH_SR_OPERR (1 << 1) /* Bit 1: Operation error */ # define FLASH_SR_WRPERR (1 << 4) /* Bit 4: Write protection error */ @@ -397,7 +397,7 @@ defined(CONFIG_STM32_STM32F37XX) # define FLASH_CR_OBL_LAUNCH (1 << 13) /* Bit 13: Force option byte loading */ # endif -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_CR_PG (1 << 0) /* Bit 0: Programming */ # define FLASH_CR_SER (1 << 1) /* Bit 1: Sector Erase */ # define FLASH_CR_MER (1 << 2) /* Bit 2: Mass Erase sectors 0..11 */ @@ -426,7 +426,7 @@ /* Flash Option Control Register (OPTCR) */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FLASH_OPTCR_OPTLOCK (1 << 0) /* Bit 0: Option lock */ # define FLASH_OPTCR_OPTSTRT (1 << 1) /* Bit 1: Option start */ # define FLASH_OPTCR_BORLEV_SHIFT (2) /* Bits 2-3: BOR reset Level */ @@ -468,7 +468,7 @@ void stm32_flash_lock(void); void stm32_flash_unlock(void); -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX int stm32_flash_writeprotect(size_t page, bool enabled); #endif diff --git a/arch/arm/src/stm32/chip/stm32_memorymap.h b/arch/arm/src/stm32/chip/stm32_memorymap.h index 3e88405ca75..e32d5a647aa 100644 --- a/arch/arm/src/stm32/chip/stm32_memorymap.h +++ b/arch/arm/src/stm32/chip/stm32_memorymap.h @@ -55,7 +55,7 @@ # include "chip/stm32f33xxx_memorymap.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_memorymap.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_memorymap.h" #else # error "Unsupported STM32 memory map" diff --git a/arch/arm/src/stm32/chip/stm32_pwr.h b/arch/arm/src/stm32/chip/stm32_pwr.h index 20209ee12c5..3cbf8524640 100644 --- a/arch/arm/src/stm32/chip/stm32_pwr.h +++ b/arch/arm/src/stm32/chip/stm32_pwr.h @@ -90,7 +90,7 @@ # endif #define PWR_CR_DBP (1 << 8) /* Bit 8: Disable Backup Domain write protection */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define PWR_CR_FPDS (1 << 9) /* Bit 9: Flash power down in Stop mode */ # if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) || \ defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469) @@ -139,7 +139,7 @@ #define PWR_CSR_PVDO (1 << 2) /* Bit 2: PVD Output */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # define PWR_CSR_BRR (1 << 3) /* Bit 3: Backup regulator ready */ #elif defined(CONFIG_STM32_STM32L15XX) # define PWR_CSR_VREFINTRDYF (1 << 3) /* Bit 3: Internal voltage reference (VREFINT) ready flag */ @@ -159,7 +159,7 @@ # define PWR_CSR_EWUP (1 << 8) /* Bit 8: Enable WKUP pin */ #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define PWR_CSR_BRE (1 << 9) /* Bit 9: Backup regulator enable */ # define PWR_CSR_VOSRDY (1 << 14) /* Bit 14: Regulator voltage scaling output selection ready bite */ #endif diff --git a/arch/arm/src/stm32/chip/stm32_spi.h b/arch/arm/src/stm32/chip/stm32_spi.h index 3e0a086b63c..cf9a9e0118e 100644 --- a/arch/arm/src/stm32/chip/stm32_spi.h +++ b/arch/arm/src/stm32/chip/stm32_spi.h @@ -49,7 +49,7 @@ /* Maximum allowed speed as per specifications for all SPIs */ -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI_CLK_MAX 37500000UL #else # define STM32_SPI_CLK_MAX 18000000UL @@ -66,7 +66,7 @@ #define STM32_SPI_TXCRCR_OFFSET 0x0018 /* SPI Tx CRC register (16-bit) */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI_I2SCFGR_OFFSET 0x001c /* I2S configuration register */ # define STM32_SPI_I2SPR_OFFSET 0x0020 /* I2S prescaler register */ #endif @@ -92,7 +92,7 @@ # define STM32_SPI2_RXCRCR (STM32_SPI2_BASE+STM32_SPI_RXCRCR_OFFSET) # define STM32_SPI2_TXCRCR (STM32_SPI2_BASE+STM32_SPI_TXCRCR_OFFSET) #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI2_I2SCFGR (STM32_SPI2_BASE+STM32_SPI_I2SCFGR_OFFSET) # define STM32_SPI2_I2SPR (STM32_SPI2_BASE+STM32_SPI_I2SPR_OFFSET) # endif @@ -107,7 +107,7 @@ # define STM32_SPI3_RXCRCR (STM32_SPI3_BASE+STM32_SPI_RXCRCR_OFFSET) # define STM32_SPI3_TXCRCR (STM32_SPI3_BASE+STM32_SPI_TXCRCR_OFFSET) #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_SPI3_I2SCFGR (STM32_SPI3_BASE+STM32_SPI_I2SCFGR_OFFSET) # define STM32_SPI3_I2SPR (STM32_SPI3_BASE+STM32_SPI_I2SPR_OFFSET) # endif @@ -152,7 +152,7 @@ #define SPI_CR2_SSOE (1 << 2) /* Bit 2: SS Output Enable */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_CR2_FRF (1 << 4) /* Bit 4: Frame format */ #endif @@ -188,7 +188,7 @@ #define SPI_SR_TXE (1 << 1) /* Bit 1: Transmit buffer empty */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_SR_CHSIDE (1 << 2) /* Bit 2: Channel side */ # define SPI_SR_UDR (1 << 3) /* Bit 3: Underrun flag */ #endif @@ -199,7 +199,7 @@ #define SPI_SR_BSY (1 << 7) /* Bit 7: Busy flag */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_SR_FRE (1 << 8) /* Bit 8: TI frame format error */ #endif @@ -221,7 +221,7 @@ /* I2S configuration register */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_I2SCFGR_CHLEN (1 << 0) /* Bit 0: Channel length (number of bits per audio channel) */ # define SPI_I2SCFGR_DATLEN_SHIFT (1) /* Bit 1-2: Data length to be transferred */ # define SPI_I2SCFGR_DATLEN_MASK (3 << SPI_I2SCFGR_DATLEN_SHIFT) @@ -249,7 +249,7 @@ /* I2S prescaler register */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_I2SPR_I2SDIV_SHIFT (0) /* Bit 0-7: I2S Linear prescaler */ # define SPI_I2SPR_I2SDIV_MASK (0xff << SPI_I2SPR_I2SDIV_SHIFT) # define SPI_I2SPR_ODD (1 << 8) /* Bit 8: Odd factor for the prescaler */ diff --git a/arch/arm/src/stm32/chip/stm32_tim.h b/arch/arm/src/stm32/chip/stm32_tim.h index f4113cd6ddc..c115dbb43af 100644 --- a/arch/arm/src/stm32/chip/stm32_tim.h +++ b/arch/arm/src/stm32/chip/stm32_tim.h @@ -214,7 +214,7 @@ # define STM32_TIM2_CCR4 (STM32_TIM2_BASE+STM32_GTIM_CCR4_OFFSET) # define STM32_TIM2_DCR (STM32_TIM2_BASE+STM32_GTIM_DCR_OFFSET) # define STM32_TIM2_DMAR (STM32_TIM2_BASE+STM32_GTIM_DMAR_OFFSET) -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_TIM2_OR (STM32_TIM2_BASE+STM32_GTIM_OR_OFFSET) # endif #endif @@ -280,7 +280,7 @@ # define STM32_TIM5_CCR4 (STM32_TIM5_BASE+STM32_GTIM_CCR4_OFFSET) # define STM32_TIM5_DCR (STM32_TIM5_BASE+STM32_GTIM_DCR_OFFSET) # define STM32_TIM5_DMAR (STM32_TIM5_BASE+STM32_GTIM_DMAR_OFFSET) -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_TIM5_OR (STM32_TIM5_BASE+STM32_GTIM_OR_OFFSET) # endif #endif @@ -829,7 +829,7 @@ #define ATIM_CCER_CC4P (1 << 13) /* Bit 13: Capture/Compare 4 output Polarity */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) # define ATIM_CCER_CC4NP (1 << 15) /* Bit 15: Capture/Compare 4 Complementary output polarity */ #elif defined(CONFIG_STM32_STM32F30XX) @@ -1283,7 +1283,7 @@ /* Timer 2/5 option register */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define TIM2_OR_ITR1_RMP_SHIFT (10) /* Bits 10-11: Internal trigger 1 remap */ # define TIM2_OR_ITR1_RMP_MASK (3 << TIM2_OR_ITR1_RMP_SHIFT) # define TIM2_OR_ITR1_TIM8_TRGOUT (0 << TIM2_OR_ITR1_RMP_SHIFT) /* 00: TIM2_ITR1 input connected to TIM8_TRGOUT */ diff --git a/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h b/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h index 57068a2b8dd..98769f3dd44 100644 --- a/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h +++ b/arch/arm/src/stm32/chip/stm32f40xxx_syscfg.h @@ -46,7 +46,7 @@ #include #include "chip.h" -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX /**************************************************************************************************** * Pre-processor Definitions @@ -198,5 +198,5 @@ # define SYSCFG_CFGR_FMPI2C1_SDA (1 << 1) /* Bit 8: Forces FM+ drive capability on SDA */ #endif -#endif /* CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F4XXX */ #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32F40XXX_SYSCFG_H */ diff --git a/arch/arm/src/stm32/gnu/stm32_vectors.S b/arch/arm/src/stm32/gnu/stm32_vectors.S index 4943686dac4..b322d9e6cda 100644 --- a/arch/arm/src/stm32/gnu/stm32_vectors.S +++ b/arch/arm/src/stm32/gnu/stm32_vectors.S @@ -181,7 +181,7 @@ _vectors: # include "chip/stm32f33xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No vectors for STM32 chip" @@ -228,7 +228,7 @@ handlers: # include "chip/stm32f33xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No handlers for STM32 chip" diff --git a/arch/arm/src/stm32/iar/stm32_vectors.S b/arch/arm/src/stm32/iar/stm32_vectors.S index 52fdfb30568..eeaa2836b71 100644 --- a/arch/arm/src/stm32/iar/stm32_vectors.S +++ b/arch/arm/src/stm32/iar/stm32_vectors.S @@ -469,7 +469,7 @@ __vector_table: # include "chip/stm32f42xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F446) # include "chip/stm32f44xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No vectors for STM32 chip" @@ -788,7 +788,7 @@ handlers: # include "chip/stm32f42xxx_vectors.h" #elif defined(CONFIG_STM32_STM32F446) # include "chip/stm32f44xxx_vectors.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_vectors.h" #else # error "No handlers for STM32 chip" diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index 43e349eff0a..d3ec74fb3cf 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -82,7 +82,7 @@ #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) /* At the moment there is no proper implementation for timers external @@ -125,7 +125,7 @@ #elif defined(CONFIG_STM32_STM32F37XX) # define STM32_RCC_RSTR STM32_RCC_APB2RSTR # define RCC_RSTR_ADC1RST RCC_APB2RSTR_ADCRST -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_RCC_RSTR STM32_RCC_APB2RSTR # define RCC_RSTR_ADC1RST RCC_APB2RSTR_ADCRST # define RCC_RSTR_ADC2RST RCC_APB2RSTR_ADCRST @@ -205,7 +205,7 @@ # endif #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define ADC_DMA_CONTROL_WORD (DMA_SCR_MSIZE_16BITS | \ DMA_SCR_PSIZE_16BITS | \ DMA_SCR_MINC | \ @@ -266,7 +266,7 @@ (ADC_SMPR_DEFAULT << ADC_SMPR2_SMP17_SHIFT) | \ (ADC_SMPR_DEFAULT << ADC_SMPR2_SMP18_SHIFT)) #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # if defined(CONFIG_STM32_STM32F37XX) # define ADC_SMPR_DEFAULT ADC_SMPR_239p5 /* TODO choose 1p5? */ # else @@ -353,7 +353,7 @@ struct stm32_dev_s #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) static void stm32_modifyreg32(unsigned int addr, uint32_t clrbits, uint32_t setbits); #endif @@ -621,7 +621,7 @@ static struct adc_dev_s g_adcdev4 = #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ defined(CONFIG_STM32_STM32F33XX) || defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) static void stm32_modifyreg32(unsigned int addr, uint32_t clrbits, uint32_t setbits) { @@ -1154,7 +1154,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) # if defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) ccer &= ~(ATIM_CCER_CC1NE | ATIM_CCER_CC1NP | ATIM_CCER_CC2NE | ATIM_CCER_CC2NP | ATIM_CCER_CC3NE | ATIM_CCER_CC3NP | @@ -1174,7 +1174,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) } # if defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) else { ccer &= ~(GTIM_CCER_CC1NP | GTIM_CCER_CC2NP | GTIM_CCER_CC3NP); @@ -2000,12 +2000,12 @@ static void adc_reset(FAR struct adc_dev_s *dev) } #endif #elif defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) clrbits = ADC_CCR_ADCPRE_MASK | ADC_CCR_TSVREFE; setbits = ADC_CCR_ADCPRE_DIV2; -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) clrbits |= ADC_CCR_MULTI_MASK | ADC_CCR_DELAY_MASK | ADC_CCR_DDS | ADC_CCR_DMA_MASK | ADC_CCR_VBATE; setbits |= ADC_CCR_MULTI_NONE | ADC_CCR_DMA_DISABLED; @@ -2103,7 +2103,7 @@ static void adc_reset(FAR struct adc_dev_s *dev) } #endif #elif defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) ainfo("CCR: 0x%08x\n", getreg32(STM32_ADC_CCR)); #endif @@ -3104,7 +3104,7 @@ struct adc_dev_s *stm32_adcinitialize(int intf, FAR const uint8_t *chanlist, #endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || * CONFIG_STM32_STM32F30XX || CONFIG_STM32_STM32F33XX || - * CONFIG_STM32_STM32F47XX || CONFIG_STM32_STM32F40XX || + * CONFIG_STM32_STM32F47XX || CONFIG_STM32_STM32F4XXX || * CONFIG_STM32_STM32L15XX */ #endif /* CONFIG_STM32_ADC1 || CONFIG_STM32_ADC2 || diff --git a/arch/arm/src/stm32/stm32_adc.h b/arch/arm/src/stm32/stm32_adc.h index 03ffaecbc01..53571eb99e5 100644 --- a/arch/arm/src/stm32/stm32_adc.h +++ b/arch/arm/src/stm32/stm32_adc.h @@ -112,7 +112,7 @@ # undef CONFIG_STM32_TIM4_ADC4 #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # ifndef CONFIG_STM32_TIM5 # undef CONFIG_STM32_TIM5_ADC # undef CONFIG_STM32_TIM5_ADC1 @@ -129,7 +129,7 @@ #endif #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # ifndef CONFIG_STM32_TIM8 # undef CONFIG_STM32_TIM8_ADC # undef CONFIG_STM32_TIM8_ADC1 diff --git a/arch/arm/src/stm32/stm32_allocateheap.c b/arch/arm/src/stm32/stm32_allocateheap.c index a6a91612441..fcf53ea329a 100644 --- a/arch/arm/src/stm32/stm32_allocateheap.c +++ b/arch/arm/src/stm32/stm32_allocateheap.c @@ -348,7 +348,7 @@ * In addition, external FSMC SRAM may be available. */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /* The STM32 F2 and the STM32 F401/F411 have no CCM SRAM */ diff --git a/arch/arm/src/stm32/stm32_bbsram.h b/arch/arm/src/stm32/stm32_bbsram.h index bcb813d6fa1..8edc3c60b13 100644 --- a/arch/arm/src/stm32/stm32_bbsram.h +++ b/arch/arm/src/stm32/stm32_bbsram.h @@ -59,7 +59,7 @@ * Pre-processor Definitions ****************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_BBSRAM_SIZE 4096 #else # error No backup SRAM on this STM32 diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index 9e23a48f36a..1f9a06b600c 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -1952,7 +1952,7 @@ static int stm32can_filterinit(FAR struct stm32_can_s *priv) #if defined(CONFIG_STM32_CONNECTIVITYLINE) || \ defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) regval = stm32can_getfreg(priv, STM32_CAN_FMR_OFFSET); regval &= CAN_FMR_CAN2SB_MASK; regval |= (CAN_NFILTERS / 2) << CAN_FMR_CAN2SB_SHIFT; diff --git a/arch/arm/src/stm32/stm32_ccm.h b/arch/arm/src/stm32/stm32_ccm.h index 20cc650eee8..2f73021cd4c 100644 --- a/arch/arm/src/stm32/stm32_ccm.h +++ b/arch/arm/src/stm32/stm32_ccm.h @@ -58,7 +58,7 @@ #if defined(CONFIG_STM32_STM32F30XX) # define CCM_START 0x10000000 # define CCM_END 0x10002000 -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32F33XX) # define CCM_START 0x10000000 # define CCM_END 0x10010000 diff --git a/arch/arm/src/stm32/stm32_dac.c b/arch/arm/src/stm32/stm32_dac.c index e12c9f65c5f..bc997e48c37 100644 --- a/arch/arm/src/stm32/stm32_dac.c +++ b/arch/arm/src/stm32/stm32_dac.c @@ -100,7 +100,7 @@ # undef CONFIG_STM32_DAC1_DMA # undef CONFIG_STM32_DAC2_DMA # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # ifndef CONFIG_STM32_DMA1 # warning "STM32 F4 DAC DMA support requires CONFIG_STM32_DMA1" # undef CONFIG_STM32_DAC1_DMA @@ -153,7 +153,7 @@ # define DAC_DMA 2 # define DAC1_DMA_CHAN DMACHAN_DAC_CHAN1 # define DAC2_DMA_CHAN DMACHAN_DAC_CHAN2 -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32F33XX) # define HAVE_DMA 1 # define DAC_DMA 1 @@ -320,7 +320,7 @@ /* DMA stream/channel configuration */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DAC_DMA_CONTROL_WORD (DMA_SCR_MSIZE_16BITS | \ DMA_SCR_PSIZE_16BITS | \ DMA_SCR_MINC | \ @@ -381,7 +381,7 @@ static void tim_putreg(FAR struct stm32_chan_s *chan, int offset, /* Interrupt handler */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static int dac_interrupt(int irq, FAR void *context, FAR void *arg); #endif @@ -620,7 +620,7 @@ static void tim_modifyreg(FAR struct stm32_chan_s *chan, int offset, * ****************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static int dac_interrupt(int irq, FAR void *context, FAR void *arg) { #warning "Missing logic" diff --git a/arch/arm/src/stm32/stm32_dma.c b/arch/arm/src/stm32/stm32_dma.c index 9118c586d48..64553a7d5c2 100644 --- a/arch/arm/src/stm32/stm32_dma.c +++ b/arch/arm/src/stm32/stm32_dma.c @@ -62,6 +62,6 @@ # include "stm32f33xxx_dma.c" #elif defined(CONFIG_STM32_STM32F20XX) # include "stm32f20xxx_dma.c" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "stm32f40xxx_dma.c" #endif diff --git a/arch/arm/src/stm32/stm32_dma.h b/arch/arm/src/stm32/stm32_dma.h index ceee4e0867c..5a84034889b 100644 --- a/arch/arm/src/stm32/stm32_dma.h +++ b/arch/arm/src/stm32/stm32_dma.h @@ -54,7 +54,7 @@ # include "chip/stm32f33xxx_dma.h" #elif defined(CONFIG_STM32_STM32F20XX) # include "chip/stm32f20xxx_dma.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_dma.h" #else # error "Unknown STM32 DMA" @@ -72,7 +72,7 @@ # define DMA_STATUS_TEIF DMA_CHAN_TEIF_BIT /* Channel Transfer Error */ # define DMA_STATUS_HTIF DMA_CHAN_HTIF_BIT /* Channel Half Transfer */ # define DMA_STATUS_TCIF DMA_CHAN_TCIF_BIT /* Channel Transfer Complete */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define DMA_STATUS_FEIF 0 /* Stream FIFO error (ignored) */ # define DMA_STATUS_DMEIF DMA_STREAM_DMEIF_BIT /* Stream direct mode error */ # define DMA_STATUS_TEIF DMA_STREAM_TEIF_BIT /* Stream Transfer Error */ @@ -119,7 +119,7 @@ struct stm32_dmaregs_s uint32_t cpar; uint32_t cmar; }; -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) struct stm32_dmaregs_s { uint32_t lisr; diff --git a/arch/arm/src/stm32/stm32_dumpgpio.c b/arch/arm/src/stm32/stm32_dumpgpio.c index 2540ffdcbcc..da1fbd00278 100644 --- a/arch/arm/src/stm32/stm32_dumpgpio.c +++ b/arch/arm/src/stm32/stm32_dumpgpio.c @@ -196,7 +196,7 @@ int stm32_dumpgpio(uint32_t pinset, const char *msg) getreg32(base + STM32_GPIO_AFRL_OFFSET), getreg32(base + STM32_GPIO_BRR_OFFSET)); -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) DEBUGASSERT(port < STM32_NGPIO_PORTS); _info("GPIO%c pinset: %08x base: %08x -- %s\n", diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 77493cd880c..62e44a0ff23 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -125,7 +125,7 @@ #endif #ifdef CONFIG_STM32_MII -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if !defined(CONFIG_STM32_MII_MCO1) && !defined(CONFIG_STM32_MII_MCO2) && !defined(CONFIG_STM32_MII_EXTCLK) # warning "Neither CONFIG_STM32_MII_MCO1, CONFIG_STM32_MII_MCO2, nor CONFIG_STM32_MII_EXTCLK defined" # endif @@ -140,7 +140,7 @@ #endif #ifdef CONFIG_STM32_RMII -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if !defined(CONFIG_STM32_RMII_MCO1) && !defined(CONFIG_STM32_RMII_MCO2) && !defined(CONFIG_STM32_RMII_EXTCLK) # warning "Neither CONFIG_STM32_RMII_MCO1, CONFIG_STM32_RMII_MCO2, nor CONFIG_STM32_RMII_EXTCLK defined" # endif @@ -344,7 +344,7 @@ * ETH_MACCR_CSTF Bits 25: CRC stripping for Type frames (F2/F4 only) */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define MACCR_CLEAR_BITS \ (ETH_MACCR_RE | ETH_MACCR_TE | ETH_MACCR_DC | ETH_MACCR_BL_MASK | \ ETH_MACCR_APCS | ETH_MACCR_RD | ETH_MACCR_IPCO | ETH_MACCR_DM | \ @@ -531,7 +531,7 @@ * ETH_DMABMR_MB Bit 26: Mixed burst (F2/F4 only) */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) #define DMABMR_CLEAR_MASK \ (ETH_DMABMR_SR | ETH_DMABMR_DA | ETH_DMABMR_DSL_MASK | ETH_DMABMR_EDFE | \ ETH_DMABMR_PBL_MASK | ETH_DMABMR_RTPR_MASK | ETH_DMABMR_FB | ETH_DMABMR_RDP_MASK | \ diff --git a/arch/arm/src/stm32/stm32_flash.c b/arch/arm/src/stm32/stm32_flash.c index 6291154cc07..e43d4a5185f 100644 --- a/arch/arm/src/stm32/stm32_flash.c +++ b/arch/arm/src/stm32/stm32_flash.c @@ -62,10 +62,10 @@ /* Only for the STM32F[1|3|4]0xx family and STM32L15xx (EEPROM only) for now */ #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined (CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined (CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) #if defined(CONFIG_STM32_FLASH_CONFIG_DEFAULT) && \ - (defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX)) + (defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX)) # warning "Default Flash Configuration Used - See Override Flash Size Designator" #endif @@ -86,7 +86,7 @@ #if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) # define FLASH_CR_PAGE_ERASE FLASH_CR_PER # define FLASH_SR_WRITE_PROTECTION_ERROR FLASH_SR_WRPRT_ERR -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # define FLASH_CR_PAGE_ERASE FLASH_CR_SER # define FLASH_SR_WRITE_PROTECTION_ERROR FLASH_SR_WRPERR #endif @@ -394,13 +394,13 @@ ssize_t stm32_eeprom_erase(size_t addr, size_t eraselen) * ************************************************************************************/ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX int stm32_flash_writeprotect(size_t page, bool enabled) { uint32_t reg; uint32_t val; -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX if (page >= STM32_FLASH_NPAGES) { return -EFAULT; @@ -415,7 +415,7 @@ int stm32_flash_writeprotect(size_t page, bool enabled) { reg = STM32_FLASH_OPTCR; } -#if defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_FLASH_CONFIG_I) && defined(CONFIG_STM32_STM32F4XXX) else { reg = STM32_FLASH_OPTCR1; @@ -500,7 +500,7 @@ size_t up_progmem_getaddress(size_t page) #endif /* defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) */ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX size_t up_progmem_pagesize(size_t page) { @@ -561,7 +561,7 @@ size_t up_progmem_getaddress(size_t page) return base_address; } -#endif /* def CONFIG_STM32_STM32F40XX */ +#endif /* def CONFIG_STM32_STM32F4XXX */ #if !defined(CONFIG_STM32_STM32L15XX) @@ -592,7 +592,7 @@ ssize_t up_progmem_erasepage(size_t page) sem_lock(); -#if !defined(CONFIG_STM32_STM32F40XX) +#if !defined(CONFIG_STM32_STM32F4XXX) if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION)) { sem_unlock(); @@ -612,7 +612,7 @@ ssize_t up_progmem_erasepage(size_t page) page_address = up_progmem_getaddress(page); putreg32(page_address, STM32_FLASH_AR); -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) modifyreg32(STM32_FLASH_CR, FLASH_CR_SNB_MASK, FLASH_CR_SNB(page)); #endif @@ -685,7 +685,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) sem_lock(); -#if !defined(CONFIG_STM32_STM32F40XX) +#if !defined(CONFIG_STM32_STM32F4XXX) if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION)) { sem_unlock(); @@ -703,7 +703,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) modifyreg32(STM32_FLASH_CR, 0, FLASH_CR_PG); -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) /* TODO: implement up_progmem_write() to support other sizes than 16-bits */ modifyreg32(STM32_FLASH_CR, FLASH_CR_PSIZE_MASK, FLASH_CR_PSIZE_X16); #endif @@ -746,4 +746,4 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) #endif /* !defined(CONFIG_STM32_STM32L15XX) */ #endif /* defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) */ + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) */ diff --git a/arch/arm/src/stm32/stm32_fsmc.h b/arch/arm/src/stm32/stm32_fsmc.h index f865c00b5a7..330f47d062e 100644 --- a/arch/arm/src/stm32/stm32_fsmc.h +++ b/arch/arm/src/stm32/stm32_fsmc.h @@ -187,7 +187,7 @@ #define FSMC_BCR_WREN (1 << 12) /* Write enable bit */ #define FSMC_BCR_WAITEN (1 << 13) /* Wait enable bit */ #define FSMC_BCR_EXTMOD (1 << 14) /* Extended mode enable */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define FSMC_BCR_ASYNCWAIT (1 << 15) /* Wait signal during asynchronous transfers */ #endif #define FSMC_BCR_CBURSTRW (1 << 19) /* Write burst enable */ diff --git a/arch/arm/src/stm32/stm32_gpio.c b/arch/arm/src/stm32/stm32_gpio.c index 9eb5fb9597b..727f0c943a5 100644 --- a/arch/arm/src/stm32/stm32_gpio.c +++ b/arch/arm/src/stm32/stm32_gpio.c @@ -56,7 +56,7 @@ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32_syscfg.h" #endif @@ -428,7 +428,7 @@ int stm32_configgpio(uint32_t cfgset) #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) int stm32_configgpio(uint32_t cfgset) { uintptr_t base; @@ -683,7 +683,7 @@ int stm32_unconfiggpio(uint32_t cfgset) cfgset |= GPIO_INPUT | GPIO_CNF_INFLOAT | GPIO_MODE_INPUT; #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) cfgset |= GPIO_INPUT | GPIO_FLOAT; #else # error "Unsupported STM32 chip" @@ -709,7 +709,7 @@ void stm32_gpiowrite(uint32_t pinset, bool value) uint32_t offset; #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) uint32_t bit; #endif unsigned int port; @@ -743,7 +743,7 @@ void stm32_gpiowrite(uint32_t pinset, bool value) #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) if (value) { diff --git a/arch/arm/src/stm32/stm32_gpio.h b/arch/arm/src/stm32/stm32_gpio.h index 0385d1e9519..c08b9a92987 100644 --- a/arch/arm/src/stm32/stm32_gpio.h +++ b/arch/arm/src/stm32/stm32_gpio.h @@ -62,7 +62,7 @@ #elif defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f30xxx_gpio.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_gpio.h" #else # error "Unrecognized STM32 chip" @@ -203,7 +203,7 @@ #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) /* Each port bit of the general-purpose I/O (GPIO) ports can be individually configured * by software in several modes: diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index 5f3e1c2c5c9..99b923eb154 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -105,7 +105,7 @@ /* Experimentally enabled for STM32L15XX */ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F10XX) || \ - defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /************************************************************************************ * Pre-processor Definitions @@ -155,7 +155,7 @@ #elif defined(CONFIG_STM32_STM32F10XX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \ GPIO_MODE_50MHz) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\ GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) #endif @@ -1345,7 +1345,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) * the F1 in that BTF is not set after data is received (only RXNE). */ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) || \ +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) if (priv->dcnt <= 0 && (status & (I2C_SR1_BTF | I2C_SR1_RXNE)) != 0) #else @@ -2003,5 +2003,5 @@ int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev) return OK; } -#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */ diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 21f66967323..6aba636db6f 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -112,7 +112,7 @@ /* Experimentally enabled for STM32L15XX */ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F10XX) || \ - defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /************************************************************************************ * Pre-processor Definitions @@ -162,7 +162,7 @@ #elif defined(CONFIG_STM32_STM32F10XX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \ GPIO_MODE_50MHz) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\ GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) #endif @@ -2451,5 +2451,5 @@ int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev) return OK; } -#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */ diff --git a/arch/arm/src/stm32/stm32_i2s.c b/arch/arm/src/stm32/stm32_i2s.c index 1f5d348384c..60d4a8174b5 100644 --- a/arch/arm/src/stm32/stm32_i2s.c +++ b/arch/arm/src/stm32/stm32_i2s.c @@ -153,7 +153,7 @@ # define SPI_DMA_PRIO CONFIG_SPI_DMAPRIO # elif defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32L15XX) # define SPI_DMA_PRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_DMA_PRIO DMA_SCR_PRIMED # else # error "Unknown STM32 DMA" @@ -163,7 +163,7 @@ # if (SPI_DMA_PRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (SPI_DMA_PRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif @@ -185,7 +185,7 @@ # define SPI_TXDMA8_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_MINC|DMA_CCR_DIR) # define SPI_TXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_16BITS |DMA_CCR_DIR) # define SPI_TXDMA8NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_DIR) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_RXDMA16_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_16BITS|DMA_SCR_PSIZE_16BITS|DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA8_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_8BITS |DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_16BITS |DMA_SCR_DIR_P2M) diff --git a/arch/arm/src/stm32/stm32_iwdg.c b/arch/arm/src/stm32/stm32_iwdg.c index 7b114fefa59..d26ec9f71a3 100644 --- a/arch/arm/src/stm32/stm32_iwdg.c +++ b/arch/arm/src/stm32/stm32_iwdg.c @@ -691,7 +691,7 @@ void stm32_iwdginitialize(FAR const char *devpath, uint32_t lsifreq) defined(CONFIG_STM32_JTAG_SW_ENABLE) { #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) uint32_t cr = getreg32(STM32_DBGMCU_APB1_FZ); cr |= DBGMCU_APB1_IWDGSTOP; putreg32(cr, STM32_DBGMCU_APB1_FZ); diff --git a/arch/arm/src/stm32/stm32_lowputc.c b/arch/arm/src/stm32/stm32_lowputc.c index 856879454a0..63e70904345 100644 --- a/arch/arm/src/stm32/stm32_lowputc.c +++ b/arch/arm/src/stm32/stm32_lowputc.c @@ -572,7 +572,7 @@ void stm32_lowsetup(void) #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) void stm32_lowsetup(void) { diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 8f66239a11d..0e9db500594 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -89,7 +89,7 @@ #else # define TIMTYPE_TIM2 TIMTYPE_GENERAL32 #endif -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define TIMTYPE_TIM3 TIMTYPE_GENERAL32 # define TIMTYPE_TIM4 TIMTYPE_GENERAL32 #else @@ -1719,7 +1719,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, */ #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) ccer &= ~(ATIM_CCER_CC1NE | ATIM_CCER_CC1NP | ATIM_CCER_CC2NE | ATIM_CCER_CC2NP | ATIM_CCER_CC3NE | ATIM_CCER_CC3NP | ATIM_CCER_CC4NP); #else @@ -1742,12 +1742,12 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, pwm_putreg(priv, STM32_ATIM_BDTR_OFFSET, bdtr); } #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) else #endif #endif #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F37XX) || defined(CONFIG_STM32_STM32F4XXX) { /* CCxNP must be cleared in any case */ @@ -2284,7 +2284,7 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) #elif defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ defined(CONFIG_STM32_STM32F37XX) || \ - defined(CONFIG_STM32_STM32F40XX) || \ + defined(CONFIG_STM32_STM32F4XXX) || \ defined(CONFIG_STM32_STM32L15XX) pincfg |= GPIO_INPUT | GPIO_FLOAT; #else diff --git a/arch/arm/src/stm32/stm32_pwr.c b/arch/arm/src/stm32/stm32_pwr.c index 2b0ed2a14cf..be9f2771154 100644 --- a/arch/arm/src/stm32/stm32_pwr.c +++ b/arch/arm/src/stm32/stm32_pwr.c @@ -248,7 +248,7 @@ void stm32_pwr_enablebkp(bool writable) * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) void stm32_pwr_enablebreg(bool regon) { uint16_t regval; diff --git a/arch/arm/src/stm32/stm32_pwr.h b/arch/arm/src/stm32/stm32_pwr.h index 19af928f145..dc4be9a1fe0 100644 --- a/arch/arm/src/stm32/stm32_pwr.h +++ b/arch/arm/src/stm32/stm32_pwr.h @@ -146,7 +146,7 @@ void stm32_pwr_enablebkp(bool writable); * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) void stm32_pwr_enablebreg(bool regon); #else # define stm32_pwr_enablebreg(regon) diff --git a/arch/arm/src/stm32/stm32_qencoder.c b/arch/arm/src/stm32/stm32_qencoder.c index 126ef24987c..09ed7669a0a 100644 --- a/arch/arm/src/stm32/stm32_qencoder.c +++ b/arch/arm/src/stm32/stm32_qencoder.c @@ -115,7 +115,7 @@ /* On the F4 series, TIM2 and TIM5 are 32-bit. All of the rest are 16-bit */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /* If TIM2 or TIM5 are enabled, then we have 32-bit timers */ @@ -212,7 +212,7 @@ GPIO_MODE_INPUT) #elif defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F4XXX) # define STM32_GPIO_INPUT_FLOAT (GPIO_INPUT | GPIO_FLOAT) #else # error "Unrecognized STM32 chip" diff --git a/arch/arm/src/stm32/stm32_rcc.c b/arch/arm/src/stm32/stm32_rcc.c index be152ff8d85..2ed39f9a5ea 100644 --- a/arch/arm/src/stm32/stm32_rcc.c +++ b/arch/arm/src/stm32/stm32_rcc.c @@ -86,7 +86,7 @@ # include "stm32f33xxx_rcc.c" #elif defined(CONFIG_STM32_STM32F37XX) # include "stm32f37xxx_rcc.c" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "stm32f40xxx_rcc.c" #else # error "Unsupported STM32 chip" diff --git a/arch/arm/src/stm32/stm32_rcc.h b/arch/arm/src/stm32/stm32_rcc.h index 79949cd60ca..c1b72815787 100644 --- a/arch/arm/src/stm32/stm32_rcc.h +++ b/arch/arm/src/stm32/stm32_rcc.h @@ -57,7 +57,7 @@ # include "chip/stm32f33xxx_rcc.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_rcc.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_rcc.h" #endif @@ -113,7 +113,7 @@ extern uint32_t _vectors[]; /* See stm32_vectors.S */ * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static inline void stm32_mco1config(uint32_t source, uint32_t div) { uint32_t regval; @@ -214,7 +214,7 @@ static inline void stm32_mcodivconfig(uint32_t source, uint32_t divider) * ************************************************************************************/ -#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) static inline void stm32_mco2config(uint32_t source, uint32_t div) { uint32_t regval; diff --git a/arch/arm/src/stm32/stm32_rtc.c b/arch/arm/src/stm32/stm32_rtc.c index 3e8dc0b0d78..f26417b0d97 100644 --- a/arch/arm/src/stm32/stm32_rtc.c +++ b/arch/arm/src/stm32/stm32_rtc.c @@ -66,6 +66,6 @@ #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ defined(CONFIG_STM32_STM32F30XX) # include "stm32_rtcc.c" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "stm32f40xxx_rtcc.c" #endif diff --git a/arch/arm/src/stm32/stm32_rtc.h b/arch/arm/src/stm32/stm32_rtc.h index 6271a97ed79..81daa926599 100644 --- a/arch/arm/src/stm32/stm32_rtc.h +++ b/arch/arm/src/stm32/stm32_rtc.h @@ -60,13 +60,13 @@ */ #elif defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F20XX) || \ - defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32_rtcc.h" #endif /* Alarm function differs from part to part */ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX # include "stm32f40xxx_alarm.h" #else # include "stm32_alarm.h" diff --git a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c index 6a8c0793998..29af5d8c151 100644 --- a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c @@ -60,7 +60,7 @@ * Pre-processor Definitions ****************************************************************************/ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX # define STM32_NALARMS 2 #else # define STM32_NALARMS 1 @@ -75,7 +75,7 @@ struct stm32_cbinfo_s { volatile rtc_alarm_callback_t cb; /* Callback when the alarm expires */ volatile FAR void *priv; /* Private argurment to accompany callback */ -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX uint8_t id; /* Identifies the alarm */ #endif }; @@ -174,7 +174,7 @@ static struct stm32_lowerhalf_s g_rtc_lowerhalf = ****************************************************************************/ #ifdef CONFIG_RTC_ALARM -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX static void stm32_alarm_callback(FAR void *arg, unsigned int alarmid) { FAR struct stm32_lowerhalf_s *lower; @@ -229,7 +229,7 @@ static void stm32_alarm_callback(void) } } -#endif /* CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_RTC_ALARM */ /**************************************************************************** @@ -393,7 +393,7 @@ static bool stm32_havesettime(FAR struct rtc_lowerhalf_s *lower) static int stm32_setalarm(FAR struct rtc_lowerhalf_s *lower, FAR const struct lower_setalarm_s *alarminfo) { -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX FAR struct stm32_lowerhalf_s *priv; FAR struct stm32_cbinfo_s *cbinfo; struct alm_setalarm_s lowerinfo; @@ -492,7 +492,7 @@ static int stm32_setalarm(FAR struct rtc_lowerhalf_s *lower, static int stm32_setrelative(FAR struct rtc_lowerhalf_s *lower, FAR const struct lower_setrelative_s *alarminfo) { -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX struct lower_setalarm_s setalarm; struct tm time; time_t seconds; @@ -643,7 +643,7 @@ static int stm32_setrelative(FAR struct rtc_lowerhalf_s *lower, #ifdef CONFIG_RTC_ALARM static int stm32_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid) { -#ifdef CONFIG_STM32_STM32F40XX +#ifdef CONFIG_STM32_STM32F4XXX FAR struct stm32_lowerhalf_s *priv; FAR struct stm32_cbinfo_s *cbinfo; int ret = -EINVAL; diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index db95c008e91..e5d3c22ecb5 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -126,7 +126,7 @@ # ifndef CONFIG_STM32_SDIO_DMAPRIO # if defined(CONFIG_STM32_STM32F10XX) # define CONFIG_STM32_SDIO_DMAPRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CONFIG_STM32_SDIO_DMAPRIO DMA_SCR_PRIVERYHI # else # error "Unknown STM32 DMA" @@ -136,7 +136,7 @@ # if (CONFIG_STM32_SDIO_DMAPRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_STM32_SDIO_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (CONFIG_STM32_SDIO_DMAPRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_STM32_SDIO_DMAPRIO" # endif @@ -207,7 +207,7 @@ /* STM32 F4 stream configuration register (SCR) settings. */ -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SDIO_RXDMA32_CONFIG (DMA_SCR_PFCTRL | DMA_SCR_DIR_P2M|DMA_SCR_MINC | \ DMA_SCR_PSIZE_32BITS | DMA_SCR_MSIZE_32BITS | \ CONFIG_STM32_SDIO_DMAPRIO | DMA_SCR_PBURST_INCR4 | \ @@ -227,7 +227,7 @@ #if defined(CONFIG_STM32_STM32F10XX) # define SDIO_DMACHAN DMACHAN_SDIO -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SDIO_DMACHAN DMAMAP_SDIO #else # error "Unknown STM32 DMA" @@ -2649,7 +2649,7 @@ static int stm32_registercallback(FAR struct sdio_dev_s *dev, static int stm32_dmapreflight(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t buflen) { -#if !defined(CONFIG_STM32_STM32F40XX) +#if !defined(CONFIG_STM32_STM32F4XXX) struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0); diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 7aa362c38f5..8e484dc1a3a 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -80,7 +80,7 @@ #ifdef SERIAL_HAVE_DMA -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /* Verify that DMA has been enabled and the DMA channel has been defined. */ @@ -198,7 +198,7 @@ defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ defined(CONFIG_STM32_STM32F37XX) # define CONFIG_USART_DMAPRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define CONFIG_USART_DMAPRIO DMA_SCR_PRIMED # else # error "Unknown STM32 DMA" @@ -210,7 +210,7 @@ # if (CONFIG_USART_DMAPRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_USART_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (CONFIG_USART_DMAPRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_USART_DMAPRIO" # endif @@ -220,7 +220,7 @@ /* DMA control word */ -# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SERIAL_DMA_CONTROL_WORD \ (DMA_SCR_DIR_P2M | \ DMA_SCR_CIRC | \ @@ -1265,7 +1265,7 @@ static void up_set_format(struct uart_dev_s *dev) fraction = (usartdiv32 - (mantissa << 5) + 1) >> 1; -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) /* The F4 supports 8 X in oversampling additional to the * standard oversampling by 16. * diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 3a4a7c8bf98..cab5655be30 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -111,7 +111,7 @@ # define SPI_DMA_PRIO CONFIG_SPI_DMAPRIO # elif defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32L15XX) # define SPI_DMA_PRIO DMA_CCR_PRIMED -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_DMA_PRIO DMA_SCR_PRIMED # else # error "Unknown STM32 DMA" @@ -121,7 +121,7 @@ # if (SPI_DMA_PRIO & ~DMA_CCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif -# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # if (SPI_DMA_PRIO & ~DMA_SCR_PL_MASK) != 0 # error "Illegal value for CONFIG_SPI_DMAPRIO" # endif @@ -143,7 +143,7 @@ # define SPI_TXDMA8_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_MINC|DMA_CCR_DIR) # define SPI_TXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_16BITS |DMA_CCR_DIR) # define SPI_TXDMA8NULL_CONFIG (SPI_DMA_PRIO|DMA_CCR_MSIZE_8BITS |DMA_CCR_PSIZE_8BITS |DMA_CCR_DIR) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define SPI_RXDMA16_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_16BITS|DMA_SCR_PSIZE_16BITS|DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA8_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_8BITS |DMA_SCR_MINC|DMA_SCR_DIR_P2M) # define SPI_RXDMA16NULL_CONFIG (SPI_DMA_PRIO|DMA_SCR_MSIZE_8BITS |DMA_SCR_PSIZE_16BITS |DMA_SCR_DIR_P2M) diff --git a/arch/arm/src/stm32/stm32_syscfg.h b/arch/arm/src/stm32/stm32_syscfg.h index 9d832b0f2ea..917de13031c 100644 --- a/arch/arm/src/stm32/stm32_syscfg.h +++ b/arch/arm/src/stm32/stm32_syscfg.h @@ -53,7 +53,7 @@ # include "chip/stm32f33xxx_syscfg.h" #elif defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f37xxx_syscfg.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_syscfg.h" #endif diff --git a/arch/arm/src/stm32/stm32_tim_lowerhalf.c b/arch/arm/src/stm32/stm32_tim_lowerhalf.c index cea5e2c2726..21e7fbaf713 100644 --- a/arch/arm/src/stm32/stm32_tim_lowerhalf.c +++ b/arch/arm/src/stm32/stm32_tim_lowerhalf.c @@ -73,7 +73,7 @@ #else # define STM32_TIM2_RES 32 #endif -#if defined(CONFIG_STM32_STM32L20XX) || defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32L20XX) || defined(CONFIG_STM32_STM32F4XXX) # define STM32_TIM3_RES 32 # define STM32_TIM4_RES 32 #else diff --git a/arch/arm/src/stm32/stm32_uart.h b/arch/arm/src/stm32/stm32_uart.h index fe2542cfa69..e7c058ba6c7 100644 --- a/arch/arm/src/stm32/stm32_uart.h +++ b/arch/arm/src/stm32/stm32_uart.h @@ -53,7 +53,7 @@ #elif defined(CONFIG_STM32_STM32F30XX) || defined(CONFIG_STM32_STM32F33XX) || \ defined(CONFIG_STM32_STM32F37XX) # include "chip/stm32f30xxx_uart.h" -#elif defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F4XXX) # include "chip/stm32f40xxx_uart.h" #else # error "Unsupported STM32 UART" diff --git a/arch/arm/src/stm32/stm32_wwdg.c b/arch/arm/src/stm32/stm32_wwdg.c index c0cb34f1f71..79d34656dae 100644 --- a/arch/arm/src/stm32/stm32_wwdg.c +++ b/arch/arm/src/stm32/stm32_wwdg.c @@ -790,7 +790,7 @@ void stm32_wwdginitialize(FAR const char *devpath) defined(CONFIG_STM32_JTAG_SW_ENABLE) { #if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F30XX) || \ - defined(CONFIG_STM32_STM32F40XX) || defined(CONFIG_STM32_STM32L15XX) + defined(CONFIG_STM32_STM32F4XXX) || defined(CONFIG_STM32_STM32L15XX) uint32_t cr = getreg32(STM32_DBGMCU_APB1_FZ); cr |= DBGMCU_APB1_WWDGSTOP; putreg32(cr, STM32_DBGMCU_APB1_FZ); diff --git a/arch/arm/src/stm32/stm32f40xxx_dma.c b/arch/arm/src/stm32/stm32f40xxx_dma.c index 1824c76bf46..54a0a978456 100644 --- a/arch/arm/src/stm32/stm32f40xxx_dma.c +++ b/arch/arm/src/stm32/stm32f40xxx_dma.c @@ -59,7 +59,7 @@ * as well?) */ -#if defined(CONFIG_STM32_STM32F40XX) +#if defined(CONFIG_STM32_STM32F4XXX) /**************************************************************************** * Pre-processor Definitions @@ -1050,4 +1050,4 @@ void stm32_dmadump(DMA_HANDLE handle, const struct stm32_dmaregs_s *regs, } #endif -#endif /* CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F4XXX */ diff --git a/arch/arm/src/stm32/stm32f40xxx_i2c.c b/arch/arm/src/stm32/stm32f40xxx_i2c.c index 1eccabd4cd5..da50766f3fe 100644 --- a/arch/arm/src/stm32/stm32f40xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f40xxx_i2c.c @@ -105,7 +105,7 @@ /* Experimentally enabled for STM32L15XX */ #if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F10XX) || \ - defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) + defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) /************************************************************************************ * Pre-processor Definitions @@ -155,7 +155,7 @@ #elif defined(CONFIG_STM32_STM32F10XX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \ GPIO_MODE_50MHz) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F4XXX) # define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\ GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) #endif @@ -2747,5 +2747,5 @@ int stm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev) return OK; } -#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F40XX */ +#endif /* CONFIG_STM32_STM32F10XX || CONFIG_STM32_STM32F20XX || CONFIG_STM32_STM32F4XXX */ #endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */ diff --git a/configs/Board.mk b/configs/Board.mk index 680b37ebcb2..076de67c4ea 100644 --- a/configs/Board.mk +++ b/configs/Board.mk @@ -50,6 +50,9 @@ OBJS = $(AOBJS) $(COBJS) SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src +ifneq ($(CONFIG_ARCH_FAMILY),) + ARCH_FAMILY = $(patsubst "%",%,$(CONFIG_ARCH_FAMILY)) +endif ifneq ($(ZDSVERSION),) ifeq ($(WINTOOL),y) @@ -67,8 +70,8 @@ ifeq ($(CONFIG_ARCH_SIM),y) else CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)chip}" CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)common}" -ifneq ($(CONFIG_ARCH_FAMILY),) - CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)$(CONFIG_ARCH_FAMILY)}" +ifneq ($(ARCH_FAMILY),) + CFLAGS += -I "${shell cygpath -w $(ARCHSRCDIR)$(DELIM)$(ARCH_FAMILY)}" endif endif else @@ -78,8 +81,8 @@ ifeq ($(CONFIG_ARCH_SIM),y) else CFLAGS += -I$(ARCHSRCDIR)$(DELIM)chip CFLAGS += -I$(ARCHSRCDIR)$(DELIM)common -ifneq ($(CONFIG_ARCH_FAMILY),) - CFLAGS += -I$(ARCHSRCDIR)$(DELIM)$(CONFIG_ARCH_FAMILY) +ifneq ($(ARCH_FAMILY),) + CFLAGS += -I$(ARCHSRCDIR)$(DELIM)$(ARCH_FAMILY) endif endif endif @@ -113,7 +116,7 @@ $(CXXOBJS) $(LINKOBJS): %$(OBJEXT): %.cxx $(call COMPILEXX, $<, $@) libboard$(LIBEXT): $(OBJS) $(CXXOBJS) - $(Q) $(AR) $@ # Create an empty archive + $(Q) $(AR) $@ ifneq ($(OBJS),) $(call ARCHIVE, $@, $(OBJS) $(CXXOBJS)) endif diff --git a/configs/clicker2-stm32/knsh/defconfig b/configs/clicker2-stm32/knsh/defconfig index b75ba40a8d3..aa53f6e5c6d 100644 --- a/configs/clicker2-stm32/knsh/defconfig +++ b/configs/clicker2-stm32/knsh/defconfig @@ -326,7 +326,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig index 7a3d03e4415..ff1954f9eac 100644 --- a/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig +++ b/configs/clicker2-stm32/mrf24j40-6lowpan/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-mac/defconfig b/configs/clicker2-stm32/mrf24j40-mac/defconfig index 7ee79a1d4a7..7c17224ff8e 100644 --- a/configs/clicker2-stm32/mrf24j40-mac/defconfig +++ b/configs/clicker2-stm32/mrf24j40-mac/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-starhub/defconfig b/configs/clicker2-stm32/mrf24j40-starhub/defconfig index 45000c97af8..b66d7ec7eb4 100644 --- a/configs/clicker2-stm32/mrf24j40-starhub/defconfig +++ b/configs/clicker2-stm32/mrf24j40-starhub/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/mrf24j40-starpoint/defconfig b/configs/clicker2-stm32/mrf24j40-starpoint/defconfig index 99c76b0eadc..f542507c134 100644 --- a/configs/clicker2-stm32/mrf24j40-starpoint/defconfig +++ b/configs/clicker2-stm32/mrf24j40-starpoint/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/nsh/defconfig b/configs/clicker2-stm32/nsh/defconfig index 0fb4bd7cdc0..a81215fcf88 100644 --- a/configs/clicker2-stm32/nsh/defconfig +++ b/configs/clicker2-stm32/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/clicker2-stm32/usbnsh/defconfig b/configs/clicker2-stm32/usbnsh/defconfig index 3db2eabaafa..11d5ac80325 100644 --- a/configs/clicker2-stm32/usbnsh/defconfig +++ b/configs/clicker2-stm32/usbnsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/cloudctrl/nsh/defconfig b/configs/cloudctrl/nsh/defconfig index 6d04d18d25f..fa608551771 100644 --- a/configs/cloudctrl/nsh/defconfig +++ b/configs/cloudctrl/nsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/dk-tm4c129x/README.txt b/configs/dk-tm4c129x/README.txt index 291323da4ab..9e5aa4ebd09 100644 --- a/configs/dk-tm4c129x/README.txt +++ b/configs/dk-tm4c129x/README.txt @@ -757,7 +757,8 @@ Where is one of the following: configuration other than using IPv6. So all of the notes above regarding the nsh configuration apply. - Telnet does not work with IPv6. + Telnet does work with IPv6 but is not enabled in this + configuration (but could be). 2. This configuration can be modified to that both IPv4 and IPv6 are support. Here is a summary of the additional configuration @@ -788,9 +789,14 @@ Where is one of the following: ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telnet 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. You can enable IPv6 autonomous address configuration with the following changes to the configuration: diff --git a/configs/fire-stm32v2/nsh/defconfig b/configs/fire-stm32v2/nsh/defconfig index b1f0cb08c07..ff24314cc73 100644 --- a/configs/fire-stm32v2/nsh/defconfig +++ b/configs/fire-stm32v2/nsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/nsh/defconfig b/configs/hymini-stm32v/nsh/defconfig index 2178d7a29a9..f3cb9a1b8ac 100644 --- a/configs/hymini-stm32v/nsh/defconfig +++ b/configs/hymini-stm32v/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/nsh2/defconfig b/configs/hymini-stm32v/nsh2/defconfig index 4e3a6fdb4a8..f27897f8693 100644 --- a/configs/hymini-stm32v/nsh2/defconfig +++ b/configs/hymini-stm32v/nsh2/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/usbmsc/defconfig b/configs/hymini-stm32v/usbmsc/defconfig index 95ebfa83d32..19e19949bae 100644 --- a/configs/hymini-stm32v/usbmsc/defconfig +++ b/configs/hymini-stm32v/usbmsc/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/usbnsh/defconfig b/configs/hymini-stm32v/usbnsh/defconfig index 745d7c0730a..b7bd587e784 100644 --- a/configs/hymini-stm32v/usbnsh/defconfig +++ b/configs/hymini-stm32v/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/hymini-stm32v/usbserial/defconfig b/configs/hymini-stm32v/usbserial/defconfig index 045cdccaa0b..bc8f076a10c 100644 --- a/configs/hymini-stm32v/usbserial/defconfig +++ b/configs/hymini-stm32v/usbserial/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/maple/nsh/defconfig b/configs/maple/nsh/defconfig index 3d3dc6c5168..48719eb4896 100644 --- a/configs/maple/nsh/defconfig +++ b/configs/maple/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/maple/nx/defconfig b/configs/maple/nx/defconfig index 90d72dd22cb..d166bf7fecb 100644 --- a/configs/maple/nx/defconfig +++ b/configs/maple/nx/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/maple/usbnsh/defconfig b/configs/maple/usbnsh/defconfig index fae6560d13b..0c1afea5ea9 100644 --- a/configs/maple/usbnsh/defconfig +++ b/configs/maple/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/mikroe-stm32f4/fulldemo/defconfig b/configs/mikroe-stm32f4/fulldemo/defconfig index 8195102e45c..2b653c380b4 100644 --- a/configs/mikroe-stm32f4/fulldemo/defconfig +++ b/configs/mikroe-stm32f4/fulldemo/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/kostest/defconfig b/configs/mikroe-stm32f4/kostest/defconfig index 1acecc42817..fd4bc59b351 100644 --- a/configs/mikroe-stm32f4/kostest/defconfig +++ b/configs/mikroe-stm32f4/kostest/defconfig @@ -326,7 +326,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nsh/defconfig b/configs/mikroe-stm32f4/nsh/defconfig index 6ebe81c54cc..abb5d3bf2e6 100644 --- a/configs/mikroe-stm32f4/nsh/defconfig +++ b/configs/mikroe-stm32f4/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nx/defconfig b/configs/mikroe-stm32f4/nx/defconfig index a90fc6ef0a7..f59be60e5af 100644 --- a/configs/mikroe-stm32f4/nx/defconfig +++ b/configs/mikroe-stm32f4/nx/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nxlines/defconfig b/configs/mikroe-stm32f4/nxlines/defconfig index 23e48763ecb..8130023159c 100644 --- a/configs/mikroe-stm32f4/nxlines/defconfig +++ b/configs/mikroe-stm32f4/nxlines/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/nxtext/defconfig b/configs/mikroe-stm32f4/nxtext/defconfig index c3575a1754c..0fa6c4097be 100644 --- a/configs/mikroe-stm32f4/nxtext/defconfig +++ b/configs/mikroe-stm32f4/nxtext/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/mikroe-stm32f4/usbnsh/defconfig b/configs/mikroe-stm32f4/usbnsh/defconfig index 98b77895a6a..1155d137253 100644 --- a/configs/mikroe-stm32f4/usbnsh/defconfig +++ b/configs/mikroe-stm32f4/usbnsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f303re/adc/defconfig b/configs/nucleo-f303re/adc/defconfig index b63a7eb7122..c22d10454f5 100644 --- a/configs/nucleo-f303re/adc/defconfig +++ b/configs/nucleo-f303re/adc/defconfig @@ -315,7 +315,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/can/defconfig b/configs/nucleo-f303re/can/defconfig index 4fab471101a..7bea847d7aa 100644 --- a/configs/nucleo-f303re/can/defconfig +++ b/configs/nucleo-f303re/can/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/hello/defconfig b/configs/nucleo-f303re/hello/defconfig index c2ed153f8e1..681e2318688 100644 --- a/configs/nucleo-f303re/hello/defconfig +++ b/configs/nucleo-f303re/hello/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/nxlines/defconfig b/configs/nucleo-f303re/nxlines/defconfig index 5d3104d9b39..c3b06550d78 100644 --- a/configs/nucleo-f303re/nxlines/defconfig +++ b/configs/nucleo-f303re/nxlines/defconfig @@ -315,7 +315,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/pwm/defconfig b/configs/nucleo-f303re/pwm/defconfig index 98720e69b62..02327b59a23 100644 --- a/configs/nucleo-f303re/pwm/defconfig +++ b/configs/nucleo-f303re/pwm/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/serialrx/defconfig b/configs/nucleo-f303re/serialrx/defconfig index 8b14405c4a7..3cfbafe5c71 100644 --- a/configs/nucleo-f303re/serialrx/defconfig +++ b/configs/nucleo-f303re/serialrx/defconfig @@ -316,7 +316,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f303re/uavcan/defconfig b/configs/nucleo-f303re/uavcan/defconfig index 8a8f69e4555..7e2cafee66f 100644 --- a/configs/nucleo-f303re/uavcan/defconfig +++ b/configs/nucleo-f303re/uavcan/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f334r8/adc/defconfig b/configs/nucleo-f334r8/adc/defconfig index 8e3bf15ba0b..bec89c1f7b8 100644 --- a/configs/nucleo-f334r8/adc/defconfig +++ b/configs/nucleo-f334r8/adc/defconfig @@ -346,7 +346,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set CONFIG_STM32_STM32F33XX=y # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f334r8/nsh/defconfig b/configs/nucleo-f334r8/nsh/defconfig index 86849afa1c9..0117dbb5e54 100644 --- a/configs/nucleo-f334r8/nsh/defconfig +++ b/configs/nucleo-f334r8/nsh/defconfig @@ -344,7 +344,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set CONFIG_STM32_STM32F33XX=y # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/nucleo-f4x1re/f401-nsh-clang/defconfig b/configs/nucleo-f4x1re/f401-nsh-clang/defconfig index 1e70d31d46e..4fe4a8f283c 100644 --- a/configs/nucleo-f4x1re/f401-nsh-clang/defconfig +++ b/configs/nucleo-f4x1re/f401-nsh-clang/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y CONFIG_STM32_STM32F401=y # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f4x1re/f401-nsh/defconfig b/configs/nucleo-f4x1re/f401-nsh/defconfig index 34b6503df73..d044d10eb11 100644 --- a/configs/nucleo-f4x1re/f401-nsh/defconfig +++ b/configs/nucleo-f4x1re/f401-nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y CONFIG_STM32_STM32F401=y # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/nucleo-f4x1re/f411-nsh/defconfig b/configs/nucleo-f4x1re/f411-nsh/defconfig index 65bbd4052ec..3a63c316b4d 100644 --- a/configs/nucleo-f4x1re/f411-nsh/defconfig +++ b/configs/nucleo-f4x1re/f411-nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set CONFIG_STM32_STM32F411=y diff --git a/configs/olimex-stm32-e407/discover/defconfig b/configs/olimex-stm32-e407/discover/defconfig index 67717307c54..de31c02891a 100644 --- a/configs/olimex-stm32-e407/discover/defconfig +++ b/configs/olimex-stm32-e407/discover/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/netnsh/defconfig b/configs/olimex-stm32-e407/netnsh/defconfig index 06367d3c0f7..5de8733eee4 100644 --- a/configs/olimex-stm32-e407/netnsh/defconfig +++ b/configs/olimex-stm32-e407/netnsh/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/nsh/defconfig b/configs/olimex-stm32-e407/nsh/defconfig index aadadcc6426..f59d4aa47e7 100644 --- a/configs/olimex-stm32-e407/nsh/defconfig +++ b/configs/olimex-stm32-e407/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/telnetd/defconfig b/configs/olimex-stm32-e407/telnetd/defconfig index eaf4e161e3e..80c75f2cba0 100644 --- a/configs/olimex-stm32-e407/telnetd/defconfig +++ b/configs/olimex-stm32-e407/telnetd/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/usbnsh/defconfig b/configs/olimex-stm32-e407/usbnsh/defconfig index 97476cc594a..80525055212 100644 --- a/configs/olimex-stm32-e407/usbnsh/defconfig +++ b/configs/olimex-stm32-e407/usbnsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-e407/webserver/defconfig b/configs/olimex-stm32-e407/webserver/defconfig index a1587edd55b..59ed1629ab9 100644 --- a/configs/olimex-stm32-e407/webserver/defconfig +++ b/configs/olimex-stm32-e407/webserver/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-h405/usbnsh/defconfig b/configs/olimex-stm32-h405/usbnsh/defconfig index e9e635c56ee..22eff18b2a2 100644 --- a/configs/olimex-stm32-h405/usbnsh/defconfig +++ b/configs/olimex-stm32-h405/usbnsh/defconfig @@ -326,7 +326,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-h407/nsh/defconfig b/configs/olimex-stm32-h407/nsh/defconfig index 9c63f28284a..43f4cc1a218 100644 --- a/configs/olimex-stm32-h407/nsh/defconfig +++ b/configs/olimex-stm32-h407/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-p107/nsh/defconfig b/configs/olimex-stm32-p107/nsh/defconfig index ad911d78c52..73b23d32634 100644 --- a/configs/olimex-stm32-p107/nsh/defconfig +++ b/configs/olimex-stm32-p107/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/olimex-stm32-p207/nsh/defconfig b/configs/olimex-stm32-p207/nsh/defconfig index 9426e3101a4..a15d8576b19 100644 --- a/configs/olimex-stm32-p207/nsh/defconfig +++ b/configs/olimex-stm32-p207/nsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-p407/knsh/defconfig b/configs/olimex-stm32-p407/knsh/defconfig index b1fdc541d11..b1fc9982792 100644 --- a/configs/olimex-stm32-p407/knsh/defconfig +++ b/configs/olimex-stm32-p407/knsh/defconfig @@ -327,7 +327,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimex-stm32-p407/nsh/defconfig b/configs/olimex-stm32-p407/nsh/defconfig index ea3cb293ead..e3d5381f67a 100644 --- a/configs/olimex-stm32-p407/nsh/defconfig +++ b/configs/olimex-stm32-p407/nsh/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/can/defconfig b/configs/olimexino-stm32/can/defconfig index 3546af6d673..76c9d6239b7 100644 --- a/configs/olimexino-stm32/can/defconfig +++ b/configs/olimexino-stm32/can/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/composite/defconfig b/configs/olimexino-stm32/composite/defconfig index 1ac088caddc..2d609368133 100644 --- a/configs/olimexino-stm32/composite/defconfig +++ b/configs/olimexino-stm32/composite/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/nsh/defconfig b/configs/olimexino-stm32/nsh/defconfig index 5adb8a0072b..68f598a02af 100644 --- a/configs/olimexino-stm32/nsh/defconfig +++ b/configs/olimexino-stm32/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/smallnsh/defconfig b/configs/olimexino-stm32/smallnsh/defconfig index 6eee73059c6..3ddc8f9651a 100644 --- a/configs/olimexino-stm32/smallnsh/defconfig +++ b/configs/olimexino-stm32/smallnsh/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/olimexino-stm32/tiny/defconfig b/configs/olimexino-stm32/tiny/defconfig index 9c3336dde2e..174cb07e13b 100644 --- a/configs/olimexino-stm32/tiny/defconfig +++ b/configs/olimexino-stm32/tiny/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/photon/nsh/defconfig b/configs/photon/nsh/defconfig index ec4b9b09da1..c27104e8adc 100644 --- a/configs/photon/nsh/defconfig +++ b/configs/photon/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F205=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/photon/usbnsh/defconfig b/configs/photon/usbnsh/defconfig index 83aa8cc706b..2b6748179fa 100644 --- a/configs/photon/usbnsh/defconfig +++ b/configs/photon/usbnsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F205=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/photon/wlan/defconfig b/configs/photon/wlan/defconfig index a368939cd51..a53bb3e432f 100644 --- a/configs/photon/wlan/defconfig +++ b/configs/photon/wlan/defconfig @@ -360,7 +360,7 @@ CONFIG_STM32_STM32F205=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/sama5d4-ek/README.txt b/configs/sama5d4-ek/README.txt index 4ea1109f88a..c8bb1c01927 100644 --- a/configs/sama5d4-ek/README.txt +++ b/configs/sama5d4-ek/README.txt @@ -3948,7 +3948,8 @@ Configurations configuration other than using IPv6. So all of the notes below regarding the nsh configuration apply. - Telnet does not work with IPv6. + Telnet does work with IPv6 but is not enabled in this + configuration (but could be). 2. This configuration can be modified to that both IPv4 and IPv6 are support. Here is a summary of the additional configuration @@ -3979,9 +3980,14 @@ Configurations ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telent 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. You can enable IPv6 autonomous address configuration with the following changes to the configuration: diff --git a/configs/shenzhou/nsh/defconfig b/configs/shenzhou/nsh/defconfig index 19fd3322961..fb824c4bc65 100644 --- a/configs/shenzhou/nsh/defconfig +++ b/configs/shenzhou/nsh/defconfig @@ -318,7 +318,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index 9dfa5ad3754..bbca876c3ac 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/shenzhou/thttpd/defconfig b/configs/shenzhou/thttpd/defconfig index f2f2f742374..d5bbadb32d0 100644 --- a/configs/shenzhou/thttpd/defconfig +++ b/configs/shenzhou/thttpd/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/sim/ipforward/Make.defs b/configs/sim/ipforward/Make.defs new file mode 100644 index 00000000000..6f9f5fef4ae --- /dev/null +++ b/configs/sim/ipforward/Make.defs @@ -0,0 +1,128 @@ +############################################################################ +# configs/sim/ipforward/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 + +HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"} + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = -g +endif + +ifneq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += -O2 +endif + +ARCHCPUFLAGS = -fno-builtin +ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti +ARCHPICFLAGS = -fpic +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef +ARCHWARNINGSXX = -Wall -Wshadow -Wundef +ARCHDEFINES = +ARCHINCLUDES = -I. -isystem $(TOPDIR)/include +ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx +ARCHSCRIPT = + +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + +CROSSDEV = +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 + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + + +# ELF module definitions + +CELFFLAGS = $(CFLAGS) +CXXELFFLAGS = $(CXXFLAGS) + +LDELFFLAGS = -r -e main +ifeq ($(WINTOOL),y) + LDELFFLAGS += -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/gnu-elf.ld}" +else + LDELFFLAGS += -T $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/gnu-elf.ld +endif + + +ASMEXT = .S +OBJEXT = .o +LIBEXT = .a + +ifeq ($(HOSTOS),Cygwin) + EXEEXT = .exe +else + EXEEXT = +endif + +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 +endif + + +MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +HOSTLDFLAGS = diff --git a/configs/sim/ipforward/defconfig b/configs/sim/ipforward/defconfig new file mode 100644 index 00000000000..312519a65ff --- /dev/null +++ b/configs/sim/ipforward/defconfig @@ -0,0 +1,1074 @@ +# +# 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 is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set +# 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=y + +# +# Debug SYSLOG Output Controls +# +# CONFIG_DEBUG_ERROR is not set +CONFIG_DEBUG_ASSERTIONS=y + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_GRAPHICS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_NET is not set +# CONFIG_DEBUG_SCHED is not set + +# +# OS Function Debug Options +# +# CONFIG_DEBUG_IRQ is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_GPIO is not set +# CONFIG_DEBUG_TIMER is not set +# CONFIG_ARCH_HAVE_STACKCHECK is not set +# CONFIG_ARCH_HAVE_HEAPCHECK is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_ARCH_HAVE_CUSTOMOPT is not set +CONFIG_DEBUG_NOOPT=y +# CONFIG_DEBUG_FULLOPT is not set + +# +# System Type +# +# CONFIG_ARCH_ARM is not set +# 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=y +# 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="sim" + +# +# Simulation Configuration Options +# +CONFIG_HOST_X86_64=y +# CONFIG_HOST_X86 is not set +# CONFIG_SIM_M32 is not set +CONFIG_SIM_X8664_SYSTEMV=y +# CONFIG_SIM_X8664_MICROSOFT is not set +CONFIG_SIM_WALLTIME=y +CONFIG_SIM_NETDEV=y +CONFIG_SIM_NET_HOST_ROUTE=y +# CONFIG_SIM_NET_BRIDGE is not set +# 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 +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_VECNOTIRQ is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_HAVE_IRQPRIO is not set +# 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=y +# CONFIG_ARCH_HAVE_VFORK is not set +# CONFIG_ARCH_HAVE_MMU is not set +# CONFIG_ARCH_HAVE_MPU is not set +# CONFIG_ARCH_NAND_HWECC is not set +# 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 is not set +# CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set +# CONFIG_ARCH_HAVE_RAMVECTORS is not set +# CONFIG_ARCH_MINIMAL_VECTORTABLE is not set + +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=0 +# CONFIG_ARCH_CALIBRATION is not set + +# +# Interrupt options +# +# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set +# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set + +# +# Boot options +# +CONFIG_BOOT_RUNFROMEXTSRAM=y +# CONFIG_BOOT_RUNFROMFLASH is not set +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set + +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x0 +CONFIG_RAM_SIZE=0 +# CONFIG_ARCH_HAVE_SDRAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_SIM=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="sim" + +# +# Common Board Options +# + +# +# Board-Specific Options +# +# CONFIG_BOARD_CRASHDUMP is not set +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_POWEROFF=y +# CONFIG_BOARDCTL_UNIQUEID is not set +# CONFIG_BOARDCTL_APP_SYMTAB is not set +# 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 is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2008 +CONFIG_START_MONTH=6 +CONFIG_START_DAY=1 +CONFIG_MAX_WDOGPARMS=4 +CONFIG_PREALLOC_WDOGS=32 +CONFIG_WDOG_INTRESERVE=4 +CONFIG_PREALLOC_TIMERS=8 + +# +# Tasks and Scheduling +# +# CONFIG_SPINLOCK is not set +# CONFIG_SMP 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=0 +# CONFIG_SCHED_SPORADIC is not set +CONFIG_TASK_NAME_SIZE=31 +CONFIG_MAX_TASKS=64 +CONFIG_SCHED_HAVE_PARENT=y +# CONFIG_SCHED_CHILD_STATUS 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=y +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +CONFIG_NFILE_DESCRIPTORS=32 +CONFIG_NFILE_STREAMS=16 +CONFIG_NAME_MAX=32 +# CONFIG_PRIORITY_INHERITANCE is not set + +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +CONFIG_SCHED_ONEXIT=y +CONFIG_SCHED_ONEXIT_MAX=1 +# CONFIG_SIG_EVTHREAD is not set + +# +# Signal Numbers +# +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCHLD=4 +CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 + +# +# POSIX Message Queue Options +# +CONFIG_PREALLOC_MQ_MSGS=32 +CONFIG_MQ_MAXMSGSIZE=32 +# CONFIG_MODULE is not set + +# +# Work queue support +# +CONFIG_SCHED_WORKQUEUE=y +# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_LPWORK=y +CONFIG_SCHED_LPNTHREADS=1 +CONFIG_SCHED_LPWORKPRIORITY=140 +CONFIG_SCHED_LPWORKPERIOD=50000 +CONFIG_SCHED_LPWORKSTACKSIZE=8192 + +# +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_USERMAIN_STACKSIZE=4096 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=8192 +# CONFIG_LIB_SYSCALL is not set + +# +# Device Drivers +# +CONFIG_DISABLE_POLL=y +CONFIG_DEV_NULL=y +CONFIG_DEV_ZERO=y +# CONFIG_DEV_URANDOM is not set +CONFIG_DEV_LOOP=y + +# +# 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 is not set +# 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 is not set +# CONFIG_SPI 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_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_NETDEVICES=y + +# +# General Ethernet MAC Driver Options +# +# CONFIG_NETDEV_LOOPBACK is not set +# CONFIG_NETDEV_TELNET is not set +CONFIG_NETDEV_MULTINIC=y +CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y +# CONFIG_NETDEV_LATEINIT is not set +# CONFIG_NET_DUMPPACKET is not set + +# +# 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 +# CONFIG_SENSORS is not set +CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_SERIAL_REMOVABLE is not set +CONFIG_SERIAL_CONSOLE=y +# 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 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 is not set +# CONFIG_STANDARD_SERIAL is not set +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +# CONFIG_SERIAL_DMA is not set +# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +# CONFIG_PSEUDOTERM is not set +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_USBMISC is not set +# CONFIG_HAVE_USBTRACE is not set +# CONFIG_DRIVERS_WIRELESS 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 +# CONFIG_SYSLOG_CHAR is not set +CONFIG_SYSLOG_CONSOLE=y +# CONFIG_SYSLOG_NONE is not set +# CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set + +# +# Networking Support +# +CONFIG_ARCH_HAVE_NET=y +# CONFIG_ARCH_HAVE_PHY 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 is not set +# CONFIG_NET_LOOPBACK is not set +CONFIG_NET_TUN=y +CONFIG_TUN_NINTERFACES=2 +CONFIG_NET_TUN_MTU=296 +CONFIG_NET_TUN_TCP_RECVWNDO=256 +CONFIG_TUN_LPWORK=y +# CONFIG_NET_USRSOCK is not set + +# +# Network Device Operations +# +# CONFIG_NETDEV_IOCTL is not set +# CONFIG_NETDEV_PHY_IOCTL is not set + +# +# Internet Protocol Selection +# +# CONFIG_NET_IPv4 is not set +CONFIG_NET_IPv6=y +CONFIG_NET_IPv6_NCONF_ENTRIES=4 +CONFIG_NET_IPFORWARD=y +# CONFIG_NET_IPFORWARD_BROADCAST is not set +CONFIG_NET_IPFORWARD_NSTRUCT=4 + +# +# 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=16 +CONFIG_NET_TCP_READAHEAD=y +CONFIG_NET_TCP_WRITE_BUFFERS=y +CONFIG_NET_TCP_NWRBCHAINS=8 +# CONFIG_NET_TCP_WRBUFFER_DEBUG is not set +CONFIG_NET_TCP_RECVDELAY=0 +CONFIG_NET_TCPBACKLOG=y +# CONFIG_NET_SENDFILE is not set + +# +# UDP Networking +# +# CONFIG_NET_UDP is not set +# CONFIG_NET_UDP_NO_STACK is not set + +# +# 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 is not set +# CONFIG_NET_HAVE_STAR is not set + +# +# Network Topologies +# + +# +# Routing Table Configuration +# +# CONFIG_NET_ROUTE is not set +CONFIG_NET_HOSTNAME="IP-Forward" + +# +# 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_AIO is not set +# 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=y +# 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_PROCFS_EXCLUDE_NET is not set +# CONFIG_FS_UNIONFS is not set +# CONFIG_FS_HOSTFS 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=36 +CONFIG_IOB_BUFSIZE=196 +CONFIG_IOB_NCHAINS=8 +CONFIG_IOB_THROTTLE=8 +# CONFIG_IOB_DEBUG is not set + +# +# Audio Support +# +# CONFIG_AUDIO is not set + +# +# Wireless Support +# +# CONFIG_WIRELESS is not set + +# +# Binary Loader +# +# CONFIG_BINFMT_DISABLE is not set +CONFIG_BINFMT_EXEPATH=y +CONFIG_PATH_INITIAL="/bin" +# 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 + +# +# 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=y +CONFIG_EXECFUNCS_HAVE_SYMTAB=y +CONFIG_EXECFUNCS_SYMTAB="g_symtab" +CONFIG_EXECFUNCS_NSYMBOLS=0 +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=2048 +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=y +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_NETDB=y + +# +# 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 is not set + +# +# Application Configuration +# + +# +# Built-In Applications +# +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + +# +# CAN Utilities +# + +# +# Examples +# +# CONFIG_EXAMPLES_CCTYPE is not set +# CONFIG_EXAMPLES_CHAT is not set +# CONFIG_EXAMPLES_CONFIGDATA 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_HIDKBD is not set +# CONFIG_EXAMPLES_IGMP is not set +CONFIG_EXAMPLES_IPFORWARD=y +CONFIG_EXAMPLES_IPFORWARD_PRIORITY=100 +CONFIG_EXAMPLES_IPFORWARD_STACKSIZE=8192 +# CONFIG_EXAMPLES_JSON 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_NETTEST is not set +CONFIG_EXAMPLES_NSH=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_ROMFS 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_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UNIONFS 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=y +CONFIG_FSUTILS_PASSWD_PATH="/etc/passwd" +CONFIG_FSUTILS_PASSWD_READONLY=y +CONFIG_FSUTILS_PASSWD_IOBUFFER_SIZE=512 +CONFIG_FSUTILS_PASSWD_KEY1=0x12345678 +CONFIG_FSUTILS_PASSWD_KEY2=0x9abcdef0 +CONFIG_FSUTILS_PASSWD_KEY3=0x12345678 +CONFIG_FSUTILS_PASSWD_KEY4=0x9abcdef0 + +# +# 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_NETLIB=y +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETC is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_WEBCLIENT is not set +# CONFIG_NETUTILS_WEBSERVER is not set +# CONFIG_NETUTILS_XMLRPC 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=80 +# 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 +CONFIG_NSH_FILE_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 is not set +# 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 is not set +# 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 is not set +# 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_POWEROFF is not set +CONFIG_NSH_DISABLE_PRINTF=y +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PUT is not set +# 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_SHUTDOWN=y +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_TELNETD 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 is not set +# 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 is not set +CONFIG_NSH_PROC_MOUNTPOINT="/proc" +CONFIG_NSH_FILEIOSIZE=1024 + +# +# Scripting Support +# +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set +CONFIG_NSH_ROMFSETC=y +# CONFIG_NSH_ROMFSRC is not set +CONFIG_NSH_ROMFSMOUNTPT="/etc" +CONFIG_NSH_INITSCRIPT="init.d/rcS" +CONFIG_NSH_ROMFSDEVNO=1 +CONFIG_NSH_ROMFSSECTSIZE=64 +# CONFIG_NSH_DEFAULTROMFS is not set +CONFIG_NSH_ARCHROMFS=y +# CONFIG_NSH_CUSTOMROMFS is not set +CONFIG_NSH_FATDEVNO=2 +CONFIG_NSH_FATSECTSIZE=512 +CONFIG_NSH_FATNSECTORS=1024 +CONFIG_NSH_FATMOUNTPT="/tmp" + +# +# Console Configuration +# +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_ALTCONDEV is not set +CONFIG_NSH_ARCHINIT=y + +# +# Networking Configuration +# +# CONFIG_NSH_NETINIT is not set +CONFIG_NSH_MAX_ROUNDTRIP=20 +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set + +# +# NxWidgets/NxWM +# + +# +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons +# +# 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_NETDB 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=y +CONFIG_READLINE_MAX_BUILTINS=64 +CONFIG_READLINE_MAX_EXTCMDS=64 +# CONFIG_READLINE_CMD_HISTORY is not set +# CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYMTAB 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 is not set +# CONFIG_IEEE802154_LIBUTILS is not set +# CONFIG_IEEE802154_I8SAK is not set diff --git a/configs/sim/nettest/defconfig b/configs/sim/nettest/defconfig index cd7d850534a..61d6e14ff84 100644 --- a/configs/sim/nettest/defconfig +++ b/configs/sim/nettest/defconfig @@ -431,6 +431,7 @@ CONFIG_NET_ETHERNET=y # CONFIG_NET_IPv4=y # CONFIG_NET_IPv6 is not set +# CONFIG_NET_IPFORWARD is not set # # Socket Support @@ -497,6 +498,11 @@ CONFIG_NET_ARP_MAXAGE=120 # CONFIG_NET_ARCH_INCR32 is not set # CONFIG_NET_ARCH_CHKSUM is not set CONFIG_NET_STATISTICS=y +# CONFIG_NET_HAVE_STAR is not set + +# +# Network Topologies +# # # Routing Table Configuration @@ -718,14 +724,16 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # 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_NETTEST=y +CONFIG_EXAMPLES_NETTEST_SENDSIZE=4096 CONFIG_EXAMPLES_NETTEST_STACKSIZE1=2048 CONFIG_EXAMPLES_NETTEST_PRIORITY1=100 +# CONFIG_EXAMPLES_NETTEST_SERVER1 is not set +# CONFIG_EXAMPLES_NETTEST_TARGET2 is not set CONFIG_EXAMPLES_NETTEST_DEVNAME="eth0" # CONFIG_EXAMPLES_NETTEST_PERFORMANCE is not set CONFIG_EXAMPLES_NETTEST_IPv4=y @@ -764,7 +772,6 @@ CONFIG_EXAMPLES_NETTEST_SERVER_PORTNO=5471 # 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_WATCHDOG is not set @@ -812,6 +819,7 @@ CONFIG_EXAMPLES_NETTEST_SERVER_PORTNO=5471 # CONFIG_NETUTILS_JSON is not set CONFIG_NETUTILS_NETLIB=y # CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETC is not set # CONFIG_NETUTILS_TELNETD is not set # CONFIG_NETUTILS_WEBCLIENT is not set # CONFIG_NETUTILS_WEBSERVER is not set diff --git a/configs/spark/composite/defconfig b/configs/spark/composite/defconfig index e0350b7852f..c701bfd3e07 100644 --- a/configs/spark/composite/defconfig +++ b/configs/spark/composite/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/nsh/defconfig b/configs/spark/nsh/defconfig index a404c2bc703..925ab224fa0 100644 --- a/configs/spark/nsh/defconfig +++ b/configs/spark/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/usbmsc/defconfig b/configs/spark/usbmsc/defconfig index 7face48d5cb..35e14832bb3 100644 --- a/configs/spark/usbmsc/defconfig +++ b/configs/spark/usbmsc/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/usbnsh/defconfig b/configs/spark/usbnsh/defconfig index 3d0184ad1fe..4cf69d5db0e 100644 --- a/configs/spark/usbnsh/defconfig +++ b/configs/spark/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/spark/usbserial/defconfig b/configs/spark/usbserial/defconfig index 70835160d50..671433ae991 100644 --- a/configs/spark/usbserial/defconfig +++ b/configs/spark/usbserial/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/composite/defconfig b/configs/stm3210e-eval/composite/defconfig index cb7ad87fd09..f702057f8f0 100644 --- a/configs/stm3210e-eval/composite/defconfig +++ b/configs/stm3210e-eval/composite/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nsh/defconfig b/configs/stm3210e-eval/nsh/defconfig index 8207333ab16..087ccde3973 100644 --- a/configs/stm3210e-eval/nsh/defconfig +++ b/configs/stm3210e-eval/nsh/defconfig @@ -324,7 +324,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nsh2/defconfig b/configs/stm3210e-eval/nsh2/defconfig index 83d246522d0..2493dd648f3 100644 --- a/configs/stm3210e-eval/nsh2/defconfig +++ b/configs/stm3210e-eval/nsh2/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig index 82081051308..bd267d89b01 100644 --- a/configs/stm3210e-eval/nx/defconfig +++ b/configs/stm3210e-eval/nx/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/nxterm/defconfig b/configs/stm3210e-eval/nxterm/defconfig index c6fa59410d6..fb23520c19f 100644 --- a/configs/stm3210e-eval/nxterm/defconfig +++ b/configs/stm3210e-eval/nxterm/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/pm/defconfig b/configs/stm3210e-eval/pm/defconfig index bc195374f63..e5b5278e116 100644 --- a/configs/stm3210e-eval/pm/defconfig +++ b/configs/stm3210e-eval/pm/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/usbmsc/defconfig b/configs/stm3210e-eval/usbmsc/defconfig index 47d7658081c..bd1abad73ff 100644 --- a/configs/stm3210e-eval/usbmsc/defconfig +++ b/configs/stm3210e-eval/usbmsc/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3210e-eval/usbserial/defconfig b/configs/stm3210e-eval/usbserial/defconfig index a586efc92f1..55aa3079eef 100644 --- a/configs/stm3210e-eval/usbserial/defconfig +++ b/configs/stm3210e-eval/usbserial/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm3220g-eval/dhcpd/defconfig b/configs/stm3220g-eval/dhcpd/defconfig index 5fdd9cd6515..fc608f274cd 100644 --- a/configs/stm3220g-eval/dhcpd/defconfig +++ b/configs/stm3220g-eval/dhcpd/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nettest/defconfig b/configs/stm3220g-eval/nettest/defconfig index df5782fe877..aeedffc2e88 100644 --- a/configs/stm3220g-eval/nettest/defconfig +++ b/configs/stm3220g-eval/nettest/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nsh/defconfig b/configs/stm3220g-eval/nsh/defconfig index 1ecef98b393..744a59511ef 100644 --- a/configs/stm3220g-eval/nsh/defconfig +++ b/configs/stm3220g-eval/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nsh2/defconfig b/configs/stm3220g-eval/nsh2/defconfig index de128433be2..85862d37d73 100644 --- a/configs/stm3220g-eval/nsh2/defconfig +++ b/configs/stm3220g-eval/nsh2/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/nxwm/defconfig b/configs/stm3220g-eval/nxwm/defconfig index 847e4f77e80..5b774a672ac 100644 --- a/configs/stm3220g-eval/nxwm/defconfig +++ b/configs/stm3220g-eval/nxwm/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3220g-eval/telnetd/defconfig b/configs/stm3220g-eval/telnetd/defconfig index a0ab8932f49..9e7b12df3d4 100644 --- a/configs/stm3220g-eval/telnetd/defconfig +++ b/configs/stm3220g-eval/telnetd/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_STM32F207=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/dhcpd/defconfig b/configs/stm3240g-eval/dhcpd/defconfig index d3d3dcffff3..0af96796531 100644 --- a/configs/stm3240g-eval/dhcpd/defconfig +++ b/configs/stm3240g-eval/dhcpd/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/discover/defconfig b/configs/stm3240g-eval/discover/defconfig index 1d9a91bb460..6d5e900e96f 100644 --- a/configs/stm3240g-eval/discover/defconfig +++ b/configs/stm3240g-eval/discover/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/knxwm/defconfig b/configs/stm3240g-eval/knxwm/defconfig index 789f7631fc3..c405722c559 100644 --- a/configs/stm3240g-eval/knxwm/defconfig +++ b/configs/stm3240g-eval/knxwm/defconfig @@ -337,7 +337,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nettest/defconfig b/configs/stm3240g-eval/nettest/defconfig index 1e890f329cb..54feb7e2525 100644 --- a/configs/stm3240g-eval/nettest/defconfig +++ b/configs/stm3240g-eval/nettest/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig index 99c8ece468a..69e8ebd5418 100644 --- a/configs/stm3240g-eval/nsh/defconfig +++ b/configs/stm3240g-eval/nsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nsh2/defconfig b/configs/stm3240g-eval/nsh2/defconfig index 1c35e4babb5..2e5939c0272 100644 --- a/configs/stm3240g-eval/nsh2/defconfig +++ b/configs/stm3240g-eval/nsh2/defconfig @@ -329,7 +329,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nxterm/defconfig b/configs/stm3240g-eval/nxterm/defconfig index 411476cbd63..f70e9e86d14 100644 --- a/configs/stm3240g-eval/nxterm/defconfig +++ b/configs/stm3240g-eval/nxterm/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index 467fd105a97..e08a81d10c0 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/telnetd/defconfig b/configs/stm3240g-eval/telnetd/defconfig index a6e171b9e2e..8d58341d607 100644 --- a/configs/stm3240g-eval/telnetd/defconfig +++ b/configs/stm3240g-eval/telnetd/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/webserver/defconfig b/configs/stm3240g-eval/webserver/defconfig index 8d4e93adb5e..3bd0139d135 100644 --- a/configs/stm3240g-eval/webserver/defconfig +++ b/configs/stm3240g-eval/webserver/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm3240g-eval/xmlrpc/defconfig b/configs/stm3240g-eval/xmlrpc/defconfig index 63ce7679db3..163859adb83 100644 --- a/configs/stm3240g-eval/xmlrpc/defconfig +++ b/configs/stm3240g-eval/xmlrpc/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32_tiny/nsh/defconfig b/configs/stm32_tiny/nsh/defconfig index d1aacaf7101..b94d3da9400 100644 --- a/configs/stm32_tiny/nsh/defconfig +++ b/configs/stm32_tiny/nsh/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32_tiny/usbnsh/defconfig b/configs/stm32_tiny/usbnsh/defconfig index 3466aa3bf26..bb7587f8f60 100644 --- a/configs/stm32_tiny/usbnsh/defconfig +++ b/configs/stm32_tiny/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nsh/defconfig b/configs/stm32butterfly2/nsh/defconfig index 91f4d1c2e20..58d93b48e4b 100644 --- a/configs/stm32butterfly2/nsh/defconfig +++ b/configs/stm32butterfly2/nsh/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nshnet/defconfig b/configs/stm32butterfly2/nshnet/defconfig index a2d00553867..6ceb5d6a61b 100644 --- a/configs/stm32butterfly2/nshnet/defconfig +++ b/configs/stm32butterfly2/nshnet/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nshusbdev/defconfig b/configs/stm32butterfly2/nshusbdev/defconfig index f57578e7d07..f28a8b05c98 100644 --- a/configs/stm32butterfly2/nshusbdev/defconfig +++ b/configs/stm32butterfly2/nshusbdev/defconfig @@ -316,7 +316,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32butterfly2/nshusbhost/defconfig b/configs/stm32butterfly2/nshusbhost/defconfig index 91f4d1c2e20..58d93b48e4b 100644 --- a/configs/stm32butterfly2/nshusbhost/defconfig +++ b/configs/stm32butterfly2/nshusbhost/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/audio_tone/defconfig b/configs/stm32f103-minimum/audio_tone/defconfig index 2dd9628e9cf..28b47a49084 100644 --- a/configs/stm32f103-minimum/audio_tone/defconfig +++ b/configs/stm32f103-minimum/audio_tone/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/buttons/defconfig b/configs/stm32f103-minimum/buttons/defconfig index b6fa8ac7d1d..75d256b646a 100644 --- a/configs/stm32f103-minimum/buttons/defconfig +++ b/configs/stm32f103-minimum/buttons/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/jlx12864g/defconfig b/configs/stm32f103-minimum/jlx12864g/defconfig index d0e48894b20..92335c76bef 100644 --- a/configs/stm32f103-minimum/jlx12864g/defconfig +++ b/configs/stm32f103-minimum/jlx12864g/defconfig @@ -349,7 +349,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/mcp2515/defconfig b/configs/stm32f103-minimum/mcp2515/defconfig index 3298e2a8389..4a323859f6d 100644 --- a/configs/stm32f103-minimum/mcp2515/defconfig +++ b/configs/stm32f103-minimum/mcp2515/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f103-minimum/nrf24/defconfig b/configs/stm32f103-minimum/nrf24/defconfig index 38dff042fc8..b323b949075 100644 --- a/configs/stm32f103-minimum/nrf24/defconfig +++ b/configs/stm32f103-minimum/nrf24/defconfig @@ -345,7 +345,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/nsh/defconfig b/configs/stm32f103-minimum/nsh/defconfig index 4f443043936..cd62fe3c8f9 100644 --- a/configs/stm32f103-minimum/nsh/defconfig +++ b/configs/stm32f103-minimum/nsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/pwm/defconfig b/configs/stm32f103-minimum/pwm/defconfig index c9948199ad6..b674a7fa224 100644 --- a/configs/stm32f103-minimum/pwm/defconfig +++ b/configs/stm32f103-minimum/pwm/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/rfid-rc522/defconfig b/configs/stm32f103-minimum/rfid-rc522/defconfig index 7b3b9fdec14..634c594aaf2 100644 --- a/configs/stm32f103-minimum/rfid-rc522/defconfig +++ b/configs/stm32f103-minimum/rfid-rc522/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/rgbled/defconfig b/configs/stm32f103-minimum/rgbled/defconfig index 7f69a3fad9a..0ec152fb491 100644 --- a/configs/stm32f103-minimum/rgbled/defconfig +++ b/configs/stm32f103-minimum/rgbled/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/usbnsh/defconfig b/configs/stm32f103-minimum/usbnsh/defconfig index b7c50a79abb..9dae57fb224 100644 --- a/configs/stm32f103-minimum/usbnsh/defconfig +++ b/configs/stm32f103-minimum/usbnsh/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/userled/defconfig b/configs/stm32f103-minimum/userled/defconfig index 8a37b7e1aa4..27c1160864e 100644 --- a/configs/stm32f103-minimum/userled/defconfig +++ b/configs/stm32f103-minimum/userled/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f103-minimum/veml6070/defconfig b/configs/stm32f103-minimum/veml6070/defconfig index 1c6f89180b3..3b306cad2b9 100644 --- a/configs/stm32f103-minimum/veml6070/defconfig +++ b/configs/stm32f103-minimum/veml6070/defconfig @@ -313,7 +313,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f3discovery/nsh/defconfig b/configs/stm32f3discovery/nsh/defconfig index e21921d8971..d1593a1a1f9 100644 --- a/configs/stm32f3discovery/nsh/defconfig +++ b/configs/stm32f3discovery/nsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f3discovery/usbnsh/defconfig b/configs/stm32f3discovery/usbnsh/defconfig index 95c5ec9610f..ac0627e2f05 100644 --- a/configs/stm32f3discovery/usbnsh/defconfig +++ b/configs/stm32f3discovery/usbnsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_STM32F30XX=y CONFIG_STM32_STM32F303=y # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f411e-disco/nsh/defconfig b/configs/stm32f411e-disco/nsh/defconfig index bbab590c49d..f9360ee1f79 100644 --- a/configs/stm32f411e-disco/nsh/defconfig +++ b/configs/stm32f411e-disco/nsh/defconfig @@ -314,7 +314,7 @@ CONFIG_STM32_FLASH_CONFIG_E=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set CONFIG_STM32_STM32F411=y # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f429i-disco/extflash/defconfig b/configs/stm32f429i-disco/extflash/defconfig index bcdb618783c..80f7c558b37 100644 --- a/configs/stm32f429i-disco/extflash/defconfig +++ b/configs/stm32f429i-disco/extflash/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/lcd/defconfig b/configs/stm32f429i-disco/lcd/defconfig index 61efc4cfff9..9f5896da0da 100644 --- a/configs/stm32f429i-disco/lcd/defconfig +++ b/configs/stm32f429i-disco/lcd/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/ltdc/defconfig b/configs/stm32f429i-disco/ltdc/defconfig index 41a2e7d3963..31e248db635 100644 --- a/configs/stm32f429i-disco/ltdc/defconfig +++ b/configs/stm32f429i-disco/ltdc/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/nsh/defconfig b/configs/stm32f429i-disco/nsh/defconfig index e2a1170c5e8..d968905a62a 100644 --- a/configs/stm32f429i-disco/nsh/defconfig +++ b/configs/stm32f429i-disco/nsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/nxwm/defconfig b/configs/stm32f429i-disco/nxwm/defconfig index 13890fe6094..f1c567259c9 100644 --- a/configs/stm32f429i-disco/nxwm/defconfig +++ b/configs/stm32f429i-disco/nxwm/defconfig @@ -321,7 +321,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/usbmsc/defconfig b/configs/stm32f429i-disco/usbmsc/defconfig index 8025b772d46..2aba629180e 100644 --- a/configs/stm32f429i-disco/usbmsc/defconfig +++ b/configs/stm32f429i-disco/usbmsc/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f429i-disco/usbnsh/defconfig b/configs/stm32f429i-disco/usbnsh/defconfig index be48d861239..388b60a220d 100644 --- a/configs/stm32f429i-disco/usbnsh/defconfig +++ b/configs/stm32f429i-disco/usbnsh/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/README.txt b/configs/stm32f4discovery/README.txt index b748027d83e..6cc16183ee9 100644 --- a/configs/stm32f4discovery/README.txt +++ b/configs/stm32f4discovery/README.txt @@ -1349,7 +1349,8 @@ Where is one of the following: configuration other than using IPv6. So all of the notes above regarding the netnsh configuration apply. - a. Telnet does not work with IPv6. + a. Telnet does work with IPv6 but is not enabled in this + configuration (but could be). b. The network initialization thread was enabed in the netnsh configuration on 2015-09-28, but not in the ipv6 configuration. @@ -1382,9 +1383,14 @@ Where is one of the following: ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telent 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. I have used this configuration to serve up IP address prefixes in a local network with these modifications to the configuration: diff --git a/configs/stm32f4discovery/canard/defconfig b/configs/stm32f4discovery/canard/defconfig index b47022a351f..5a2dea55c65 100644 --- a/configs/stm32f4discovery/canard/defconfig +++ b/configs/stm32f4discovery/canard/defconfig @@ -325,7 +325,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/cxxtest/defconfig b/configs/stm32f4discovery/cxxtest/defconfig index 02cd0cbc2b2..099491714f1 100644 --- a/configs/stm32f4discovery/cxxtest/defconfig +++ b/configs/stm32f4discovery/cxxtest/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/elf/defconfig b/configs/stm32f4discovery/elf/defconfig index 8dea3c3a3c7..10dee697a30 100644 --- a/configs/stm32f4discovery/elf/defconfig +++ b/configs/stm32f4discovery/elf/defconfig @@ -325,7 +325,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/ipv6/defconfig b/configs/stm32f4discovery/ipv6/defconfig index bab7d7d7f7f..96a906767d4 100644 --- a/configs/stm32f4discovery/ipv6/defconfig +++ b/configs/stm32f4discovery/ipv6/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/kostest/defconfig b/configs/stm32f4discovery/kostest/defconfig index 8195826113b..34362cb295b 100644 --- a/configs/stm32f4discovery/kostest/defconfig +++ b/configs/stm32f4discovery/kostest/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/netnsh/defconfig b/configs/stm32f4discovery/netnsh/defconfig index c60861ec0b8..64055c7dbf9 100644 --- a/configs/stm32f4discovery/netnsh/defconfig +++ b/configs/stm32f4discovery/netnsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/nsh/defconfig b/configs/stm32f4discovery/nsh/defconfig index 3e3a60c3aa8..056e2463c03 100644 --- a/configs/stm32f4discovery/nsh/defconfig +++ b/configs/stm32f4discovery/nsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/nxlines/defconfig b/configs/stm32f4discovery/nxlines/defconfig index af2533a39e2..0d01a5084cf 100644 --- a/configs/stm32f4discovery/nxlines/defconfig +++ b/configs/stm32f4discovery/nxlines/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/pm/defconfig b/configs/stm32f4discovery/pm/defconfig index 7cfc253fa72..192db757606 100644 --- a/configs/stm32f4discovery/pm/defconfig +++ b/configs/stm32f4discovery/pm/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/posix_spawn/defconfig b/configs/stm32f4discovery/posix_spawn/defconfig index e1a7bf6754a..954c794c565 100644 --- a/configs/stm32f4discovery/posix_spawn/defconfig +++ b/configs/stm32f4discovery/posix_spawn/defconfig @@ -325,7 +325,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/pseudoterm/defconfig b/configs/stm32f4discovery/pseudoterm/defconfig index 7ef11b8d2c5..6eb552bf8a0 100644 --- a/configs/stm32f4discovery/pseudoterm/defconfig +++ b/configs/stm32f4discovery/pseudoterm/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/rgbled/defconfig b/configs/stm32f4discovery/rgbled/defconfig index 8135278af2b..9909f3eb7c0 100644 --- a/configs/stm32f4discovery/rgbled/defconfig +++ b/configs/stm32f4discovery/rgbled/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/uavcan/defconfig b/configs/stm32f4discovery/uavcan/defconfig index ed52310f8ad..7218e6f2442 100644 --- a/configs/stm32f4discovery/uavcan/defconfig +++ b/configs/stm32f4discovery/uavcan/defconfig @@ -319,7 +319,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/usbnsh/defconfig b/configs/stm32f4discovery/usbnsh/defconfig index 8528822d337..e29822f5475 100644 --- a/configs/stm32f4discovery/usbnsh/defconfig +++ b/configs/stm32f4discovery/usbnsh/defconfig @@ -330,7 +330,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32f4discovery/winbuild/defconfig b/configs/stm32f4discovery/winbuild/defconfig index 0deb8cd65b1..c5b4713c804 100644 --- a/configs/stm32f4discovery/winbuild/defconfig +++ b/configs/stm32f4discovery/winbuild/defconfig @@ -281,7 +281,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F207 is not set # CONFIG_STM32_STM32F30XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32f4discovery/xen1210/defconfig b/configs/stm32f4discovery/xen1210/defconfig index 161b69470a4..e997a0bbe54 100644 --- a/configs/stm32f4discovery/xen1210/defconfig +++ b/configs/stm32f4discovery/xen1210/defconfig @@ -320,7 +320,7 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -CONFIG_STM32_STM32F40XX=y +CONFIG_STM32_STM32F4XXX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F410 is not set # CONFIG_STM32_STM32F411 is not set diff --git a/configs/stm32ldiscovery/nsh/defconfig b/configs/stm32ldiscovery/nsh/defconfig index ccb8f423a40..bc9572faf4d 100644 --- a/configs/stm32ldiscovery/nsh/defconfig +++ b/configs/stm32ldiscovery/nsh/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_ENERGYLITE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/stm32vldiscovery/nsh/defconfig b/configs/stm32vldiscovery/nsh/defconfig index 36bda9b888b..e1eac671c78 100644 --- a/configs/stm32vldiscovery/nsh/defconfig +++ b/configs/stm32vldiscovery/nsh/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_VALUELINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/tm4c1294-launchpad/README.txt b/configs/tm4c1294-launchpad/README.txt index 1ed896c3e96..b45511d2cfc 100644 --- a/configs/tm4c1294-launchpad/README.txt +++ b/configs/tm4c1294-launchpad/README.txt @@ -112,7 +112,8 @@ Where is one of the following: configuration other than using IPv6. So all of the notes above regarding the nsh configuration apply. - Telnet does not work with IPv6. + Telnet does work with IPv6 but is not enabled in this + configuration (but could be). 2. This configuration can be modified to that both IPv4 and IPv6 are support. Here is a summary of the additional configuration @@ -143,9 +144,14 @@ Where is one of the following: ping6 fc00::2 (Linux) ping -6 fc00::2 (Windows cmd) - and Telnet again works from the host: + and Telnet is now enabled and works from the host... but only using + IPv6 addressing: - telnet 10.0.0.2 + telnet fc00::2 + + That is because the Telnet daemon will default to IPv6 and there is + no Telnet option to let you select which if both IPv4 and IPv6 are + enabled. 3. You can enable IPv6 autonomous address configuration with the following changes to the configuration: diff --git a/configs/viewtool-stm32f107/highpri/defconfig b/configs/viewtool-stm32f107/highpri/defconfig index 156787a1b4f..430c16fe3d9 100644 --- a/configs/viewtool-stm32f107/highpri/defconfig +++ b/configs/viewtool-stm32f107/highpri/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/viewtool-stm32f107/netnsh/defconfig b/configs/viewtool-stm32f107/netnsh/defconfig index 576facbb207..a94fd147b79 100644 --- a/configs/viewtool-stm32f107/netnsh/defconfig +++ b/configs/viewtool-stm32f107/netnsh/defconfig @@ -328,7 +328,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/configs/viewtool-stm32f107/nsh/defconfig b/configs/viewtool-stm32f107/nsh/defconfig index a84458179e8..bf19312856a 100644 --- a/configs/viewtool-stm32f107/nsh/defconfig +++ b/configs/viewtool-stm32f107/nsh/defconfig @@ -323,7 +323,7 @@ CONFIG_STM32_CONNECTIVITYLINE=y # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F33XX is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +# CONFIG_STM32_STM32F4XXX is not set # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set diff --git a/drivers/mmcsd/mmcsd_spi.c b/drivers/mmcsd/mmcsd_spi.c index 7bf4ecdee18..0ee84bb55b8 100644 --- a/drivers/mmcsd/mmcsd_spi.c +++ b/drivers/mmcsd/mmcsd_spi.c @@ -326,7 +326,9 @@ static const struct mmcsd_cmdinfo_s g_cmd0 = {CMD0, MMCSD_CMDRESP_R1, 0x95}; static const struct mmcsd_cmdinfo_s g_cmd1 = {CMD1, MMCSD_CMDRESP_R1, 0xff}; static const struct mmcsd_cmdinfo_s g_cmd8 = {CMD8, MMCSD_CMDRESP_R7, 0x87}; static const struct mmcsd_cmdinfo_s g_cmd9 = {CMD9, MMCSD_CMDRESP_R1, 0xff}; +#if 0 /* Not used */ static const struct mmcsd_cmdinfo_s g_cmd10 = {CMD10, MMCSD_CMDRESP_R1, 0xff}; +#endif static const struct mmcsd_cmdinfo_s g_cmd12 = {CMD12, MMCSD_CMDRESP_R1, 0xff}; static const struct mmcsd_cmdinfo_s g_cmd16 = {CMD16, MMCSD_CMDRESP_R1, 0xff}; static const struct mmcsd_cmdinfo_s g_cmd17 = {CMD17, MMCSD_CMDRESP_R1, 0xff}; diff --git a/drivers/net/tun.c b/drivers/net/tun.c index c9425d8c404..33fd566307a 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -684,7 +684,7 @@ static int tun_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Name: tun_txavail + * Name: tun_txavail_work * * Description: * Driver callback invoked when new TX data is available. This is a @@ -702,9 +702,9 @@ static int tun_ifdown(struct net_driver_s *dev) * ****************************************************************************/ -static int tun_txavail(struct net_driver_s *dev) +static void tun_txavail_work(FAR void *arg) { - FAR struct tun_device_s *priv = (FAR struct tun_device_s *)dev->d_private; + FAR struct tun_device_s *priv = (FAR struct tun_device_s *)arg; tun_lock(priv); @@ -713,11 +713,10 @@ static int tun_txavail(struct net_driver_s *dev) if (priv->read_d_len != 0 || priv->write_d_len != 0) { tun_unlock(priv); - return OK; + return; } net_lock(); - if (priv->bifup) { /* Poll the network for new XMIT data */ @@ -728,6 +727,37 @@ static int tun_txavail(struct net_driver_s *dev) net_unlock(); tun_unlock(priv); +} + +/**************************************************************************** + * Name: tun_txavail + * + * 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. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called from the network stack with the network locked. + * + ****************************************************************************/ + +static int tun_txavail(struct net_driver_s *dev) +{ + FAR struct tun_device_s *priv = (FAR struct tun_device_s *)dev->d_private; + + /* Schedule to perform the TX poll on the worker thread. */ + + if (work_available(&priv->work)) + { + work_queue(TUNWORK, &priv->work, tun_txavail_work, priv, 0); + } return OK; } @@ -1155,7 +1185,7 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR struct tun_device_s *priv = filep->f_priv; int ret = OK; - if (cmd == TUNSETIFF && !priv) + if (cmd == TUNSETIFF && priv == NULL) { uint8_t free_tuns; int intf; diff --git a/fs/driver/fs_blockproxy.c b/fs/driver/fs_blockproxy.c index b03aa4f95eb..d08f497f736 100644 --- a/fs/driver/fs_blockproxy.c +++ b/fs/driver/fs_blockproxy.c @@ -167,7 +167,6 @@ int block_proxy(FAR const char *blkdev, int oflags) int fd; DEBUGASSERT(blkdev); - DEBUGASSERT((oflags & (O_CREAT | O_EXCL | O_APPEND | O_TRUNC)) == 0); /* Create a unique temporary file name for the character device */ diff --git a/include/nuttx/net/icmpv6.h b/include/nuttx/net/icmpv6.h index e0e8ecba99c..c576b2da9d9 100644 --- a/include/nuttx/net/icmpv6.h +++ b/include/nuttx/net/icmpv6.h @@ -2,7 +2,7 @@ * include/nuttx/net/icmpv6.h * Header file for the NuttX ICMPv6 stack. * - * Copyright (C) 2007-2009, 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012, 2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This logic was leveraged from uIP which also has a BSD-style license: @@ -123,6 +123,13 @@ #define ICMPv6_PRFX_FLAG_L (1 << 7) /* On-link flag */ #define ICMPv6_PRFX_FLAG_A (1 << 6) /* Autonomous address-configuration flag +/* Return with size of an option (in full octects) using the size of a link + * layer address taking into account a header of the two-bytes. + */ + +#define ICMPv6_OPT_SIZE(a) (((a) + 2 + 7) & ~7) +#define ICMPv6_OPT_OCTECTS(a) (((a) + 2 + 7) >> 3) + /**************************************************************************** * Public Type Definitions ****************************************************************************/ @@ -178,11 +185,12 @@ struct icmpv6_neighbor_solicit_s uint8_t opttype; /* Option Type: ICMPv6_OPT_SRCLLADDR */ uint8_t optlen; /* Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET uint8_t srclladdr[6]; /* Options: Source link layer address */ -#endif }; +#define SIZEOF_ICMPV6_NEIGHBOR_SOLICIT_S(n) \ + (sizeof(struct icmpv6_neighbor_solicit_s) + ICMPv6_OPT_SIZE(n) - 8) + /* This the message format for the ICMPv6 Neighbor Advertisement message */ struct icmpv6_neighbor_advertise_s @@ -194,12 +202,14 @@ struct icmpv6_neighbor_advertise_s net_ipv6addr_t tgtaddr; /* Target IPv6 address */ uint8_t opttype; /* Option Type: ICMPv6_OPT_TGTLLADDR */ - uint8_t optlen; /* Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET + uint8_t optlen; /* Option length in octets */ uint8_t tgtlladdr[6]; /* Options: Target link layer address */ -#endif + /* Actual size detemined by optlen */ }; +#define SIZEOF_ICMPV6_NEIGHBOR_ADVERTISE_S(n) \ + (sizeof(struct icmpv6_neighbor_advertise_s) + ICMPv6_OPT_SIZE(n) - 8) + /* This the message format for the ICMPv6 Router Solicitation message */ struct icmpv6_router_solicit_s @@ -210,12 +220,13 @@ struct icmpv6_router_solicit_s uint8_t flags[4]; /* See ICMPv6_RADV_FLAG_ definitions (must be zero) */ uint8_t opttype; /* Option Type: ICMPv6_OPT_SRCLLADDR */ - uint8_t optlen; /* Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET + uint8_t optlen; /* Option length in octets */ uint8_t srclladdr[6]; /* Options: Source link layer address */ -#endif }; +#define SIZEOF_ICMPV6_ROUTER_SOLICIT_S(n) \ + (sizeof(struct icmpv6_router_solicit_s) + ICMPv6_OPT_SIZE(n) - 8) + /* This the message format for the ICMPv6 Router Advertisement message: * Options may include: ICMPv6_OPT_SRCLLADDR, ICMPv6_OPT_MTU, and/or * ICMPv6_OPT_PREFIX @@ -231,7 +242,7 @@ struct icmpv6_router_advertise_s uint16_t lifetime; /* Router lifetime */ uint16_t reachable[2]; /* Reachable time */ uint16_t retrans[2]; /* Retransmission timer */ - uint8_t options[1]; /* Options begin here */ + /* Options begin here */ }; #define ICMPv6_RADV_MINLEN (16) @@ -280,20 +291,20 @@ struct icmpv6_srclladdr_s { uint8_t opttype; /* Octet 1: Option Type: ICMPv6_OPT_SRCLLADDR */ uint8_t optlen; /* " " ": Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET uint8_t srclladdr[6]; /* " " ": Options: Source link layer address */ -#endif }; +#define SIZEOF_ICMPV6_SRCLLADDR_S(n) ICMPv6_OPT_SIZE(n) + struct icmpv6_tgrlladdr_s { uint8_t opttype; /* Octet 1: Option Type: ICMPv6_OPT_TGTLLADDR */ - uint8_t optlen; /* " " ": Option length: 1 octet */ -#ifdef CONFIG_NET_ETHERNET + uint8_t optlen; /* " " ": Option length in octets */ uint8_t tgtlladdr[6]; /* " " ": Options: Target link layer address */ -#endif }; +#define SIZEOF_ICMPV6_TGRLLADDR_S(n) ICMPv6_OPT_SIZE(n) + struct icmpv6_prefixinfo_s { uint8_t opttype; /* Octet 1: Option Type: ICMPv6_OPT_PREFIX */ diff --git a/include/nuttx/net/ioctl.h b/include/nuttx/net/ioctl.h index 69c513b489a..7debbf66c02 100644 --- a/include/nuttx/net/ioctl.h +++ b/include/nuttx/net/ioctl.h @@ -119,9 +119,13 @@ #define SIOCINQ _SIOC(0x0025) /* Returns the amount of queued unread * data in the receive */ +/* TUN/TAP driver ***********************************************************/ + +#define TUNSETIFF _SIOC(0x0026) /* Set TUN/TAP interface */ + /* Telnet driver ************************************************************/ -#define SIOCTELNET _SIOC(0x0026) /* Create a Telnet sessions. +#define SIOCTELNET _SIOC(0x0027) /* Create a Telnet sessions. * See include/nuttx/net/telnet.h */ /**************************************************************************** diff --git a/include/nuttx/net/netconfig.h b/include/nuttx/net/netconfig.h index 019fa663db7..202ae5e2acb 100644 --- a/include/nuttx/net/netconfig.h +++ b/include/nuttx/net/netconfig.h @@ -110,6 +110,12 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# ifndef CONFIG_NET_TUN_MTU +# define CONFIG_NET_TUN_MTU 296 +# endif +#endif + #ifdef CONFIG_NET_ETHERNET # ifndef CONFIG_NET_ETH_MTU # define CONFIG_NET_ETH_MTU 590 @@ -165,12 +171,20 @@ # define _MAX_SLIP_MTU _MAX_LO_MTU # endif -# ifdef CONFIG_NET_6LOWPAN -# define _MIN_6LOWPAN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_6LOWPAN_MTU) -# define _MAX_6LOWPAN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_6LOWPAN_MTU) +# ifdef CONFIG_NET_TUN +# define _MIN_TUN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_TUN_MTU) +# define _MAX_TUN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_TUN_MTU) # else -# define _MIN_6LOWPAN_MTU _MIN_SLIP_MTU -# define _MAX_6LOWPAN_MTU _MAX_SLIP_MTU +# define _MIN_TUN_MTU _MIN_SLIP_MTU +# define _MAX_TUN_MTU _MAX_SLIP_MTU +# endif + +# ifdef CONFIG_NET_6LOWPAN +# define _MIN_6LOWPAN_MTU MIN(_MIN_TUN_MTU,CONFIG_NET_6LOWPAN_MTU) +# define _MAX_6LOWPAN_MTU MAX(_MAX_TUN_MTU,CONFIG_NET_6LOWPAN_MTU) +# else +# define _MIN_6LOWPAN_MTU _MIN_TUN_MTU +# define _MAX_6LOWPAN_MTU _MAX_TUN_MTU # endif # define MIN_NET_DEV_MTU _MIN_6LOWPAN_MTU @@ -192,6 +206,14 @@ # define MIN_NET_DEV_MTU CONFIG_NET_SLIP_MTU # define MAX_NET_DEV_MTU CONFIG_NET_SLIP_MTU +#elif defined(CONFIG_NET_TUN) + /* There is no link layer header with TUN */ + +# define NET_LL_HDRLEN(d) 0 +# define NET_DEV_MTU(d) CONFIG_NET_TUN_MTU +# define MIN_NET_DEV_MTU CONFIG_NET_TUN_MTU +# define MAX_NET_DEV_MTU CONFIG_NET_TUN_MTU + #elif defined(CONFIG_NET_ETHERNET) /* Assume standard Ethernet link layer header */ @@ -215,10 +237,10 @@ # define MAX_NET_DEV_MTU NET_LO_MTU #elif defined(CONFIG_NET_6LOWPAN) - /* There is no link layer header with SLIP */ + /* There is no link layer header with 6LoWPAN */ # ifndef CONFIG_NET_IPv6 -# error 6LoWPAN requires IPv support +# error 6LoWPAN requires IP6v support # endif # define NET_LL_HDRLEN(d) 0 @@ -240,7 +262,7 @@ # define MIN_NET_DEV_MTU 0 # define MAX_NET_DEV_MTU 0 -#endif /* MULTILINK or SLIP or ETHERNET */ +#endif /* MULTILINK, SLIP, TUN, LOOPBACK, 6LoWOPAN, or ETHERNET */ /* Layer 3/4 Configuration Options ******************************************/ @@ -332,6 +354,14 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# define TUN_UDP_MSS(h) (CONFIG_NET_TUN_MTU - UDP_HDRLEN - (h)) +# ifndef CONFIG_NET_MULTILINK +# define __MIN_UDP_MSS(h) TUN_UDP_MSS(h) +# define __MAX_UDP_MSS(h) TUN_UDP_MSS(h) +# endif +#endif + #ifdef CONFIG_NET_MULTILINK # ifdef CONFIG_NET_ETHERNET # define __MIN_UDP_MSS(h) ETH_UDP_MSS(h) @@ -378,12 +408,25 @@ # define __SLIP_MIN_UDP_MSS(h) __LOOP_MIN_UDP_MSS(h) # define __SLIP_MAX_UDP_MSS(h) __LOOP_MAX_UDP_MSS(h) # endif + +# ifdef CONFIG_NET_TUN +# undef __MIN_UDP_MSS +# undef __MIN_UDP_MSS +# define __MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h)) +# define __MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h)) +# define __TUN_MIN_UDP_MSS(h) MIN(TUN_UDP_MSS(h),__SLIP_MIN_UDP_MSS(h)) +# define __TUN_MAX_UDP_MSS(h) MAX(TUN_UDP_MSS(h),__SLIP_MAX_UDP_MSS(h)) +# else +# define __TUN_MIN_UDP_MSS(h) __SLIP_MIN_UDP_MSS(h) +# define __TUN_MAX_UDP_MSS(h) __SLIP_MAX_UDP_MSS(h) +# endif #endif #ifdef CONFIG_NET_IPv4 # define UDP_IPv4_MSS(d) UDP_MSS(d,IPv4_HDRLEN) # define ETH_IPv4_UDP_MSS ETH_UDP_MSS(IPv4_HDRLEN) # define SLIP_IPv4_UDP_MSS SLIP_UDP_MSS(IPv4_HDRLEN) +# define TUN_IPv4_UDP_MSS TUN_UDP_MSS(IPv4_HDRLEN) # define MIN_IPv4_UDP_MSS __MIN_UDP_MSS(IPv4_HDRLEN) # define MIN_UDP_MSS __MIN_UDP_MSS(IPv4_HDRLEN) @@ -507,6 +550,14 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# define TUN_TCP_MSS(h) (CONFIG_NET_TUN_MTU - TCP_HDRLEN - (h)) +# ifndef CONFIG_NET_MULTILINK +# define __MIN_TCP_MSS(h) TUN_TCP_MSS(h) +# define __MAX_TCP_MSS(h) TUN_TCP_MSS(h) +# endif +#endif + #ifdef CONFIG_NET_MULTILINK # ifdef CONFIG_NET_ETHERNET @@ -539,7 +590,7 @@ # define __LOOP_MIN_TCP_MSS(h) MIN(LO_TCP_MSS(h),__6LOWPAN_MIN_TCP_MSS(h)) # define __LOOP_MAX_TCP_MSS(h) MAX(LO_TCP_MSS(h),__6LOWPAN_MAX_TCP_MSS(h)) # else -# define __LOOP_MIN_TCP_MSS(h) _6LOWPAN_MIN_TCP_MSS(h) +# define __LOOP_MIN_TCP_MSS(h) __6LOWPAN_MIN_TCP_MSS(h) # define __LOOP_MAX_TCP_MSS(h) __6LOWPAN_MAX_TCP_MSS(h) # endif @@ -554,6 +605,18 @@ # define __SLIP_MIN_TCP_MSS(h) __LOOP_MIN_TCP_MSS(h) # define __SLIP_MAX_TCP_MSS(h) __LOOP_MAX_TCP_MSS(h) # endif + +# ifdef CONFIG_NET_TUN +# undef __MIN_TCP_MSS +# undef __MAX_TCP_MSS +# define __MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h)) +# define __MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h)) +# define __TUN_MIN_TCP_MSS(h) MIN(TUN_TCP_MSS(h),__SLIP_MIN_TCP_MSS(h)) +# define __TUN_MAX_TCP_MSS(h) MAX(TUN_TCP_MSS(h),__SLIP_MAX_TCP_MSS(h)) +# else +# define __TUN_MIN_TCP_MSS(h) __SLIP_MIN_TCP_MSS(h) +# define __TUN_MAX_TCP_MSS(h) __SLIP_MAX_TCP_MSS(h) +# endif #endif /* If IPv4 is supported, it will have the larger MSS. @@ -564,6 +627,7 @@ # define TCP_IPv6_MSS(d) TCP_MSS(d,IPv6_HDRLEN) # define ETH_IPv6_TCP_MSS ETH_TCP_MSS(IPv6_HDRLEN) # define SLIP_IPv6_TCP_MSS SLIP_TCP_MSS(IPv6_HDRLEN) +# define TUN_IPv6_TCP_MSS TUN_TCP_MSS(IPv6_HDRLEN) # define MAX_TCP_MSS __MAX_TCP_MSS(IPv6_HDRLEN) #endif @@ -571,6 +635,7 @@ # define TCP_IPv4_MSS(d) TCP_MSS(d,IPv4_HDRLEN) # define ETH_IPv4_TCP_MSS ETH_TCP_MSS(IPv4_HDRLEN) # define SLIP_IPv4_TCP_MSS SLIP_TCP_MSS(IPv4_HDRLEN) +# define TUN_IPv4_TCP_MSS TUN_TCP_MSS(IPv4_HDRLEN) # define MIN_TCP_MSS __MIN_TCP_MSS(IPv4_HDRLEN) # undef MAX_TCP_MSS # define MAX_TCP_MSS __MAX_TCP_MSS(IPv4_HDRLEN) @@ -600,6 +665,12 @@ # endif #endif +#ifdef CONFIG_NET_TUN +# ifndef CONFIG_NET_TUN_TCP_RECVWNDO +# define CONFIG_NET_TUN_TCP_RECVWNDO TUN_TCP_MSS(0) +# endif +#endif + #ifdef CONFIG_NET_ETHERNET # ifndef CONFIG_NET_ETH_TCP_RECVWNDO # define CONFIG_NET_ETH_TCP_RECVWNDO ETH_TCP_MSS(0) @@ -615,7 +686,7 @@ # define NET_DEV_RCVWNDO(d) ((d)->d_recvwndo) #elif defined(CONFIG_NET_ETHERNET) - /* Only Ethernet.. use the configured SLIP receive window size */ + /* Only Ethernet.. use the configured Ethernet receive window size */ # define NET_DEV_RCVWNDO(d) CONFIG_NET_ETH_TCP_RECVWNDO @@ -629,12 +700,17 @@ # define NET_DEV_RCVWNDO(d) CONFIG_NET_SLIP_TCP_RECVWNDO +#elif defined(CONFIG_NET_TUN) + /* Only SLIP.. use the configured SLIP receive window size */ + +# define NET_DEV_RCVWNDO(d) CONFIG_NET_TUN_TCP_RECVWNDO + #else /* if defined(CONFIG_NET_LOOPBACK) */ /* Only loal loopback.. use the fixed loopback receive window size */ # define NET_DEV_RCVWNDO(d) NET_LO_TCP_RECVWNDO -#endif /* MULTILINK or SLIP or ETHERNET */ +#endif /* MULTILINK, ETHERNET, 6LoWPAN, SLIP, TUN, or LOOPBACK */ /* How long a connection should stay in the TIME_WAIT state. * diff --git a/include/nuttx/net/tun.h b/include/nuttx/net/tun.h index d8c4e68603d..1255c338511 100644 --- a/include/nuttx/net/tun.h +++ b/include/nuttx/net/tun.h @@ -52,8 +52,6 @@ * Pre-processor Definitions ****************************************************************************/ -#define TUNSETIFF _SIOC(0x1001) - /* TUNSETIFF ifr flags */ #define IFF_TUN 0x01 @@ -85,12 +83,12 @@ extern "C" * Name: tun_initialize * * Description: - * Instantiate a SLIP network interface. + * Instantiate a TUN network interface. * * Parameters: * * Returned Value: - * OK on success; Negated errno on failure. + * OK on success; Negated errno value on failure. * * Assumptions: * diff --git a/net/Kconfig b/net/Kconfig index 6a1ce6ab111..b7f3531bc92 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -284,37 +284,7 @@ menuconfig NET_IPv6 source "net/neighbor/Kconfig" source "net/sixlowpan/Kconfig" - -config NET_IPFORWARD - bool "Enable L2 forwarding" - default n - depends on NET_IPv6 - ---help--- - Enable forwarding of IPv6 packets. Packets received with IPv6 - addresses which are not supported by this platform will be forwarded - to the appropriate network device. Routing table support may be - required. - - NOTE: L2 forwarding only supported for IPv6. There is no technical - reason why IPv4 forwarding has not been implemented, it just has - not yet been done. - -config NET_IPFORWARD_NSTRUCT - int "Number of pre-allocated forwarding structures" - default 4 - depends on NET_IPFORWARD && CONFIG_NETDEV_MULTINIC - ---help--- - When packets are forward from on device to another, a structure must - be allocated to hold the state of forwarding across several - asynchronous events. Those structures are pre-allocated for - minimal, deterministic performance and to prevent hogging of memory - (of course, that means that this value must be carefully selected - for your application). This setting defines the number of such pre- - allocated structures. - - NOTE: This setting effectively puts a maximum on the number of - packets that may be waiting to be forwarded from one network device - to another. +source "net/ipforward/Kconfig" endmenu # Internet Protocol Selection diff --git a/net/Makefile b/net/Makefile index 25105b0c224..05dff875f5a 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1,7 +1,7 @@ ############################################################################ # net/Makefile # -# Copyright (C) 2007, 2008, 2011-2016 Gregory Nutt. All rights reserved. +# Copyright (C) 2007, 2008, 2011-2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -68,6 +68,7 @@ include tcp/Make.defs include udp/Make.defs include sixlowpan/Make.defs include devif/Make.defs +include ipforward/Make.defs include loopback/Make.defs include route/Make.defs include procfs/Make.defs diff --git a/net/README.txt b/net/README.txt index beda5229590..683f93bebbf 100644 --- a/net/README.txt +++ b/net/README.txt @@ -8,21 +8,22 @@ Directory Structure | `- net/ | - +- arp - Address resolution protocol (IPv4) - +- devif - Stack/device interface layer - +- icmp - Internet Control Message Protocol (IPv4) - +- icmpv6 - Internet Control Message Protocol (IPv6) - +- local - Unix domain (local) sockets - +- loopback - Local loopback - +- neighbor - Neighbor Discovery Protocol (IPv6) - +- netdev - Socket network device interface - +- pkt - "Raw" packet socket support - +- socket - BSD socket interface - +- route - Routing table support - +- tcp - Transmission Control Protocol - +- udp - User Datagram Protocol - +- usrsock - User socket API for user-space networking stack - `- utils - Miscellaneous utility functions + +- arp - Address resolution protocol (IPv4) + +- devif - Stack/device interface layer + +- icmp - Internet Control Message Protocol (IPv4) + +- icmpv6 - Internet Control Message Protocol (IPv6) + +- ipforward - IP forwarding logic + +- local - Unix domain (local) sockets + +- loopback - Local loopback + +- neighbor - Neighbor Discovery Protocol (IPv6) + +- netdev - Socket network device interface + +- pkt - "Raw" packet socket support + +- socket - BSD socket interface + +- route - Routing table support + +- tcp - Transmission Control Protocol + +- udp - User Datagram Protocol + +- usrsock - User socket API for user-space networking stack + `- utils - Miscellaneous utility functions +-------------------------------------------------------------------++------------------------+ diff --git a/net/devif/Make.defs b/net/devif/Make.defs index 4dcce7379b6..22d2ad05ab2 100644 --- a/net/devif/Make.defs +++ b/net/devif/Make.defs @@ -46,14 +46,13 @@ endif ifeq ($(CONFIG_NET_IPv6),y) NET_CSRCS += ipv6_input.c -ifeq ($(CONFIG_NET_IPFORWARD),y) -NET_CSRCS += ipv6_forward.c -endif endif +# IP forwarding + ifeq ($(CONFIG_NET_IPFORWARD),y) ifeq ($(CONFIG_NETDEV_MULTINIC),y) -NET_CSRCS += ip_forward.c devif_forward.c +NET_CSRCS += devif_forward.c endif endif diff --git a/net/devif/devif.h b/net/devif/devif.h index 78fcce32e59..99b389c9b1d 100644 --- a/net/devif/devif.h +++ b/net/devif/devif.h @@ -171,12 +171,14 @@ #define UDP_NEWDATA TCP_NEWDATA #define PKT_NEWDATA TCP_NEWDATA #define WPAN_NEWDATA TCP_NEWDATA +#define IPFWD_NEWDATA TCP_NEWDATA #define TCP_SNDACK (1 << 2) #define TCP_REXMIT (1 << 3) #define TCP_POLL (1 << 4) #define UDP_POLL TCP_POLL #define PKT_POLL TCP_POLL #define WPAN_POLL TCP_POLL +#define IPFWD_POLL TCP_POLL #define TCP_BACKLOG (1 << 5) #define TCP_CLOSE (1 << 6) #define TCP_ABORT (1 << 7) @@ -425,33 +427,6 @@ uint16_t devif_conn_event(FAR struct net_driver_s *dev, FAR void *pvconn, uint16_t devif_dev_event(FAR struct net_driver_s *dev, void *pvconn, uint16_t flags); -/**************************************************************************** - * Name: ipv6_forward - * - * Description: - * This function is called from ipv6_input when a packet is received that - * is not destined for us. In this case, the packet may need to be - * forwarded to another device (or sent back out the same device) - * depending configuration, routing table information, and the IPv6 - * networks served by various network devices. - * - * Input Parameters: - * dev - The device on which the packet was received and which contains - * the IPv6 packet. - * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 - * packet - * - * Returned Value: - * Zero is returned if the packet was successfully forward; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller (ipv6_input()) should drop the packet. - * - ****************************************************************************/ - -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6) -int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6); -#endif - /**************************************************************************** * Send data on the current connection. * diff --git a/net/devif/devif_forward.c b/net/devif/devif_forward.c index 87e4ad07e58..4f93ee3cbbb 100644 --- a/net/devif/devif_forward.c +++ b/net/devif/devif_forward.c @@ -43,7 +43,7 @@ #include -#include "devif/ip_forward.h" +#include "ipforward/ipforward.h" #include "devif/devif.h" #if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC) @@ -75,28 +75,20 @@ void devif_forward(FAR struct forward_s *fwd) unsigned int offset; int ret; - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); offset = NET_LL_HDRLEN(fwd->f_dev); - /* Copy the saved L2 + L3 header */ + /* Copy the IOB chain that contains the L3L3 headers and any data payload */ - DEBUGASSERT(offset + fwd->f_hdrsize <= NET_DEV_MTU(fwd->f_dev)); - memcpy(&fwd->f_dev->d_buf[offset], &fwd->f_hdr, fwd->f_hdrsize); - offset += fwd->f_hdrsize; + DEBUGASSERT(offset + fwd->f_iob->io_pktlen <= NET_DEV_MTU(fwd->f_dev)); + ret = iob_copyout(&fwd->f_dev->d_buf[offset], fwd->f_iob, + fwd->f_iob->io_pktlen, 0); - /* Copy the IOB chain that contains the payload */ + DEBUGASSERT(ret == fwd->f_iob->io_pktlen); + offset += fwd->f_iob->io_pktlen; - if (fwd->f_iob != NULL && fwd->f_iob->io_pktlen > 0) - { - DEBUGASSERT(offset + fwd->f_iob->io_pktlen <= NET_DEV_MTU(fwd->f_dev)); - ret = iob_copyout(&fwd->f_dev->d_buf[offset], fwd->f_iob, - fwd->f_iob->io_pktlen, 0); - - DEBUGASSERT(ret == fwd->f_iob->io_pktlen); - offset += fwd->f_iob->io_pktlen; - } - - fwd->f_dev->d_sndlen = offset; + fwd->f_dev->d_sndlen = 0; + fwd->f_dev->d_len = offset; } #endif /* CONFIG_NET_IPFORWARD && CONFIG_NETDEV_MULTINIC */ diff --git a/net/devif/devif_initialize.c b/net/devif/devif_initialize.c index be858e59204..68ba121afbb 100644 --- a/net/devif/devif_initialize.c +++ b/net/devif/devif_initialize.c @@ -50,7 +50,6 @@ #include #include -#include "devif/ip_forward.h" #include "devif/devif.h" /**************************************************************************** @@ -168,11 +167,5 @@ void devif_initialize(void) /* Initialize callback support */ devif_callback_init(); - -#ifdef HAVE_FWDALLOC - /* Initialize IP forwarding support */ - - ip_forward_initialize(); -#endif } #endif /* CONFIG_NET */ diff --git a/net/devif/devif_poll.c b/net/devif/devif_poll.c index 08d6c99e8ae..73c5050f588 100644 --- a/net/devif/devif_poll.c +++ b/net/devif/devif_poll.c @@ -251,6 +251,28 @@ static inline int devif_poll_icmpv6(FAR struct net_driver_s *dev, } #endif /* CONFIG_NET_ICMPv6_PING || CONFIG_NET_ICMPv6_NEIGHBOR*/ +/**************************************************************************** + * Name: devif_poll_forward + * + * Description: + * Poll the device event to see if any task is waiting to forward a packet. + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD) || defined(CONFIG_NETDEV_MULTINIC) +static inline int devif_poll_forward(FAR struct net_driver_s *dev, + devif_poll_callback_t callback) +{ + /* Perform the ICMPv6 poll */ + + devif_dev_event(dev, NULL, IPFWD_POLL); + + /* Call back into the driver */ + + return callback(dev); +} +#endif /* CONFIG_NET_ICMPv6_PING || CONFIG_NET_ICMPv6_NEIGHBOR*/ + /**************************************************************************** * Name: devif_poll_igmp * @@ -506,6 +528,15 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback) bstop = devif_poll_icmpv6(dev, callback); } + if (!bstop) +#endif +#if defined(CONFIG_NET_IPFORWARD) || defined(CONFIG_NETDEV_MULTINIC) + { + /* Traverse all of the tasks waiting to forward a packet to this device. */ + + bstop = devif_poll_forward(dev, callback); + } + if (!bstop) #endif { diff --git a/net/devif/ip_forward.h b/net/devif/ip_forward.h deleted file mode 100644 index c8cd65e4deb..00000000000 --- a/net/devif/ip_forward.h +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * net/devif/ip_forward.h - * - * 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. - * - ****************************************************************************/ - -#ifndef __NET_DEVIF_IP_FORWARD_H -#define __NET_DEVIF_IP_FORWARD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include -#include -#include -#include - -#include "udp/udp.h" -#include "tcp/tcp.h" -#include "icmpv6/icmpv6.h" - -#undef HAVE_FWDALLOC -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC) - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define HAVE_FWDALLOC 1 - -#ifndef CONFIG_NET_IPFORWARD_NSTRUCT -# define CONFIG_NET_IPFORWARD_NSTRUCT 4 -#endif - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/* IPv4 + L2 header */ - -#ifdef CONFIG_NET_IPv4 -struct fwd_ipv4hdr_u -{ - struct ipv4_hdr_s l2; - union - { -#ifdef CONFIG_NET_TCP - uint8_t pad[TCP_MAX_HDRLEN]; - struct tcp_hdr_s tcp; -#endif -#ifdef CONFIG_NET_UDP - struct udp_hdr_s udp; -#endif -#ifdef CONFIG_NET_ICMPv6 - struct icmp_hdr_s icmp; -#endif - } l3; -}; -#endif - -/* IPv6 + L2 header */ - -#ifdef CONFIG_NET_IPv6 -struct fwd_ipv6hdr_u -{ - struct ipv6_hdr_s l2; - union - { -#ifdef CONFIG_NET_TCP - uint8_t pad[TCP_MAX_HDRLEN]; - struct tcp_hdr_s tcp; -#endif -#ifdef CONFIG_NET_UDP - struct udp_hdr_s udp; -#endif -#ifdef CONFIG_NET_ICMPv6 - struct icmpv6_hdr_s icmpv6; -#endif - } l3; -}; -#endif - -/* IPv4 or IPv6 + L2 header */ - -union fwd_iphdr_u -{ -#ifdef CONFIG_NET_IPv4 - struct fwd_ipv4hdr_u ipv4; -#endif -#ifdef CONFIG_NET_IPv6 - struct fwd_ipv6hdr_u ipv6; -#endif -}; - -/* Connection structures */ - -union fwd_conn_u -{ -#ifdef CONFIG_NET_TCP - struct tcp_conn_s tcp; -#endif -#ifdef CONFIG_NET_UDP - struct udp_conn_s udp; -#endif -#ifdef CONFIG_NET_ICMPv6 - struct icmpv6_conn_s icmpv6; -#endif -}; - -/* This is the send state structure */ - -struct devif_callback_s; /* Forward refernce */ -struct net_driver_s; /* Forward reference */ -struct iob_s; /* Forward reference */ - -struct forward_s -{ - FAR struct forward_s *f_flink; /* Supports a singly linked list */ - FAR struct net_driver_s *f_dev; /* Forwarding device */ - FAR struct iob_s *f_iob; /* IOBs containing the data payload */ - FAR struct devif_callback_s *f_cb; /* Reference to callback instance */ - union fwd_iphdr_u f_hdr; /* Copy of original L2+L3 headers */ - union fwd_conn_u f_conn; /* Protocol-specific connectin struct */ - uint8_t f_hdrsize; /* The size of the L2+L3 headers */ -}; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: ip_forward_initialize - * - * Description: - * Initialize the struct forward_s allocator. - * - * Assumptions: - * Called early in system initialization. - * - ****************************************************************************/ - -void ip_forward_initialize(void); - -/**************************************************************************** - * Name: ip_forward_alloc - * - * Description: - * Allocate a forwarding structure by removing a pre-allocated entry from - * a free list. - * - * Assumptions: - * Caller holds the network lock. Mutually excluvive access to the free - * list is assured by this lock. - * - ****************************************************************************/ - -FAR struct forward_s *ip_forward_alloc(void); - -/**************************************************************************** - * Name: ip_forward_free - * - * Description: - * Free a forwarding structure by adding it to a free list. - * - * Assumptions: - * Caller holds the network lock. Mutually excluvive access to the free - * list is assured by this lock. - * - ****************************************************************************/ - -void ip_forward_free(FAR struct forward_s *fwd); - -/**************************************************************************** - * Name: devif_forward - * - * Description: - * Called from protocol-specific IP forwarding logic to re-send a packet. - * - * Input Parameters: - * fwd - An initialized instance of the common forwarding structure that - * includes everything needed to perform the forwarding operation. - * - * Returned Value: - * None - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -void devif_forward(FAR struct forward_s *fwd); - -#endif /* CONFIG_NET_IPFORWARD && CONFIG_NETDEV_MULTINIC */ -#endif /* __NET_DEVIF_IP_FORWARD_H */ diff --git a/net/devif/ipv4_input.c b/net/devif/ipv4_input.c index 2920aeba3b0..82acb0544a4 100644 --- a/net/devif/ipv4_input.c +++ b/net/devif/ipv4_input.c @@ -99,6 +99,7 @@ #include "icmp/icmp.h" #include "igmp/igmp.h" +#include "ipforward/ipforward.h" #include "devif/devif.h" /**************************************************************************** @@ -152,8 +153,8 @@ static uint8_t g_reassembly_flags; #if defined(CONFIG_NET_TCP_REASSEMBLY) && !defined(CONFIG_NET_IPv6) static uint8_t devif_reassembly(void) { - FAR struct ipv4_hdr_s *pbuf = BUF; - FAR struct ipv4_hdr_s *pfbuf = FBUF; + FAR struct ipv4_hdr_s *ipv4 = BUF; + FAR struct ipv4_hdr_s *fipv4 = FBUF; uint16_t offset; uint16_t len; uint16_t i; @@ -165,7 +166,7 @@ static uint8_t devif_reassembly(void) if (!g_reassembly_timer) { - memcpy(g_reassembly_buffer, &pbuf->vhl, IPv4_HDRLEN); + memcpy(g_reassembly_buffer, &ipv4->vhl, IPv4_HDRLEN); g_reassembly_timer = CONFIG_NET_TCP_REASS_MAXAGE; g_reassembly_flags = 0; @@ -179,12 +180,12 @@ static uint8_t devif_reassembly(void) * fragment into the buffer. */ - if (net_ipv4addr_hdrcmp(pbuf->srcipaddr, pfbuf->srcipaddr) && - net_ipv4addr_hdrcmp(pbuf->destipaddr, pfbuf->destipaddr) && - pbuf->g_ipid[0] == pfbuf->g_ipid[0] && pbuf->g_ipid[1] == pfbuf->g_ipid[1]) + if (net_ipv4addr_hdrcmp(ipv4->srcipaddr, fipv4->srcipaddr) && + net_ipv4addr_hdrcmp(ipv4->destipaddr, fipv4->destipaddr) && + ipv4->g_ipid[0] == fipv4->g_ipid[0] && ipv4->g_ipid[1] == fipv4->g_ipid[1]) { - len = (pbuf->len[0] << 8) + pbuf->len[1] - (pbuf->vhl & 0x0f) * 4; - offset = (((pbuf->ipoffset[0] & 0x3f) << 8) + pbuf->ipoffset[1]) * 8; + len = (ipv4->len[0] << 8) + ipv4->len[1] - (ipv4->vhl & 0x0f) * 4; + offset = (((ipv4->ipoffset[0] & 0x3f) << 8) + ipv4->ipoffset[1]) * 8; /* If the offset or the offset + fragment length overflows the * reassembly buffer, we discard the entire packet. @@ -198,7 +199,8 @@ static uint8_t devif_reassembly(void) /* Copy the fragment into the reassembly buffer, at the right offset. */ - memcpy(&g_reassembly_buffer[IPv4_HDRLEN + offset], (char *)pbuf + (int)((pbuf->vhl & 0x0f) * 4), len); + memcpy(&g_reassembly_buffer[IPv4_HDRLEN + offset], + (FAR char *)ipv4 + (int)((ipv4->vhl & 0x0f) * 4), len); /* Update the bitmap. */ @@ -235,7 +237,7 @@ static uint8_t devif_reassembly(void) * we have received the final fragment. */ - if ((pbuf->ipoffset[0] & IP_MF) == 0) + if ((ipv4->ipoffset[0] & IP_MF) == 0) { g_reassembly_flags |= TCP_REASS_LASTFRAG; g_reassembly_len = offset + len; @@ -271,22 +273,22 @@ static uint8_t devif_reassembly(void) } /* If we have come this far, we have a full packet in the buffer, - * so we allocate a pbuf and copy the packet into it. We also reset + * so we allocate a ipv4 and copy the packet into it. We also reset * the timer. */ g_reassembly_timer = 0; - memcpy(pbuf, pfbuf, g_reassembly_len); + memcpy(ipv4, fipv4, g_reassembly_len); /* Pretend to be a "normal" (i.e., not fragmented) IP packet from * now on. */ - pbuf->ipoffset[0] = pbuf->ipoffset[1] = 0; - pbuf->len[0] = g_reassembly_len >> 8; - pbuf->len[1] = g_reassembly_len & 0xff; - pbuf->ipchksum = 0; - pbuf->ipchksum = ~(ipv4_chksum(dev)); + ipv4->ipoffset[0] = ipv4->ipoffset[1] = 0; + ipv4->len[0] = g_reassembly_len >> 8; + ipv4->len[1] = g_reassembly_len & 0xff; + ipv4->ipchksum = 0; + ipv4->ipchksum = ~(ipv4_chksum(dev)); return g_reassembly_len; } @@ -316,7 +318,7 @@ nullreturn: int ipv4_input(FAR struct net_driver_s *dev) { - FAR struct ipv4_hdr_s *pbuf = BUF; + FAR struct ipv4_hdr_s *ipv4 = BUF; uint16_t hdrlen; uint16_t iplen; @@ -329,7 +331,7 @@ int ipv4_input(FAR struct net_driver_s *dev) /* Start of IP input header processing code. */ /* Check validity of the IP header. */ - if (pbuf->vhl != 0x45) + if (ipv4->vhl != 0x45) { /* IP version and header length. */ @@ -338,7 +340,7 @@ int ipv4_input(FAR struct net_driver_s *dev) g_netstats.ipv4.vhlerr++; #endif nwarn("WARNING: Invalid IP version or header length: %02x\n", - pbuf->vhl); + ipv4->vhl); goto drop; } @@ -360,7 +362,7 @@ int ipv4_input(FAR struct net_driver_s *dev) * we set d_len to the correct value. */ - iplen = (pbuf->len[0] << 8) + pbuf->len[1]; + iplen = (ipv4->len[0] << 8) + ipv4->len[1]; if (iplen <= dev->d_len) { dev->d_len = iplen; @@ -373,7 +375,7 @@ int ipv4_input(FAR struct net_driver_s *dev) /* Check the fragment flag. */ - if ((pbuf->ipoffset[0] & 0x3f) != 0 || pbuf->ipoffset[1] != 0) + if ((ipv4->ipoffset[0] & 0x3f) != 0 || ipv4->ipoffset[1] != 0) { #if defined(CONFIG_NET_TCP_REASSEMBLY) dev->d_len = devif_reassembly(); @@ -398,10 +400,15 @@ int ipv4_input(FAR struct net_driver_s *dev) * negotiating over DHCP for an address). */ - if (pbuf->proto == IP_PROTO_UDP && - net_ipv4addr_cmp(net_ip4addr_conv32(pbuf->destipaddr), + if (ipv4->proto == IP_PROTO_UDP && + net_ipv4addr_cmp(net_ip4addr_conv32(ipv4->destipaddr), INADDR_BROADCAST)) { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward broadcast packets */ + + ipv4_forward_broadcast(dev, ipv4); +#endif return udp_ipv4_input(dev); } @@ -416,23 +423,62 @@ int ipv4_input(FAR struct net_driver_s *dev) goto drop; } - /* Check if the packet is destined for out IP address */ + /* Check if the packet is destined for our IP address */ else #endif { /* Check if the packet is destined for our IP address. */ - if (!net_ipv4addr_cmp(net_ip4addr_conv32(pbuf->destipaddr), dev->d_ipaddr)) + if (!net_ipv4addr_cmp(net_ip4addr_conv32(ipv4->destipaddr), + dev->d_ipaddr)) { + /* Check for an IPv4 IGMP group address */ + #ifdef CONFIG_NET_IGMP - in_addr_t destip = net_ip4addr_conv32(pbuf->destipaddr); - if (igmp_grpfind(dev, &destip) == NULL) + in_addr_t destip = net_ip4addr_conv32(ipv4->destipaddr); + if (igmp_grpfind(dev, &destip) != NULL) + { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward multicast packets */ + + ipv4_forward_broadcast(dev, ipv4); +#endif + } + else #endif { -#ifdef CONFIG_NET_STATISTICS - g_netstats.ipv4.drop++; + /* No.. The packet is not destined for us. */ + +#ifdef CONFIG_NET_IPFORWARD + /* Try to forward the packet */ + + int ret = ipv4_forward(dev, ipv4); + if (ret >= 0) + { + /* The packet was forwarded. Return success; d_len will + * be set appropriately by the forwarding logic: Cleared + * if the packet is forward via anoother device or non- + * zero if it will be forwarded by the same device that + * it was received on. + */ + + return OK; + } + else #endif - goto drop; + { + /* Not destined for us and not forwardable... Drop the + * packet. + */ + + nwarn("WARNING: Not destined for us; not forwardable... " + "Dropping!\n"); + +#ifdef CONFIG_NET_STATISTICS + g_netstats.ipv4.drop++; +#endif + goto drop; + } } } } @@ -457,7 +503,7 @@ int ipv4_input(FAR struct net_driver_s *dev) /* Now process the incoming packet according to the protocol. */ - switch (pbuf->proto) + switch (ipv4->proto) { #ifdef NET_TCP_HAVE_STACK case IP_PROTO_TCP: /* TCP input */ diff --git a/net/devif/ipv6_input.c b/net/devif/ipv6_input.c index 4d656f37493..d8bb34b7933 100644 --- a/net/devif/ipv6_input.c +++ b/net/devif/ipv6_input.c @@ -100,6 +100,7 @@ #include "icmpv6/icmpv6.h" #include "netdev/netdev.h" +#include "ipforward/ipforward.h" #include "devif/devif.h" /**************************************************************************** @@ -183,6 +184,11 @@ static bool check_destipaddr(FAR struct net_driver_s *dev, if (ipv6->destipaddr[0] == HTONS(0xff02)) { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward multicast packets */ + + ipv6_forward_broadcast(dev, ipv6); +#endif return true; } @@ -322,6 +328,11 @@ int ipv6_input(FAR struct net_driver_s *dev) if (ipv6->proto == IP_PROTO_UDP && net_ipv6addr_cmp(ipv6->destipaddr, g_ipv6_alloneaddr)) { +#ifdef CONFIG_NET_IPFORWARD_BROADCAST + /* Forward broadcast packets */ + + ipv6_forward_broadcast(dev, ipv6); +#endif return udp_ipv6_input(dev); } diff --git a/net/icmpv6/Make.defs b/net/icmpv6/Make.defs index 92ac9cf2341..6c9b70aee7e 100644 --- a/net/icmpv6/Make.defs +++ b/net/icmpv6/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # net/icmpv6/Make.defs # -# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -63,14 +63,6 @@ ifeq ($(CONFIG_NET_ICMPv6_ROUTER),y) NET_CSRCS += icmpv6_radvertise.c endif -# IP forwarding - -ifeq ($(CONFIG_NET_IPFORWARD),y) -ifeq ($(CONFIG_NETDEV_MULTINIC),y) -NET_CSRCS += icmpv6_forward.c -endif -endif - # Include ICMPv6 build support DEPPATH += --dep-path icmpv6 diff --git a/net/icmpv6/icmpv6.h b/net/icmpv6/icmpv6.h index 8ff15abaee2..d1150de6980 100644 --- a/net/icmpv6/icmpv6.h +++ b/net/icmpv6/icmpv6.h @@ -178,34 +178,6 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr); # define icmpv6_neighbor(i) (0) #endif -/**************************************************************************** - * Name: icmpv6_forward - * - * Description: - * Called by the IP forwarding logic when an ICMPv6 packet is received on - * one network device, but must be forwarded on another network device. - * - * Set up to forward the ICMPv6 packet on the specified device. The - * function will set up a send "interrupt" handler that will perform the - * actual send asynchronously and must return without waiting for the - * send to complete. - * - * Input Parameters: - * fwd - An initialized instance of the common forwarding structure that - * includes everything needed to perform the forwarding operation. - * - * Returned Value: - * Zero is returned if the packet was successfully forwarded; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller should free the IOB list and drop the packet. - * - ****************************************************************************/ - -#if defined(CONFIG_NETDEV_MULTINIC) && defined(CONFIG_NET_IPFORWARD) -struct forward_s; -int icmpv6_forward(FAR struct forward_s *fwd); -#endif - /**************************************************************************** * Name: icmpv6_poll * diff --git a/net/icmpv6/icmpv6_advertise.c b/net/icmpv6/icmpv6_advertise.c index 621b8d6c146..3540720b752 100644 --- a/net/icmpv6/icmpv6_advertise.c +++ b/net/icmpv6/icmpv6_advertise.c @@ -2,7 +2,7 @@ * net/icmpv6/icmpv6_advertise.c * Send an ICMPv6 Neighbor Advertisement * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Adapted for NuttX from logic in uIP which also has a BSD-like license: @@ -54,6 +54,7 @@ #include #include +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" @@ -63,8 +64,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6ADVERTISE \ ((struct icmpv6_neighbor_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) @@ -94,27 +95,31 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, const net_ipv6addr_t destipaddr) { - FAR struct icmpv6_iphdr_s *icmp = ICMPv6BUF; + FAR struct ipv6_hdr_s *ipv6 = IPv6BUF; FAR struct icmpv6_neighbor_advertise_s *adv; + uint16_t lladdrsize; + uint16_t l3size; /* Set up the IPv6 header */ - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_neighbor_advertise_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_neighbor_advertise_s) & 0xff); + lladdrsize = netdev_dev_lladdrsize(dev); + l3size = SIZEOF_ICMPV6_NEIGHBOR_ADVERTISE_S(lladdrsize); + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Swap source for destination IP address, add our source IP address */ - net_ipv6addr_copy(icmp->destipaddr, destipaddr); - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->destipaddr, destipaddr); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Neighbor Advertise response */ @@ -132,23 +137,23 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, /* Set up the options */ - adv->opttype = ICMPv6_OPT_TGTLLADDR; /* Option type */ - adv->optlen = 1; /* Option length = 1 octet */ + adv->opttype = ICMPv6_OPT_TGTLLADDR; /* Option type */ + adv->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(adv->tgtlladdr, &dev->d_mac.ether, IFHWADDRLEN); + memcpy(adv->tgtlladdr, &dev->d_mac, lladdrsize); /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + adv->chksum = 0; + adv->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_neighbor_advertise_s); + dev->d_len = IPv6_HDRLEN + l3size; #ifdef CONFIG_NET_ETHERNET /* Add the size of the Ethernet header */ @@ -181,7 +186,7 @@ void icmpv6_advertise(FAR struct net_driver_s *dev, IFF_SET_NOARP(dev->d_flags); ninfo("Outgoing ICMPv6 Neighbor Advertise length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/icmpv6/icmpv6_forward.c b/net/icmpv6/icmpv6_forward.c deleted file mode 100644 index ea5ba544c19..00000000000 --- a/net/icmpv6/icmpv6_forward.c +++ /dev/null @@ -1,322 +0,0 @@ -/**************************************************************************** - * net/icmpv6/icmpv6_forward.c - * - * 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. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 - -#include "devif/ip_forward.h" -#include "devif/devif.h" -#include "netdev/netdev.h" -#include "icmpv6/icmpv6.h" - -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_ICMPv6) && \ - defined(CONFIG_NETDEV_MULTINIC) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: icmpv6_forward_addrchck - * - * Description: - * Check if the destination IP address is in the IPv4 ARP or IPv6 Neighbor - * tables. If not, then the send won't actually make it out... it will be - * replaced with an ARP request (IPv4) or a Neighbor Solicitation (IPv6). - * - * NOTE 1: This could be an expensive check if there are a lot of - * entries in the ARP or Neighbor tables. - * - * NOTE 2: If we are actually harvesting IP addresses on incoming IP - * packets, then this check should not be necessary; the MAC mapping - * should already be in the ARP table in many cases (IPv4 only). - * - * NOTE 3: If CONFIG_NET_ARP_SEND then we can be assured that the IP - * address mapping is already in the ARP table. - * - * Parameters: - * fwd - The forwarding state structure - * - * Returned Value: - * None - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_ETHERNET -static inline bool icmpv6_forward_addrchck(FAR struct forward_s *fwd) -{ -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if (conn->domain == PF_INET) -#endif - { -#if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) - return (arp_find(fwd->f_hdr.ipv4.l2.destipaddr) != NULL); -#else - return true; -#endif - } -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { -#if !defined(CONFIG_NET_ICMPv6_NEIGHBOR) - return (neighbor_findentry(fwd->f_hdr.ipv6.l2.destipaddr) != NULL); -#else - return true; -#endif - } -#endif /* CONFIG_NET_IPv6 */ -} - -#else /* CONFIG_NET_ETHERNET */ -# define icmpv6_forward_addrchck(r) (true) -#endif /* CONFIG_NET_ETHERNET */ - -/**************************************************************************** - * Name: icmpv6_dropstats - * - * Description: - * Update statistics for a dropped packet. - * - * Input Parameters: - * fwd - The forwarding state structure - * - * Returned Value: - * None - * - ****************************************************************************/ - -#ifdef CONFIG_NET_STATISTICS -static void icmpv6_dropstats(FAR struct forward_s *fwd) -{ - /* Increment the count of dropped ICMPV6 packets */ - - g_netstats.icmpv6.drop++; - - /* Increment the count of dropped IPv4 or IPv6 packets */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) -#endif - { - g_netstats.ipv4.drop++; - } -#endif -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { - g_netstats.ipv6.drop++; - } -#endif -} -#else -# define icmpv6_dropstats(ipv6) -#endif - -/**************************************************************************** - * Name: icmpv6_forward_interrupt - * - * Description: - * This function is called from the interrupt level to perform the actual - * send operation when polled by the lower, device interfacing layer. - * - * Parameters: - * dev The structure of the network driver that caused the interrupt - * conn An instance of the ICMPV6 connection structure cast to void * - * pvpriv An instance of struct forward_s cast to void* - * flags Set of events describing why the callback was invoked - * - * Returned Value: - * Modified value of the input flags - * - * Assumptions: - * The network is locked - * - ****************************************************************************/ - -static uint16_t icmpv6_forward_interrupt(FAR struct net_driver_s *dev, - FAR void *conn, FAR void *pvpriv, - uint16_t flags) -{ - FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; - - ninfo("flags: %04x\n", flags); - DEBUGASSERT(fwd != NULL); - - /* Make sure that this is from the forwarding device */ - - if (dev == fwd->f_dev) - { - /* If the network device has gone down, then we will have terminate - * the wait now with an error. - */ - - if ((flags & NETDEV_DOWN) != 0) - { - /* Terminate the transfer with an error. */ - - nwarn("WARNING: Network is down... Dropping\n"); - icmpv6_dropstats(fwd); - } - - /* Check if the outgoing packet is available. It may have been claimed - * by another send interrupt serving a different thread -OR- if the output - * buffer currently contains unprocessed incoming data. In these cases - * we will just have to wait for the next polling cycle. - */ - - else if (dev->d_sndlen > 0 || (flags & ICMPv6_NEWDATA) != 0) - { - /* Another thread has beat us sending data or the buffer is busy, - * Wait for the next polling cycle and check again. - */ - - return flags; - } - - /* It looks like we are good to forward the data */ - - else - { - /* Copy the ICMPv6 data into driver's packet buffer and send it. */ - - devif_forward(fwd); - - /* Check if the destination IP address is in the ARP or Neighbor - * table. If not, then the send won't actually make it out... it - * will be replaced with an ARP request or Neighbor Solicitation. - */ - - if (!icmpv6_forward_addrchck(fwd)) - { - return flags; - } - } - - /* Free the allocated callback structure */ - - fwd->f_cb->flags = 0; - fwd->f_cb->priv = NULL; - fwd->f_cb->event = NULL; - - icmpv6_callback_free(dev, fwd->f_cb); - - /* Free any IOBs */ - - if (fwd->f_iob != NULL) - { - iob_free_chain(fwd->f_iob); - } - - /* And release the forwarding state structure */ - - ip_forward_free(fwd); - } - - return flags; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: icmpv6_forward - * - * Description: - * Called by the IP forwarding logic when an ICMPV6 packet is received on - * one network device, but must be forwarded on another network device. - * - * Set up to forward the ICMPV6 packet on the specified device. This - * function will set up a send "interrupt" handler that will perform the - * actual send asynchronously and must return without waiting for the - * send to complete. - * - * Input Parameters: - * fwd - An initialized instance of the common forwarding structure that - * includes everything needed to perform the forwarding operation. - * - * Returned Value: - * Zero is returned if the packet was successfully forwarded; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller should free the IOB list and drop the packet. - * - ****************************************************************************/ - -int icmpv6_forward(FAR struct forward_s *fwd) -{ - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); - - /* Set up the callback in the connection */ - - fwd->f_cb = icmpv6_callback_alloc(fwd->f_dev); - if (fwd->f_cb != NULL) - { - fwd->f_cb->flags = (ICMPv6_POLL | NETDEV_DOWN); - fwd->f_cb->priv = (FAR void *)fwd; - fwd->f_cb->event = icmpv6_forward_interrupt; - - /* Notify the device driver of the availability of TX data */ - - netdev_txnotify_dev(fwd->f_dev); - return OK; - } - - return -EBUSY; -} - -#endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_ICMPv6 && CONFIG_NETDEV_MULTINIC */ diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c index 21f171fbf84..ab584c65afb 100644 --- a/net/icmpv6/icmpv6_input.c +++ b/net/icmpv6/icmpv6_input.c @@ -2,7 +2,7 @@ * net/icmpv6/icmpv6_input.c * Handling incoming ICMPv6 input * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Adapted for NuttX from logic in uIP which also has a BSD-like license: @@ -74,6 +74,14 @@ #define ICMPv6RADVERTISE \ ((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) +#if defined(CONFIG_NET_MULTILINK) +# define DEV_LLTYPE(d) ((d)->d_lltype) +#elif defined(CONFIG_NET_ETHERNET) +# define DEV_LLTYPE(d) NET_LL_ETHERNET +#elif defined(CONFIG_NET_6LOWPAN) +# define DEV_LLTYPE(d) NET_LL_IEEE802154 +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -167,8 +175,7 @@ void icmpv6_input(FAR struct net_driver_s *dev) { /* Save the sender's address mapping in our Neighbor Table. */ - neighbor_add(icmp->srcipaddr, - (FAR struct neighbor_addr_s *)adv->tgtlladdr); + neighbor_add(icmp->srcipaddr, DEV_LLTYPE(dev), adv->tgtlladdr); #ifdef CONFIG_NET_ICMPv6_NEIGHBOR /* Then notify any logic waiting for the Neighbor Advertisement */ diff --git a/net/icmpv6/icmpv6_radvertise.c b/net/icmpv6/icmpv6_radvertise.c index cec05c51a8b..5858c543b6e 100644 --- a/net/icmpv6/icmpv6_radvertise.c +++ b/net/icmpv6/icmpv6_radvertise.c @@ -53,45 +53,21 @@ #include #include +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" #ifdef CONFIG_NET_ICMPv6_ROUTER -/**************************************************************************** - * Private Types - ****************************************************************************/ -/* This is the same as struct icmpv6_router_advertise_s, but with the - * source address and prefix options included for simplicity. - */ - -struct icmpv6_radvertise_s -{ - uint8_t type; /* Message Type: ICMPV6_ROUTER_ADVERTISE */ - uint8_t code; /* Further qualifies the ICMP messages */ - uint16_t chksum; /* Checksum of ICMP header and data */ - uint8_t hoplimit; /* Current hop limit */ - uint8_t flags; /* See ICMPv6_RADV_FLAG_* definitions */ - uint16_t lifetime; /* Router lifetime */ - uint16_t reachable[2]; /* Reachable time */ - uint16_t retrans[2]; /* Retransmission timer */ - - /* Options */ - - struct icmpv6_srclladdr_s srcaddr; - struct icmpv6_mtu_s mtu; - struct icmpv6_prefixinfo_s prefix; -}; - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6ADVERTISE \ - ((struct icmpv6_radvertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) + ((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) /**************************************************************************** * Private Data @@ -133,30 +109,38 @@ static const net_ipv6addr_t g_ipv6_prefix = void icmpv6_radvertise(FAR struct net_driver_s *dev) { - FAR struct icmpv6_iphdr_s *icmp = ICMPv6BUF; - FAR struct icmpv6_radvertise_s *adv; + FAR struct ipv6_hdr_s *ipv6 = IPv6BUF; + FAR struct icmpv6_router_advertise_s *adv; FAR struct icmpv6_srclladdr_s *srcaddr; FAR struct icmpv6_mtu_s *mtu; FAR struct icmpv6_prefixinfo_s *prefix; + uint16_t lladdrsize; + uint16_t l3size; /* Set up the IPv6 header */ - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_radvertise_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_radvertise_s) & 0xff); + lladdrsize = netdev_dev_lladdrsize(dev); + l3size = sizeof(icmpv6_router_advertise_s) + + SIZEOF_ICMPV6_SRCLLADDR_S(lladdrsize) + + sizeof(struct icmpv6_mtu_s) + + sizeof(icmpv6_prefixinfo_s); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); + + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Swap source for destination IP address, add our source IP address */ - net_ipv6addr_copy(icmp->destipaddr, g_ipv6_allnodes); - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->destipaddr, g_ipv6_allnodes); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Router Advertise response */ @@ -173,13 +157,16 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Set up the source address option */ - srcaddr = &adv->srcaddr; + srcaddr = (FAR struct icmpv6_srclladdr_s *) + ((FAR uint8_t *)adv + sizeof(icmpv6_router_advertise_s)); srcaddr->opttype = ICMPv6_OPT_SRCLLADDR; - srcaddr->optlen = 1; - memcpy(srcaddr->srclladdr, &dev->d_mac.ether.ether_addr_octet, ETHER_ADDR_LEN); + srcaddr->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); + memcpy(srcaddr->srclladdr, &dev->d_mac, lladdrsize); /* Set up the MTU option */ + mtu = (FAR struct icmpv6_mtu_s *) + ((FAR uint8_t *)srcaddr + SIZEOF_ICMPV6_SRCLLADDR_S(lladdrsize)); mtu = &adv->mtu; mtu->opttype = ICMPv6_OPT_MTU; mtu->optlen = 1; @@ -189,6 +176,8 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Set up the prefix option */ + prefix = (FAR struct icmpv6_prefixinfo_s *) + ((FAR uint8_t *)mtu + sizeof(icmpv6_mtu_s)); prefix = &adv->prefix; prefix->opttype = ICMPv6_OPT_MTU; prefix->optlen = 4; @@ -205,12 +194,12 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + adv->chksum = 0; + adv->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_radvertise_s); + dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_router_advertise_s); #ifdef CONFIG_NET_ETHERNET /* Add the size of the Ethernet header */ @@ -243,7 +232,7 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) IFF_SET_NOARP(dev->d_flags); ninfo("Outgoing ICMPv6 Router Advertise length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/icmpv6/icmpv6_rsolicit.c b/net/icmpv6/icmpv6_rsolicit.c index 93a26314329..d2c754099cb 100644 --- a/net/icmpv6/icmpv6_rsolicit.c +++ b/net/icmpv6/icmpv6_rsolicit.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/icmpv6/icmpv6_rsolicit.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include "devif/devif.h" +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" @@ -56,8 +57,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6RSOLICIT \ ((struct icmpv6_router_solicit_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) @@ -89,34 +90,38 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) { - FAR struct icmpv6_iphdr_s *icmp; + FAR struct ipv6_hdr_s *ipv6; FAR struct icmpv6_router_solicit_s *sol; FAR struct eth_hdr_s *eth; + uint16_t lladdrsize; + uint16_t l3size; /* Set up the IPv6 header (most is probably already in place) */ - icmp = ICMPv6BUF; - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6 = IPv6BUF; + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_router_solicit_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_router_solicit_s) & 0xff); + lladdrsize = netdev_dev_lladdrsize(dev); + l3size = SIZEOF_ICMPV6_ROUTER_SOLICIT_S(lladdrsize); + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Set the multicast destination IP address to the IPv6 all link- * loocal routers address: ff02::2 */ - net_ipv6addr_copy(icmp->destipaddr, g_ipv6_allrouters); + net_ipv6addr_copy(ipv6->destipaddr, g_ipv6_allrouters); /* Add our link local IPv6 address as the source address */ - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Router Solicitation message */ @@ -130,23 +135,23 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Set up the options */ - sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ - sol->optlen = 1; /* Option length = 1 octet */ + sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ + sol->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(sol->srclladdr, dev->d_mac.ether.ether_addr_octet, sizeof(net_ipv6addr_t)); + memcpy(sol->srclladdr, &dev->d_mac, lladdrsize); /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + sol->chksum = 0; + sol->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_router_solicit_s); + dev->d_len = IPv6_HDRLEN + l3size; #ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_MULTILINK @@ -182,9 +187,10 @@ void icmpv6_rsolicit(FAR struct net_driver_s *dev) /* Add the size of the layer layer header to the total size of the * outgoing packet. */ + dev->d_len += netdev_ipv6_hdrlen(dev); ninfo("Outgoing ICMPv6 Router Solicitation length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/icmpv6/icmpv6_solicit.c b/net/icmpv6/icmpv6_solicit.c index 5eae392c522..c8e967cf483 100644 --- a/net/icmpv6/icmpv6_solicit.c +++ b/net/icmpv6/icmpv6_solicit.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/icmpv6/icmpv6_solicit.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ #include #include "devif/devif.h" +#include "netdev/netdev.h" #include "utils/utils.h" #include "icmpv6/icmpv6.h" @@ -57,8 +58,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ICMPv6BUF ((struct icmpv6_iphdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) +#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) +#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]) #define ICMPv6SOLICIT \ ((struct icmpv6_neighbor_solicit_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN]) @@ -100,34 +101,37 @@ static const uint16_t g_icmpv_mcastaddr[6] = void icmpv6_solicit(FAR struct net_driver_s *dev, FAR const net_ipv6addr_t ipaddr) { - FAR struct icmpv6_iphdr_s *icmp; + FAR struct ipv6_hdr_s *ipv6; FAR struct icmpv6_neighbor_solicit_s *sol; - FAR struct eth_hdr_s *eth; + uint16_t lladdrsize; + uint16_t l3size; /* Set up the IPv6 header (most is probably already in place) */ - icmp = ICMPv6BUF; - icmp->vtc = 0x60; /* Version/traffic class (MS) */ - icmp->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ - icmp->flow = 0; /* Flow label (LS) */ + ipv6 = IPv6BUF; + ipv6->vtc = 0x60; /* Version/traffic class (MS) */ + ipv6->tcf = 0; /* Traffic class (LS)/Flow label (MS) */ + ipv6->flow = 0; /* Flow label (LS) */ /* Length excludes the IPv6 header */ - icmp->len[0] = (sizeof(struct icmpv6_neighbor_solicit_s) >> 8); - icmp->len[1] = (sizeof(struct icmpv6_neighbor_solicit_s) & 0xff); + lladdrsize = netdev_dev_lladdrsize(dev); + l3size = SIZEOF_ICMPV6_NEIGHBOR_SOLICIT_S(lladdrsize); + ipv6->len[0] = (l3size >> 8); + ipv6->len[1] = (l3size & 0xff); - icmp->proto = IP_PROTO_ICMP6; /* Next header */ - icmp->ttl = 255; /* Hop limit */ + ipv6->proto = IP_PROTO_ICMP6; /* Next header */ + ipv6->ttl = 255; /* Hop limit */ /* Set the multicast destination IP address */ - memcpy(icmp->destipaddr, g_icmpv_mcastaddr, 6*sizeof(uint16_t)); - icmp->destipaddr[6] = ipaddr[6] | HTONS(0xff00); - icmp->destipaddr[7] = ipaddr[7]; + memcpy(ipv6->destipaddr, g_icmpv_mcastaddr, 6*sizeof(uint16_t)); + ipv6->destipaddr[6] = ipaddr[6] | HTONS(0xff00); + ipv6->destipaddr[7] = ipaddr[7]; /* Add out IPv6 address as the source address */ - net_ipv6addr_copy(icmp->srcipaddr, dev->d_ipv6addr); + net_ipv6addr_copy(ipv6->srcipaddr, dev->d_ipv6addr); /* Set up the ICMPv6 Neighbor Solicitation message */ @@ -145,29 +149,31 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Set up the options */ - sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ - sol->optlen = 1; /* Option length = 1 octet */ + sol->opttype = ICMPv6_OPT_SRCLLADDR; /* Option type */ + sol->optlen = ICMPv6_OPT_OCTECTS(lladdrsize); /* Option length in octets */ /* Copy our link layer address into the message * REVISIT: What if the link layer is not Ethernet? */ - memcpy(sol->srclladdr, &dev->d_mac.ether, IFHWADDRLEN); + memcpy(sol->srclladdr, &dev->d_mac, lladdrsize); /* Calculate the checksum over both the ICMP header and payload */ - icmp->chksum = 0; - icmp->chksum = ~icmpv6_chksum(dev); + sol->chksum = 0; + sol->chksum = ~icmpv6_chksum(dev); /* Set the size to the size of the IPv6 header and the payload size */ - dev->d_len = IPv6_HDRLEN + sizeof(struct icmpv6_neighbor_solicit_s); + dev->d_len = IPv6_HDRLEN + l3size; #ifdef CONFIG_NET_ETHERNET #ifdef CONFIG_NET_MULTILINK if (dev->d_lltype == NET_LL_ETHERNET) #endif { + FAR struct eth_hdr_s *eth; + /* Set the destination IPv6 multicast Ethernet address: * * For IPv6 multicast addresses, the Ethernet MAC is derived by @@ -210,9 +216,11 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Add the size of the layer layer header to the total size of the * outgoing packet. */ + dev->d_len += netdev_ipv6_hdrlen(dev); + ninfo("Outgoing ICMPv6 Neighbor Solicitation length: %d (%d)\n", - dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); + dev->d_len, (ipv6->len[0] << 8) | ipv6->len[1]); #ifdef CONFIG_NET_STATISTICS g_netstats.icmpv6.sent++; diff --git a/net/ipforward/Kconfig b/net/ipforward/Kconfig new file mode 100644 index 00000000000..2fc3ddbdc72 --- /dev/null +++ b/net/ipforward/Kconfig @@ -0,0 +1,39 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config NET_IPFORWARD + bool "Enable L2 forwarding" + default n + ---help--- + Enable forwarding of packets. Packets received with IP addresses + that are not supported by this platform will be forwarded to the + appropriate network device. Routing table support may be required. + +config NET_IPFORWARD_BROADCAST + bool "Forward broadcast/multicast packets" + default n + depends on NET_IPFORWARD && NETDEV_MULTINIC + ---help--- + If selected, broadcast packets received on one network device will + be forwarded though other network devices. + +config NET_IPFORWARD_NSTRUCT + int "Number of pre-allocated forwarding structures" + default 4 + depends on NET_IPFORWARD && NETDEV_MULTINIC + ---help--- + When packets are forwarded from on device to another, a structure + must be allocated to hold the state of forwarding across several + asynchronous events. Those structures are pre-allocated for + minimal, deterministic performance and to prevent hogging of memory + (of course, that means that this value must be carefully selected + for your application). This setting defines the number of such pre- + allocated structures. + + NOTE: This setting effectively puts a maximum on the number of + packets that may be waiting to be forwarded from one network device + to another. CONFIG_IOB_NBUFFERS also limits the forward because the + payload of the packet (up to the MSS) is retain in IOBs. + diff --git a/net/ipforward/Make.defs b/net/ipforward/Make.defs new file mode 100644 index 00000000000..cc46826da53 --- /dev/null +++ b/net/ipforward/Make.defs @@ -0,0 +1,63 @@ +############################################################################ +# net/ipforward/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. +# +############################################################################ + +# IP forwarding source files + +ifeq ($(CONFIG_NET_IPFORWARD),y) + +NET_CSRCS += ipfwd_forward.c + +ifeq ($(CONFIG_NET_IPv4),y) +NET_CSRCS += ipv4_forward.c +endif + +ifeq ($(CONFIG_NET_IPv6),y) +NET_CSRCS += ipv6_forward.c +endif + +ifeq ($(CONFIG_NETDEV_MULTINIC),y) +NET_CSRCS += ipfwd_alloc.c +endif + +ifeq ($(CONFIG_NET_STATISTICS),y) +NET_CSRCS += ipfwd_dropstats.c +endif + +# Include IP forwaring build support + +DEPPATH += --dep-path ipforward +VPATH += :ipforward + +endif diff --git a/net/ipforward/ipforward.h b/net/ipforward/ipforward.h new file mode 100644 index 00000000000..52069b80abe --- /dev/null +++ b/net/ipforward/ipforward.h @@ -0,0 +1,433 @@ +/**************************************************************************** + * net/ipforward/ipforward.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __NET_IPFORWARD_IPFORWARD_H +#define __NET_IPFORWARD_IPFORWARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include +#include +#include +#include + +#include "udp/udp.h" +#include "tcp/tcp.h" +#include "icmpv6/icmpv6.h" + +#undef HAVE_FWDALLOC +#ifdef CONFIG_NET_IPFORWARD + +/* Must of the logic in this header file applies only for configurations + * will multiple network devices. + */ + +#ifdef CONFIG_NETDEV_MULTINIC + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define HAVE_FWDALLOC 1 + +#ifndef CONFIG_NET_IPFORWARD_NSTRUCT +# define CONFIG_NET_IPFORWARD_NSTRUCT 4 +#endif + +#define FWD_HEADER(fwd) (FAR union fwd_iphdr_u *)((fwd)->f_iob->io_data) + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* IPv4 + L2 header */ + +#ifdef CONFIG_NET_IPv4 +struct fwd_ipv4hdr_u +{ + struct ipv4_hdr_s l2; + union + { +#ifdef CONFIG_NET_TCP + uint8_t pad[TCP_MAX_HDRLEN]; + struct tcp_hdr_s tcp; +#endif +#ifdef CONFIG_NET_UDP + struct udp_hdr_s udp; +#endif +#ifdef CONFIG_NET_ICMPv6 + struct icmp_hdr_s icmp; +#endif + } l3; +}; +#endif + +/* IPv6 + L2 header */ + +#ifdef CONFIG_NET_IPv6 +struct fwd_ipv6hdr_u +{ + struct ipv6_hdr_s l2; + union + { +#ifdef CONFIG_NET_TCP + uint8_t pad[TCP_MAX_HDRLEN]; + struct tcp_hdr_s tcp; +#endif +#ifdef CONFIG_NET_UDP + struct udp_hdr_s udp; +#endif +#ifdef CONFIG_NET_ICMPv6 + struct icmpv6_hdr_s icmpv6; +#endif + } l3; +}; +#endif + +/* IPv4 or IPv6 + L2 header */ + +union fwd_iphdr_u +{ +#ifdef CONFIG_NET_IPv4 + struct fwd_ipv4hdr_u ipv4; +#endif +#ifdef CONFIG_NET_IPv6 + struct fwd_ipv6hdr_u ipv6; +#endif +}; + +/* This is the send state structure */ + +struct devif_callback_s; /* Forward refernce */ +struct net_driver_s; /* Forward reference */ +struct iob_s; /* Forward reference */ + +struct forward_s +{ + FAR struct forward_s *f_flink; /* Supports a singly linked list */ + FAR struct net_driver_s *f_dev; /* Forwarding device */ + FAR struct iob_s *f_iob; /* IOB chain containing the packet */ + FAR struct devif_callback_s *f_cb; /* Reference to callback instance */ +#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) + uint8_t f_domain; /* Domain: PF_INET or PF_INET6 */ +#endif +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: ipfwd_initialize + * + * Description: + * Initialize the struct forward_s allocator. + * + * Assumptions: + * Called early in system initialization. + * + ****************************************************************************/ + +void ipfwd_initialize(void); + +/**************************************************************************** + * Name: ipfwd_alloc + * + * Description: + * Allocate a forwarding structure by removing a pre-allocated entry from + * a free list. + * + * Assumptions: + * Caller holds the network lock. Mutually excluvive access to the free + * list is assured by this lock. + * + ****************************************************************************/ + +FAR struct forward_s *ipfwd_alloc(void); + +/**************************************************************************** + * Name: ipfwd_free + * + * Description: + * Free a forwarding structure by adding it to a free list. + * + * Assumptions: + * Caller holds the network lock. Mutually excluvive access to the free + * list is assured by this lock. + * + ****************************************************************************/ + +void ipfwd_free(FAR struct forward_s *fwd); + +/**************************************************************************** + * Name: ipv4_forward_broadcast + * + * Description: + * This function is called from ipv4_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPFORWARD_BROADCAST +void ipv4_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv4_hdr_s *ipv4); +#endif + +/**************************************************************************** + * Name: ipv6_forward_broadcast + * + * Description: + * This function is called from ipv6_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv6_input. + * - ipv6 points to the IPv6 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPFORWARD_BROADCAST +void ipv6_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv6_hdr_s *ipv6); +#endif + +/**************************************************************************** + * Name: devif_forward + * + * Description: + * Called from protocol-specific IP forwarding logic to re-send a packet. + * + * Input Parameters: + * fwd - An initialized instance of the common forwarding structure that + * includes everything needed to perform the forwarding operation. + * + * Returned Value: + * None + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +void devif_forward(FAR struct forward_s *fwd); + +/**************************************************************************** + * Name: ipfwd_forward + * + * Description: + * Called by the IP forwarding logic when a packet is received on one + * network device, but must be forwarded on another network device. + * + * Set up to forward the packet on the specified device. This function + * will set up a send "interrupt" handler that will perform the actual + * send asynchronously and must return without waiting for the send to + * complete. + * + * Input Parameters: + * fwd - An initialized instance of the common forwarding structure that + * includes everything needed to perform the forwarding operation. + * + * Returned Value: + * Zero is returned if the packet was successfully forwarded; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller should free the IOB list and drop the packet. + * + ****************************************************************************/ + +int ipfwd_forward(FAR struct forward_s *fwd); + +#endif /* CONFIG_NETDEV_MULTINIC */ + +/**************************************************************************** + * Name: ipv4_forward + * + * Description: + * This function is called from ipv4_input when a packet is received that + * is not destined for us. In this case, the packet may need to be + * forwarded to another device (or sent back out the same device) + * depending configuration, routing table information, and the IPv4 + * networks served by various network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv4_input()) should drop the packet. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv4 +int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4); +#endif + +/**************************************************************************** + * Name: ipv6_forward + * + * Description: + * This function is called from ipv6_input when a packet is received that + * is not destined for us. In this case, the packet may need to be + * forwarded to another device (or sent back out the same device) + * depending configuration, routing table information, and the IPv6 + * networks served by various network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv6_input()) should drop the packet. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv6 +int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6); +#endif + +/**************************************************************************** + * Name: ipv6_dropstats + * + * Description: + * Update statistics for a dropped Ipv6 packet. + * + * Input Parameters: + * ipv6 - A pointer to the IPv6 header in within the IPv6 packet to be + * dropped. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if defined(CONFIG_NET_STATISTICS) && defined(CONFIG_NET_IPv6) +void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6); +#else +# define ipv6_dropstats(ipv6) +#endif + +/**************************************************************************** + * Name: ipv4_dropstats + * + * Description: + * Update statistics for a dropped Ipv4 packet. + * + * Input Parameters: + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet to be + * dropped. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if defined(CONFIG_NET_STATISTICS) && defined(CONFIG_NET_IPv4) +void ipv4_dropstats(FAR struct ipv4_hdr_s *ipv4); +#else +# define ipv4_dropstats(ipv4) +#endif + +/**************************************************************************** + * Name: ipfwd_dropstats + * + * Description: + * Update statistics for a dropped packet. + * + * Input Parameters: + * fwd - The forwarding state structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_STATISTICS +void ipfwd_dropstats(FAR struct forward_s *fwd) +#else +# define ipfwd_dropstats(fwd) +#endif + +#endif /* CONFIG_NET_IPFORWARD */ +#endif /* __NET_IPFORWARD_IPFORWARD_H */ diff --git a/net/devif/ip_forward.c b/net/ipforward/ipfwd_alloc.c similarity index 90% rename from net/devif/ip_forward.c rename to net/ipforward/ipfwd_alloc.c index a1a59e23f52..01e34099e47 100644 --- a/net/devif/ip_forward.c +++ b/net/ipforward/ipfwd_alloc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/devif/ip_forward.c + * net/ipforward/ipfwd_alloc.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -40,10 +40,11 @@ #include #include -#include +#include #include +#include -#include "devif/ip_forward.h" +#include "ipforward/ipforward.h" #if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC) @@ -64,7 +65,7 @@ static FAR struct forward_s *g_fwdfree; ****************************************************************************/ /**************************************************************************** - * Name: ip_forward_initialize + * Name: ipfwd_initialize * * Description: * Initialize the struct forward_s allocator. @@ -74,11 +75,17 @@ static FAR struct forward_s *g_fwdfree; * ****************************************************************************/ -void ip_forward_initialize(void) +void ipfwd_initialize(void) { FAR struct forward_s *fwd; int i; + /* The IOB size must be such that the maximum L2 and L3 headers fit into + * the contiguous memory of the first IOB in the IOB chain. + */ + + DEBUGASSERT(sizeof(union fwd_iphdr_u) <= CONFIG_IOB_BUFSIZE); + /* Add all pre-allocated forwarding structures to the free list */ g_fwdfree = NULL; @@ -92,7 +99,7 @@ void ip_forward_initialize(void) } /**************************************************************************** - * Name: ip_forward_alloc + * Name: ipfwd_alloc * * Description: * Allocate a forwarding structure by removing a pre-allocated entry from @@ -104,7 +111,7 @@ void ip_forward_initialize(void) * ****************************************************************************/ -FAR struct forward_s *ip_forward_alloc(void) +FAR struct forward_s *ipfwd_alloc(void) { FAR struct forward_s *fwd; @@ -119,7 +126,7 @@ FAR struct forward_s *ip_forward_alloc(void) } /**************************************************************************** - * Name: ip_forward_free + * Name: ipfwd_free * * Description: * Free a forwarding structure by adding it to a free list. @@ -130,7 +137,7 @@ FAR struct forward_s *ip_forward_alloc(void) * ****************************************************************************/ -void ip_forward_free(FAR struct forward_s *fwd) +void ipfwd_free(FAR struct forward_s *fwd) { fwd->f_flink = g_fwdfree; g_fwdfree = fwd; diff --git a/net/ipforward/ipfwd_dropstats.c b/net/ipforward/ipfwd_dropstats.c new file mode 100644 index 00000000000..d743b17916c --- /dev/null +++ b/net/ipforward/ipfwd_dropstats.c @@ -0,0 +1,192 @@ +/**************************************************************************** + * net/ipforward/ipfwd_dropstats.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include "ipforward/ipforward.h" + +#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_STATISTICS) + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: proto_dropstats + * + * Description: + * Update statistics for a dropped L2 protocol packet. + * + * Input Parameters: + * proto - The protocol from the IPv4 or IPv6 header. + * + * Returned Value: + * On success, zero (OK) is returned. Otherwise, a negated errno value + * is returned. The only error is if th protocol is not recognized. + * + ****************************************************************************/ + +static int proto_dropstats(int proto) +{ + switch (proto) + { +#ifdef CONFIG_NET_TCP + case IP_PROTO_TCP: + g_netstats.tcp.drop++; + break; +#endif + +#ifdef CONFIG_NET_UDP + case IP_PROTO_UDP: + g_netstats.udp.drop++; + break; +#endif + +#ifdef CONFIG_NET_ICMPv6 + case IP_PROTO_ICMP6: + g_netstats.icmpv6.drop++; + break; +#endif + + default: + retrun -EPROTONOSUPPORT; + } + + return OK; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ipv6_dropstats + * + * Description: + * Update statistics for a dropped Ipv6 packet. + * + * Input Parameters: + * ipv6 - A pointer to the IPv6 header in within the IPv6 packet to be + * dropped. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv6 +void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) +{ + int ret; + + ret = proto_dropstats(ipv6->proto); + if (ret < 0) + { + g_netstats.ipv6.protoerr++; + } + + g_netstats.ipv6.drop++; +} +#endif + +/**************************************************************************** + * Name: ipv4_dropstats + * + * Description: + * Update statistics for a dropped Ipv4 packet. + * + * Input Parameters: + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet to be + * dropped. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv4 +void ipv4_dropstats(FAR struct ipv4_hdr_s *ipv4) +{ + int ret; + + ret = proto_dropstats(ipv6->ipv4); + if (ret < 0) + { + g_netstats.ipv4.protoerr++; + } + + g_netstats.ipv4.drop++; +} +#endif + +/**************************************************************************** + * Name: ipfwd_dropstats + * + * Description: + * Update statistics for a dropped packet. + * + * Input Parameters: + * fwd - The forwarding state structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +void ipfwd_dropstats(FAR struct forward_s *fwd) +{ +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (fwd->domain == PF_INET) +#endif + { + ipv4_dropstats((FAR struct ipv4_hdr_s *)fwd->f_iob->io_data); + } +#endif +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + ipv6_dropstats((FAR struct ipv6_hdr_s *)fwd->f_iob->io_data); + } +#endif +} diff --git a/net/udp/udp_forward.c b/net/ipforward/ipfwd_forward.c similarity index 74% rename from net/udp/udp_forward.c rename to net/ipforward/ipfwd_forward.c index f264ec62bea..c7e1156b105 100644 --- a/net/udp/udp_forward.c +++ b/net/ipforward/ipfwd_forward.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/udp/udp_forward.c + * net/ipforward/ipfwd_forward.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,17 +44,18 @@ #include #include +#include #include #include #include -#include "devif/ip_forward.h" #include "devif/devif.h" #include "netdev/netdev.h" -#include "udp/udp.h" +#include "arp/arp.h" +#include "neighbor/neighbor.h" +#include "ipforward/ipforward.h" -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_UDP) && \ - defined(CONFIG_NETDEV_MULTINIC) +#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC) /**************************************************************************** * Public Functions @@ -83,21 +84,35 @@ #if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) static inline void forward_ipselect(FAR struct forward_s *fwd) { + FAR struct net_driver_s *dev = fwd->f_dev; + /* Select IPv4 or IPv6 */ - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) + if (fwd->f_domain == PF_INET) { - udp_ipv4_select(fwd->f_dev); + /* Clear a bit in the d_flags to distinguish this from an IPv6 packet */ + + IFF_SET_IPv4(dev->d_flags); + + /* Set the offset to the beginning of the UDP data payload */ + + dev->d_appdata = &dev->d_buf[IPv4UDP_HDRLEN + NET_LL_HDRLEN(dev)]; } else { - udp_ipv6_select(fwd->f_dev); + /* Set a bit in the d_flags to distinguish this from an IPv6 packet */ + + IFF_SET_IPv6(dev->d_flags); + + /* Set the offset to the beginning of the UDP data payload */ + + dev->d_appdata = &dev->d_buf[IPv6_HDRLEN + NET_LL_HDRLEN(dev)]; } } #endif /**************************************************************************** - * Name: udp_forward_addrchk + * Name: ipfwd_addrchk * * Description: * Check if the destination IP address is in the IPv4 ARP or IPv6 Neighbor @@ -118,7 +133,8 @@ static inline void forward_ipselect(FAR struct forward_s *fwd) * fwd - The forwarding state structure * * Returned Value: - * None + * true - The Ethernet MAC address is in the ARP or Neighbor table (OR + * the network device is not Ethernet). * * Assumptions: * The network is locked. @@ -126,15 +142,30 @@ static inline void forward_ipselect(FAR struct forward_s *fwd) ****************************************************************************/ #ifdef CONFIG_NET_ETHERNET -static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) +static inline bool ipfwd_addrchk(FAR struct forward_s *fwd) { + FAR union fwd_iphdr_u *iphdr; + + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); + + /* REVISIT: Could the MAC address not also be in a routing table? */ + +#ifdef CONFIG_NET_MULTILINK + if (fwd->f_dev->d_lltype != NET_LL_ETHERNET) + { + return true; + } +#endif + + iphdr = FWD_HEADER(fwd); + #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if (conn->domain == PF_INET) + if (fwd->f_domain == PF_INET) #endif { #if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) - return (arp_find(fwd->f_hdr.ipv4.l2.destipaddr) != NULL); + return (arp_find(iphdr->ipv4.l2.destipaddr) != NULL); #else return true; #endif @@ -147,7 +178,7 @@ static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) #endif { #if !defined(CONFIG_NET_ICMPv6_NEIGHBOR) - return (neighbor_findentry(fwd->f_hdr.ipv6.l2.destipaddr) != NULL); + return (neighbor_findentry(iphdr->ipv6.l2.destipaddr) != NULL); #else return true; #endif @@ -156,55 +187,11 @@ static inline bool udp_forward_addrchk(FAR struct forward_s *fwd) } #else /* CONFIG_NET_ETHERNET */ -# define udp_forward_addrchk(r) (true) +# define ipfwd_addrchk(r) (true) #endif /* CONFIG_NET_ETHERNET */ /**************************************************************************** - * Name: udp_dropstats - * - * Description: - * Update statistics for a dropped packet. - * - * Input Parameters: - * fwd - The forwarding state structure - * - * Returned Value: - * None - * - ****************************************************************************/ - -#ifdef CONFIG_NET_STATISTICS -static void udp_dropstats(FAR struct forward_s *fwd) -{ - /* Increment the count of dropped UDP packets */ - - g_netstats.udp.drop++; - - /* Increment the count of dropped IPv4 or IPv6 packets */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) -#endif - { - g_netstats.ipv4.drop++; - } -#endif -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { - g_netstats.ipv6.drop++; - } -#endif -} -#else -# define udp_dropstats(ipv6) -#endif - -/**************************************************************************** - * Name: udp_forward_interrupt + * Name: ipfwd_interrupt * * Description: * This function is called from the interrupt level to perform the actual @@ -212,7 +199,7 @@ static void udp_dropstats(FAR struct forward_s *fwd) * * Parameters: * dev The structure of the network driver that caused the interrupt - * conn An instance of the UDP connection structure cast to void * + * conn An instance of the forwarding structure cast to void * * pvpriv An instance of struct forward_s cast to void* * flags Set of events describing why the callback was invoked * @@ -224,14 +211,13 @@ static void udp_dropstats(FAR struct forward_s *fwd) * ****************************************************************************/ -static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, - FAR void *conn, FAR void *pvpriv, - uint16_t flags) +static uint16_t ipfwd_interrupt(FAR struct net_driver_s *dev, FAR void *conn, + FAR void *pvpriv, uint16_t flags) { FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; ninfo("flags: %04x\n", flags); - DEBUGASSERT(fwd != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Make sure that this is from the forwarding device */ @@ -246,7 +232,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, /* Terminate the transfer with an error. */ nwarn("WARNING: Network is down... Dropping\n"); - udp_dropstats(fwd); + ipfwd_dropstats(fwd); } /* Check if the outgoing packet is available. It may have been claimed @@ -255,7 +241,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, * we will just have to wait for the next polling cycle. */ - else if (dev->d_sndlen > 0 || (flags & UDP_NEWDATA) != 0) + else if (dev->d_sndlen > 0 || (flags & IPFWD_NEWDATA) != 0) { /* Another thread has beat us sending data or the buffer is busy, * Wait for the next polling cycle and check again. @@ -275,7 +261,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, * place and we need do nothing. */ - forward_ipselect(dev, fwd); + forward_ipselect(fwd); #endif /* Copy the user data into d_appdata and send it. */ @@ -286,7 +272,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, * will be replaced with an ARP request or Neighbor Solicitation. */ - if (!udp_forward_addrchk(fwd)) + if (!ipfwd_addrchk(fwd)) { return flags; } @@ -298,7 +284,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, fwd->f_cb->priv = NULL; fwd->f_cb->event = NULL; - udp_callback_free(dev, &fwd->f_conn.udp, fwd->f_cb); + devif_conn_callback_free(dev, fwd->f_cb, NULL); /* Free any IOBs */ @@ -309,7 +295,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, /* And release the forwarding state structure */ - ip_forward_free(fwd); + ipfwd_free(fwd); } return flags; @@ -320,16 +306,16 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, ****************************************************************************/ /**************************************************************************** - * Name: udp_forward + * Name: ipfwd_forward * * Description: - * Called by the IP forwarding logic when an UDP packet is received on - * one network device, but must be forwarded on another network device. + * Called by the IP forwarding logic when a packet is received on one + * network device, but must be forwarded on another network device. * - * Set up to forward the UDP packet on the specified device. This - * function will set up a send "interrupt" handler that will perform the - * actual send asynchronously and must return without waiting for the - * send to complete. + * Set up to forward the packet on the specified device. This function + * will set up a send "interrupt" handler that will perform the actual + * send asynchronously and must return without waiting for the send to + * complete. * * Input Parameters: * fwd - An initialized instance of the common forwarding structure that @@ -342,18 +328,18 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev, * ****************************************************************************/ -int udp_forward(FAR struct forward_s *fwd) +int ipfwd_forward(FAR struct forward_s *fwd) { - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); + DEBUGASSERT(fwd != NULL && fwd->f_iob != NULL && fwd->f_dev != NULL); /* Set up the callback in the connection */ - fwd->f_cb = udp_callback_alloc(fwd->f_dev, &fwd->f_conn.udp); + fwd->f_cb = devif_callback_alloc(fwd->f_dev, NULL); if (fwd->f_cb != NULL) { - fwd->f_cb->flags = (UDP_POLL | NETDEV_DOWN); + fwd->f_cb->flags = (IPFWD_POLL | NETDEV_DOWN); fwd->f_cb->priv = (FAR void *)fwd; - fwd->f_cb->event = udp_forward_interrupt; + fwd->f_cb->event = ipfwd_interrupt; /* Notify the device driver of the availability of TX data */ @@ -364,4 +350,4 @@ int udp_forward(FAR struct forward_s *fwd) return -EBUSY; } -#endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_UDP && CONFIG_NETDEV_MULTINIC */ +#endif /* CONFIG_NET_IPFORWARD && CONFIG_NETDEV_MULTINIC */ diff --git a/net/ipforward/ipv4_forward.c b/net/ipforward/ipv4_forward.c new file mode 100644 index 00000000000..2c1e5f8756a --- /dev/null +++ b/net/ipforward/ipv4_forward.c @@ -0,0 +1,559 @@ +/**************************************************************************** + * net/ipforward/ipv4_forward.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "netdev/netdev.h" +#include "utils/utils.h" +#include "sixlowpan/sixlowpan.h" +#include "ipforward/ipforward.h" +#include "devif/devif.h" + +#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv4) + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ipv4_hdrsize + * + * Description: + * Return the size of the IPv4 header and the following. + * + * Input Parameters: + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet. This + * is immeidately followed by the L3 header which may be TCP, UDP + * or ICMP. + * + * Returned Value: + * The size of the combined L2 + L3 headers is returned on success. An + * error is returned only if the prototype is not supported. + * + ****************************************************************************/ + +#if defined(CONFIG_NETDEV_MULTINIC) && defined(CONFIG_DEBUG_NET_WARN) +static int ipv4_hdrsize(FAR struct ipv4_hdr_s *ipv4) +{ + /* Size is determined by the following protocol header, */ + + switch (ipv4->proto) + { +#ifdef CONFIG_NET_TCP + case IP_PROTO_TCP: + { + FAR struct tcp_hdr_s *tcp = + (FAR struct tcp_hdr_s *)((FAR uint8_t *)ipv4 + IPv4_HDRLEN); + unsigned int tcpsize; + + /* The TCP header length is encoded in the top 4 bits of the + * tcpoffset field (in units of 32-bit words). + */ + + tcpsize = ((uint16_t)tcp->tcpoffset >> 4) << 2; + return IPv4_HDRLEN + tcpsize; + } + break; +#endif + +#ifdef CONFIG_NET_UDP + case IP_PROTO_UDP: + return IPv4_HDRLEN + UDP_HDRLEN; + break; +#endif + +#ifdef CONFIG_NET_ICMP + case IP_PROTO_ICMP: + return IPv4_HDRLEN + ICMP_HDRLEN; + break; +#endif + + default: + nwarn("WARNING: Unrecognized proto: %u\n", ipv4->proto); + return -EPROTONOSUPPORT; + } +} +#endif + +/**************************************************************************** + * Name: ipv4_decr_ttl + * + * Description: + * Decrement the IPv4 TTL (time to live value). TTL field is set by the + * sender of the packet and reduced by every router on the route to its + * destination. If the TTL field reaches zero before the datagram arrives + * at its destination, then the datagram is discarded and an ICMP error + * packet (11 - Time Exceeded) is sent back to the sender. + * + * The purpose of the TTL field is to avoid a situation in which an + * undeliverable datagram keeps circulating on an Internet system, and + * such a system eventually becoming swamped by such "immortals". + * + * Input Parameters: + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet to be + * forwarded. + * + * Returned Value: + * The new TTL value is returned. A value <= 0 means the hop limit has + * expired. + * + ****************************************************************************/ + +#ifdef CONFIG_NETDEV_MULTINIC +static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) +{ + uint16_t sum; + int ttl = (int)ipv4->ttl - 1; + + if (ttl <= 0) + { +#ifdef CONFIG_NET_ICMP + /* Return an ICMP error packet back to the sender. */ +# warning Missing logic +#endif + + /* Return zero which must cause the packet to be dropped */ + + return 0; + } + + /* Save the updated TTL value */ + + ipv4->ttl = ttl; + + /* Re-calculate the IPv4 checksum. This checksum is the Internet checksum + * of the 20 bytes of the IPv4 header. This checksum will be different + * because we just modify the IPv4 TTL. + */ + + ipv4->ipchksum = 0; + sum = chksum(0, (FAR const uint8_t *)ipv4, IPv4_HDRLEN); + if (sum == 0) + { + sum = 0xffff; + } + else + { + sum = htons(sum); + } + + ipv4->ipchksum = ~sum; + return ttl; +} +#endif + +/**************************************************************************** + * Name: ipv4_dev_forward + * + * Description: + * This function is called from ipv4_forward when it is necessary to + * forward a packet from the current device to different device. In this + * case, the forwarding operation must be performed asynchronously when + * the TX poll is received from the forwarding device. + * + * Input Parameters: + * dev - The device on which the packet was received and which + * contains the IPv4 packet. + * fwdddev - The device on which the packet must be forwarded. + * ipv4 - A pointer to the IPv4 header in within the IPv4 packet + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv4_input()) should drop the packet. + * + ****************************************************************************/ + +#ifdef CONFIG_NETDEV_MULTINIC +static int ipv4_dev_forward(FAR struct net_driver_s *dev, + FAR struct net_driver_s *fwddev, + FAR struct ipv4_hdr_s *ipv4) +{ + FAR struct forward_s *fwd = NULL; +#ifdef CONFIG_DEBUG_NET_WARN + int hdrsize; +#endif + int ret; + + /* Verify that the full packet will fit within the forwarding devices MTU. + * We provide no support for fragmenting forwarded packets. + */ + + if (NET_LL_HDRLEN(fwddev) + dev->d_len > NET_DEV_MTU(fwddev)) + { + nwarn("WARNING: Packet > MTU... Dropping\n"); + ret = -EFBIG; + goto errout; + } + + /* Get a pre-allocated forwarding structure, This structure will be + * completely zeroed when we receive it. + */ + + fwd = ipfwd_alloc(); + if (fwd == NULL) + { + nwarn("WARNING: Failed to allocate forwarding structure\n"); + ret = -ENOMEM; + goto errout; + } + + /* Initialize the easy stuff in the forwarding structure */ + + fwd->f_dev = fwddev; /* Forwarding device */ +#ifdef CONFIG_NET_IPv5 + fwd->f_domain = PF_INET; /* IPv64 address domain */ +#endif + +#ifdef CONFIG_DEBUG_NET_WARN + /* Get the size of the IPv4 + L3 header. */ + + hdrsize = ipv4_hdrsize(ipv4); + if (hdrsize < IPv4_HDRLEN) + { + nwarn("WARNING: Could not determine L2+L3 header size\n"); + ret = -EPROTONOSUPPORT; + goto errout_with_fwd; + } + + /* The L2/L3 headers must fit within one, contiguous IOB. */ + + if (hdrsize > CONFIG_IOB_BUFSIZE) + { + nwarn("WARNING: Header is too big for pre-allocated structure\n"); + ret = -E2BIG; + goto errout_with_fwd; + } +#endif + + /* Try to allocate the head of an IOB chain. If this fails, the + * packet will be dropped; we are not operating in a context + * where waiting for an IOB is a good idea + */ + + fwd->f_iob = iob_tryalloc(false); + if (fwd->f_iob == NULL) + { + nwarn("WARNING: iob_tryalloc() failed\n"); + ret = -ENOMEM; + goto errout_with_fwd; + } + + /* Copy the L2/L3 headers plus any following payload into an IOB chain. + * iob_trycopin() will not wait, but will fail there are no available + * IOBs. + * + * REVISIT: Consider an alternative design that does not require data + * copying. This would require a pool of d_buf's that are managed by + * the network rather than the network device. + */ + + ret = iob_trycopyin(fwd->f_iob, (FAR const uint8_t *)ipv4, + dev->d_len, 0, false); + if (ret < 0) + { + nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); + goto errout_with_iobchain; + } + + /* Decrement the TTL in the copy of the IPv4 header (retaining the + * original TTL in the source to handle the broadcast case). If the + * TLL decrements to zero, then do not forward the packet. + */ + + ret = ipv4_decr_ttl((FAR struct ipv4_hdr_s *)fwd->f_iob->io_data); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + goto errout_with_iobchain; + } + + /* Then set up to forward the packet according to the protocol. */ + + ret = ipfwd_forward(fwd); + if (ret >= 0) + { + dev->d_len = 0; + return OK; + } + +errout_with_iobchain: + if (fwd != NULL && fwd->f_iob != NULL) + { + iob_free_chain(fwd->f_iob); + } + +errout_with_fwd: + if (fwd != NULL) + { + ipfwd_free(fwd); + } + +errout: + return ret; +} +#endif /* CONFIG_NETDEV_MULTINIC */ + +/**************************************************************************** + * Name: ipv4_forward_callback + * + * Description: + * This function is a callback from netdev_foreach. It implements the + * the broadcase forwarding action for each network device (other than, of + * course, the device that received the packet). + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * Returned Value: + * Typically returns zero (meaning to continue the enumeration), but will + * return a non-zero to stop the enumeration if an error occurs. + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +int ipv4_forward_callback(FAR struct net_driver_s *fwddev, FAR void *arg) +{ + FAR struct net_driver_s *dev = (FAR struct net_driver_s *)arg; + FAR struct ipv4_hdr_s *ipv4; + int ret; + + DEBUGASSERT(fwddev != NULL && dev != NULL && dev->d_buf != NULL); + + /* Check if we are forwarding on the same device that we received the + * packet from. + */ + + if (fwddev != dev) + { + /* Recover the pointer to the IPv4 header in the receiving device's + * d_buf. + */ + + ipv4 = (FAR struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]; + + /* Send the packet asynchrously on the forwarding device. */ + + ret = ipv4_dev_forward(dev, fwddev, ipv4); + if (ret < 0) + { + nwarn("WARNING: ipv4_dev_forward failed: %d\n", ret); + return ret; + } + } + + return OK; +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ipv4_forward + * + * Description: + * This function is called from ipv4_input when a packet is received that + * is not destined for us. In this case, the packet may need to be + * forwarded to another device (or sent back out the same device) + * depending configuration, routing table information, and the IPv4 + * networks served by various network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * Zero is returned if the packet was successfully forward; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv4_input()) should drop the packet. + * + ****************************************************************************/ + +int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) +{ + in_addr_t destipaddr; +#ifdef CONFIG_NETDEV_MULTINIC + in_addr_t srcipaddr; +#endif + FAR struct net_driver_s *fwddev; + int ret; + + /* Search for a device that can forward this packet. This is a trivial + * search if there is only a single network device (CONFIG_NETDEV_MULTINIC + * not defined). But netdev_findby_ipv4addr() will still assure + * routability in that case. + */ + + destipaddr = net_ip4addr_conv32(ipv4->destipaddr); +#ifdef CONFIG_NETDEV_MULTINIC + srcipaddr = net_ip4addr_conv32(ipv4->srcipaddr); + + fwddev = netdev_findby_ipv4addr(srcipaddr, destipaddr); +#else + fwddev = netdev_findby_ipv4addr(destipaddr); +#endif + if (fwddev == NULL) + { + nwarn("WARNING: Not routable\n"); + return (ssize_t)-ENETUNREACH; + } + +#if defined(CONFIG_NETDEV_MULTINIC) + /* Check if we are forwarding on the same device that we received the + * packet from. + */ + + if (fwddev != dev) + { + /* Send the packet asynchrously on the forwarding device. */ + + ret = ipv4_dev_forward(dev, fwddev, ipv4); + if (ret < 0) + { + nwarn("WARNING: ipv4_dev_forward failed: %d\n", ret); + goto drop; + } + } + else +#endif /* CONFIG_NETDEV_MULTINIC */ + + { + /* Single network device. The use case here is where an endpoint acts + * as a hub in a star configuration. This is typical for a wireless star + * configuration where not all endpoints are accessible from all other + * endpoints, but seems less useful for a wired network. + */ + +#ifdef CONFIG_NET_ETHERNET + /* REVISIT: For Ethernet we may have to fix up the Ethernet header: + * - source MAC, the MAC of the current device. + * - dest MAC, the MAC associated with the destination IPv4 adress. + * This will involve ICMP. + */ + + /* Correct dev->d_buf by adding back the L1 header length */ +#endif + + nwarn("WARNING: Packet forwarding to same device not supportedN\n"); + ret = -ENOSYS; + goto drop; + } + + /* Return success. ipv4_input will return to the network driver with + * dev->d_len set to the packet size and the network driver will perform + * the transfer. + */ + + return OK; + +drop: + ipv4_dropstats(ipv4); + dev->d_len = 0; + return ret; +} + +/**************************************************************************** + * Name: ipv4_forward_broadcast + * + * Description: + * This function is called from ipv4_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv4 packet. + * ipv4 - A convenience pointer to the IPv4 header in within the IPv4 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv4_input. + * - ipv4 points to the IPv4 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +void ipv4_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv4_hdr_s *ipv4) +{ + /* Don't bother if the TTL would expire */ + + if (ipv4->ttl > 1) + { + /* Forward the the broadcast/multicast packet to all devices except, + * of course, the device that received the packet. + */ + + (void)netdev_foreach(ipv4_forward_callback, dev); + } +} +#endif + +#endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_IPv4 */ diff --git a/net/devif/ipv6_forward.c b/net/ipforward/ipv6_forward.c similarity index 65% rename from net/devif/ipv6_forward.c rename to net/ipforward/ipv6_forward.c index fa2ec6f77ef..b76a219d81c 100644 --- a/net/devif/ipv6_forward.c +++ b/net/ipforward/ipv6_forward.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/devif/ipv6_forward.c + * net/ipforward/ipv6_forward.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,82 +50,22 @@ #include "netdev/netdev.h" #include "sixlowpan/sixlowpan.h" -#include "udp/udp.h" -#include "tcp/tcp.h" -#include "icmpv6/icmpv6.h" -#include "devif/ip_forward.h" #include "devif/devif.h" +#include "ipforward/ipforward.h" #if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6) /**************************************************************************** - * Private Functions + * Pre-processor Definitions ****************************************************************************/ +#define PACKET_FORWARDED 0 +#define PACKET_NOT_FORWARDED 1 + /**************************************************************************** - * Name: ipv6_packet_conversion - * - * Description: - * Generic output conversion hook. Only needed for IEEE802.15.4 for now - * but this is a point where support for other conversions may be - * provided. - * + * Private Functions ****************************************************************************/ -#ifdef CONFIG_NET_6LOWPAN -static int ipv6_packet_conversion(FAR struct net_driver_s *dev, - FAR struct net_driver_s *fwddev, - FAR struct ipv6_hdr_s *ipv6) -{ -#ifdef CONFIG_NET_MULTILINK - /* Handle the case where multiple link layer protocols are supported */ - - if (dev->d_len > 0 && fwddev->d_lltype == NET_LL_IEEE802154) -#else - if (dev->d_len > 0) -#endif - { -#ifdef CONFIG_NET_TCP - if (ipv6->proto == IP_PROTO_TCP) - { - /* Let 6LoWPAN convert IPv6 TCP output into IEEE802.15.4 frames. */ - - sixlowpan_tcp_send(dev, fwddev, ipv6); - } - else -#endif -#ifdef CONFIG_NET_UDP - if (ipv6->proto == IP_PROTO_UDP) - { - /* Let 6LoWPAN convert IPv6 UDP output into IEEE802.15.4 frames. */ - - sixlowpan_udp_send(dev, fwddev, ipv6); - } - else -#endif - { - /* Otherwise, we will have to drop the packet */ - - nwarn("WARNING: Dropping. Unsupported 6LoWPAN protocol: %d\n", - ipv6->proto); - -#ifdef CONFIG_NET_STATISTICS - g_netstats.ipv6.drop++; -#endif - return -EPROTONOSUPPORT; - } - - dev->d_len = 0; - return OK; - } - - nwarn("WARNING: Dropping. Unsupported link layer\n"); - return -EPFNOSUPPORT; -} -#else -# define ipv6_packet_conversion(dev, ipv6) -#endif /* CONFIG_NET_6LOWPAN */ - /**************************************************************************** * Name: ipv6_hdrsize * @@ -143,7 +83,7 @@ static int ipv6_packet_conversion(FAR struct net_driver_s *dev, * ****************************************************************************/ -#ifdef CONFIG_NETDEV_MULTINIC +#if defined(CONFIG_NETDEV_MULTINIC) && defined(CONFIG_DEBUG_NET_WARN) static int ipv6_hdrsize(FAR struct ipv6_hdr_s *ipv6) { /* Size is determined by the following protocol header, */ @@ -154,7 +94,7 @@ static int ipv6_hdrsize(FAR struct ipv6_hdr_s *ipv6) case IP_PROTO_TCP: { FAR struct tcp_hdr_s *tcp = - (FAR struct tcp_hdr_s *)((FAR uintptr_t *)ipv6 + IPv6_HDRLEN); + (FAR struct tcp_hdr_s *)((FAR uint8_t *)ipv6 + IPv6_HDRLEN); unsigned int tcpsize; /* The TCP header length is encoded in the top 4 bits of the @@ -186,217 +126,6 @@ static int ipv6_hdrsize(FAR struct ipv6_hdr_s *ipv6) } #endif -/**************************************************************************** - * Name: ipv6_dev_forward - * - * Description: - * This function is called from ipv6_forward when it is necessary to - * forward a packet from the current device to different device. In this - * case, the forwarding operation must be performed asynchronously when - * the TX poll is received from the forwarding device. - * - * Input Parameters: - * dev - The device on which the packet was received and which - * contains the IPv6 packet. - * fwdddev - The device on which the packet must be forwarded. - * ipv6 - A pointer to the IPv6 header in within the IPv6 packet - * - * Returned Value: - * Zero is returned if the packet was successfully forward; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller (ipv6_input()) should drop the packet. - * - ****************************************************************************/ - -#ifdef CONFIG_NETDEV_MULTINIC -static int ipv6_dev_forward(FAR struct net_driver_s *dev, - FAR struct net_driver_s *fwddev, - FAR struct ipv6_hdr_s *ipv6) -{ - FAR struct forward_s *fwd = NULL; - int hdrsize; - int ret; - - /* Perform any necessary packet conversions. */ - - ret = ipv6_packet_conversion(dev, fwddev, ipv6); - if (ret < 0) - { - FAR uint8_t *payload; - unsigned int paysize; - - /* Verify that the full packet will fit within the forwarding devices - * MTU. We provide no support for fragmenting forwarded packets. - */ - - if (NET_LL_HDRLEN(fwddev) + dev->d_len > NET_DEV_MTU(fwddev)) - { - nwarn("WARNING: Packet > MTU... Dropping\n"); - ret = -EFBIG; - goto errout; - } - - /* Get a pre-allocated forwarding structure, This structure will be - * completely zeroed when we receive it. - */ - - fwd = ip_forward_alloc(); - if (fwd == NULL) - { - nwarn("WARNING: Failed to allocate forwarding structure\n"); - ret = -ENOMEM; - goto errout; - } - - /* Initialize the easy stuff in the forwarding structure */ - - fwd->f_dev = fwddev; /* Forwarding device */ - - /* Get the size of the IPv6 + L3 header. Use this to determine start - * of the data payload. - * - * Remember that the size of the L1 header has already been subtracted - * from dev->d_len. - * - * REVISIT: Consider an alternative design that does not require data - * copying. This would require a pool of d_buf's that are managed by - * the network rather than the network device. - */ - - hdrsize = ipv6_hdrsize(ipv6); - if (hdrsize < IPv6_HDRLEN) - { - nwarn("WARNING: Could not determine L2+L3 header size\n"); - ret = -EPROTONOSUPPORT; - goto errout_with_fwd; - } - - /* Save the entire L2 and L3 headers in the state structure */ - - if (hdrsize > sizeof(union fwd_iphdr_u)) - { - nwarn("WARNING: Header is too big for pre-allocated structure\n"); - ret = -E2BIG; - goto errout_with_fwd; - } - - memcpy(&fwd->f_hdr, ipv6, hdrsize); - fwd->f_hdrsize = hdrsize; - - /* Use the L2 + L3 header size to determine start and size of the data - * payload. - * - * Remember that the size of the L1 header has already been subtracted - * from dev->d_len. - */ - - payload = (FAR uint8_t *)ipv6 + hdrsize; - paysize = dev->d_len - hdrsize; - - /* If there is a payload, then copy it into an IOB chain. - * - * REVISIT: Consider an alternative design that does not require data - * copying. This would require a pool of d_buf's that are managed by - * the network rather than the network device. - */ - - if (paysize > 0) - { - /* Try to allocate the head of an IOB chain. If this fails, - * the the packet will be dropped; we are not operating in a - * context where waiting for an IOB is a good idea - */ - - fwd->f_iob = iob_tryalloc(false); - if (fwd->f_iob == NULL) - { - nwarn("WARNING: iob_tryalloc() failed\n"); - ret = -ENOMEM; - goto errout_with_fwd; - } - - /* Copy the packet data payload into an IOB chain. - * iob_trycopin() will not wait, but will fail there are no - * available IOBs. - */ - - ret = iob_trycopyin(fwd->f_iob, payload, paysize, 0, false); - if (ret < 0) - { - nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); - goto errout_with_iobchain; - } - } - - /* Then set up to forward the packet according to the protocol. - * - * REVISIT: Are these protocol specific forwarders necessary? I think - * that this could be done with a single forwarding function for all - * protocols. - */ - - switch (ipv6->proto) - { -#ifdef CONFIG_NET_TCP - case IP_PROTO_TCP: - { - /* Forward a TCP packet. */ - - ret = tcp_forward(fwd); - } - break; -#endif - -#ifdef CONFIG_NET_UDP - case IP_PROTO_UDP: - { - /* Forward a UDP packet */ - - ret = udp_forward(fwd); - } - break; -#endif - -#ifdef CONFIG_NET_ICMPv6 - case IP_PROTO_ICMP6: - { - /* Forward an ICMPv6 packet */ - - ret = icmpv6_forward(fwd); - } - break; -#endif - - default: - nwarn("WARNING: Unrecognized proto: %u\n", ipv6->proto); - ret = -EPROTONOSUPPORT; - break; - } - } - - if (ret >= 0) - { - dev->d_len = 0; - return OK; - } - -errout_with_iobchain: - if (fwd != NULL && fwd->f_iob != NULL) - { - iob_free_chain(fwd->f_iob); - } - -errout_with_fwd: - if (fwd != NULL) - { - ip_forward_free(fwd); - } - -errout: - return ret; -} -#endif /* CONFIG_NETDEV_MULTINIC */ - /**************************************************************************** * Name: ipv6_decr_ttl * @@ -421,6 +150,7 @@ errout: * ****************************************************************************/ +#if defined(CONFIG_NETDEV_MULTINIC) || defined(CONFIG_NET_6LOWPAN) static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) { int ttl = (int)ipv6->ttl - 1; @@ -429,7 +159,7 @@ static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) { #ifdef CONFIG_NET_ICMPv6 /* Return an ICMPv6 error packet back to the sender. */ -#warning Missing logic +# warning Missing logic #endif /* Return zero which must cause the packet to be dropped */ @@ -448,53 +178,334 @@ static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) return ttl; } +#endif /**************************************************************************** - * Name: ipv6_dropstats + * Name: ipv6_packet_conversion * * Description: - * Update statistics for a dropped packet. + * Generic output conversion hook. Only needed for IEEE802.15.4 for now + * but this is a point where support for other conversions may be + * provided. * - * Input Parameters: - * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 - * packet to be dropped. - * - * Returned Value: - * None + * Returned value: + * PACKET_FORWARDED - Packet was forwarded + * PACKET_NOT_FORWARDED - Packet was not forwarded + * < 0 - And error occurred (and packet not fowarded). * ****************************************************************************/ -#ifdef CONFIG_NET_STATISTICS -static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) +#ifdef CONFIG_NET_6LOWPAN +static int ipv6_packet_conversion(FAR struct net_driver_s *dev, + FAR struct net_driver_s *fwddev, + FAR struct ipv6_hdr_s *ipv6) { - switch (ipv6->proto) + int ret = PACKET_NOT_FORWARDED; + + if (dev->d_len > 0) { +#ifdef CONFIG_NET_MULTILINK + /* Handle the case where multiple link layer protocols are supported */ + + if (fwddev->d_lltype == NET_LL_IEEE802154) + { + nwarn("WARNING: Unsupported link layer... Not forwarded\n"); + } + else +#endif #ifdef CONFIG_NET_TCP - case IP_PROTO_TCP: - g_netstats.tcp.drop++; - break; -#endif + if (ipv6->proto == IP_PROTO_TCP) + { + /* Decrement the TTL in the IPv6 header. If it decrements to + * zero, then drop the packet. + */ + ret = ipv6_decr_ttl(ipv6); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + } + else + { + /* Let 6LoWPAN convert IPv6 TCP output into IEEE802.15.4 + * frames. + */ + + sixlowpan_tcp_send(dev, fwddev, ipv6); + + /* The packet was forwarded */ + + dev->d_len = 0; + return PACKET_FORWARDED; + } + } + else +#endif #ifdef CONFIG_NET_UDP - case IP_PROTO_UDP: - g_netstats.udp.drop++; - break; -#endif + if (ipv6->proto == IP_PROTO_UDP) + { + /* Decrement the TTL in the IPv6 header. If it decrements to + * zero, then drop the packet. + */ -#ifdef CONFIG_NET_ICMPv6 - case IP_PROTO_ICMP6: - g_netstats.icmpv6.drop++; - break; -#endif + ret = ipv6_decr_ttl(ipv6); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + } + else + { + /* Let 6LoWPAN convert IPv6 UDP output into IEEE802.15.4 + * frames. + */ - default: - break; + sixlowpan_udp_send(dev, fwddev, ipv6); + + /* The packet was forwarded */ + + dev->d_len = 0; + return PACKET_FORWARDED; + } + } + else +#endif + { + /* Otherwise, we cannot forward the packet */ + + nwarn("WARNING: Dropping. Unsupported 6LoWPAN protocol: %d\n", + ipv6->proto); + } } - g_netstats.ipv6.drop++; + /* The packet was not forwarded (or the HOP limit was exceeded) */ + + ipv6_dropstats(ipv6); + return ret; } #else -# define ipv6_dropstats(ipv6) +# define ipv6_packet_conversion(dev, fwddev, ipv6) (PACKET_NOT_FORWARDED) +#endif /* CONFIG_NET_6LOWPAN */ + +/**************************************************************************** + * Name: ipv6_dev_forward + * + * Description: + * This function is called from ipv6_forward when it is necessary to + * forward a packet from the current device to different device. In this + * case, the forwarding operation must be performed asynchronously when + * the TX poll is received from the forwarding device. + * + * Input Parameters: + * dev - The device on which the packet was received and which + * contains the IPv6 packet. + * fwdddev - The device on which the packet must be forwarded. + * ipv6 - A pointer to the IPv6 header in within the IPv6 packet + * + * Returned Value: + * Zero is returned if the packet was successfully forwarded; A negated + * errno value is returned if the packet is not forwardable. In that + * latter case, the caller (ipv6_input()) should drop the packet. + * + ****************************************************************************/ + +#ifdef CONFIG_NETDEV_MULTINIC +static int ipv6_dev_forward(FAR struct net_driver_s *dev, + FAR struct net_driver_s *fwddev, + FAR struct ipv6_hdr_s *ipv6) +{ + FAR struct forward_s *fwd = NULL; +#ifdef CONFIG_DEBUG_NET_WARN + int hdrsize; +#endif + int ret; + + /* Perform any necessary packet conversions. */ + + ret = ipv6_packet_conversion(dev, fwddev, ipv6); + if (ret < 0) + { + nwarn("WARNING: ipv6_packet_conversion failed: %d\n", ret); + goto errout; + } + else if (ret == PACKET_NOT_FORWARDED) + { + /* Verify that the full packet will fit within the forwarding devices + * MTU. We provide no support for fragmenting forwarded packets. + */ + + if (NET_LL_HDRLEN(fwddev) + dev->d_len > NET_DEV_MTU(fwddev)) + { + nwarn("WARNING: Packet > MTU... Dropping\n"); + ret = -EFBIG; + goto errout; + } + + /* Get a pre-allocated forwarding structure, This structure will be + * completely zeroed when we receive it. + */ + + fwd = ipfwd_alloc(); + if (fwd == NULL) + { + nwarn("WARNING: Failed to allocate forwarding structure\n"); + ret = -ENOMEM; + goto errout; + } + + /* Initialize the easy stuff in the forwarding structure */ + + fwd->f_dev = fwddev; /* Forwarding device */ +#ifdef CONFIG_NET_IPv4 + fwd->f_domain = PF_INET6; /* IPv6 address domain */ +#endif + +#ifdef CONFIG_DEBUG_NET_WARN + /* Get the size of the IPv6 + L3 header. */ + + hdrsize = ipv6_hdrsize(ipv6); + if (hdrsize < IPv6_HDRLEN) + { + nwarn("WARNING: Could not determine L2+L3 header size\n"); + ret = -EPROTONOSUPPORT; + goto errout_with_fwd; + } + + /* The L2/L3 headers must fit within one, contiguous IOB. */ + + if (hdrsize > CONFIG_IOB_BUFSIZE) + { + nwarn("WARNING: Header is too big for pre-allocated structure\n"); + ret = -E2BIG; + goto errout_with_fwd; + } +#endif + + /* Try to allocate the head of an IOB chain. If this fails, the + * packet will be dropped; we are not operating in a context where + * waiting for an IOB is a good idea + */ + + fwd->f_iob = iob_tryalloc(false); + if (fwd->f_iob == NULL) + { + nwarn("WARNING: iob_tryalloc() failed\n"); + ret = -ENOMEM; + goto errout_with_fwd; + } + + /* Copy the L2/L3 headers plus any following payload into an IOB + * chain. iob_trycopin() will not wait, but will fail there are no + * available IOBs. + * + * REVISIT: Consider an alternative design that does not require data + * copying. This would require a pool of d_buf's that are managed by + * the network rather than the network device. + */ + + ret = iob_trycopyin(fwd->f_iob, (FAR const uint8_t *)ipv6, + dev->d_len, 0, false); + if (ret < 0) + { + nwarn("WARNING: iob_trycopyin() failed: %d\n", ret); + goto errout_with_iobchain; + } + + /* Decrement the TTL in the copy of the IPv6 header (retaining the + * original TTL in the sourcee to handle the broadcast case). If the + * TTL decrements to zero, then do not forward the packet. + */ + + ret = ipv6_decr_ttl((FAR struct ipv6_hdr_s *)fwd->f_iob->io_data); + if (ret < 1) + { + nwarn("WARNING: Hop limit exceeded... Dropping!\n"); + ret = -EMULTIHOP; + goto errout_with_iobchain; + } + + /* Then set up to forward the packet according to the protocol. */ + + ret = ipfwd_forward(fwd); + if (ret >= 0) + { + dev->d_len = 0; + return OK; + } + } + +errout_with_iobchain: + if (fwd != NULL && fwd->f_iob != NULL) + { + iob_free_chain(fwd->f_iob); + } + +errout_with_fwd: + if (fwd != NULL) + { + ipfwd_free(fwd); + } + +errout: + return ret; +} +#endif /* CONFIG_NETDEV_MULTINIC */ + +/**************************************************************************** + * Name: ipv6_forward_callback + * + * Description: + * This function is a callback from netdev_foreach. It implements the + * the broadcase forwarding action for each network device (other than, of + * course, the device that received the packet). + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet + * + * Returned Value: + * Typically returns zero (meaning to continue the enumeration), but will + * return a non-zero to stop the enumeration if an error occurs. + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +int ipv6_forward_callback(FAR struct net_driver_s *fwddev, FAR void *arg) +{ + FAR struct net_driver_s *dev = (FAR struct net_driver_s *)arg; + FAR struct ipv6_hdr_s *ipv6; + int ret; + + DEBUGASSERT(fwddev != NULL && dev != NULL && dev->d_buf != NULL); + + /* Check if we are forwarding on the same device that we received the + * packet from. + */ + + if (fwddev != dev) + { + /* Recover the pointer to the IPv6 header in the receiving device's + * d_buf. + */ + + ipv6 = (FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)]; + + /* Send the packet asynchrously on the forwarding device. */ + + ret = ipv6_dev_forward(dev, fwddev, ipv6); + if (ret < 0) + { + nwarn("WARNING: ipv6_dev_forward failed: %d\n", ret); + return ret; + } + } + + return OK; +} #endif /**************************************************************************** @@ -532,23 +543,11 @@ static void ipv6_dropstats(FAR struct ipv6_hdr_s *ipv6) int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) { - /* Multiple network devices */ - FAR struct net_driver_s *fwddev; int ret; - /* Decrement the TTL. If it decrements to zero, then drop the packet */ - - ret = ipv6_decr_ttl(ipv6); - if (ret < 1) - { - nwarn("WARNING: Hop limit exceeded... Dropping!\n"); - ret = -EMULTIHOP; - goto drop; - } - /* Search for a device that can forward this packet. This is a trivial - * serch if there is only a single network device (CONFIG_NETDEV_MULTINIC + * search if there is only a single network device (CONFIG_NETDEV_MULTINIC * not defined). But netdev_findby_ipv6addr() will still assure * routability in that case. */ @@ -576,7 +575,7 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) ret = ipv6_dev_forward(dev, fwddev, ipv6); if (ret < 0) { - nwarn("WARNING: ipv6_dev_forward faield: %d\n", ret); + nwarn("WARNING: ipv6_dev_forward failed: %d\n", ret); goto drop; } } @@ -600,6 +599,11 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) ret = ipv6_packet_conversion(dev, dev, ipv6); if (ret < 0) { + nwarn("WARNING: ipv6_packet_conversion failed: %d\n", ret); + goto drop; + } + else if (ret == PACKET_NOT_FORWARDED) + { #ifdef CONFIG_NET_ETHERNET /* REVISIT: For Ethernet we may have to fix up the Ethernet header: * - source MAC, the MAC of the current device. @@ -643,4 +647,48 @@ drop: return ret; } +/**************************************************************************** + * Name: ipv6_forward_broadcast + * + * Description: + * This function is called from ipv6_input when a broadcast or multicast + * packet is received. If CONFIG_NET_IPFORWARD_BROADCAST is enabled, this + * function will forward the broadcast packet to other networks through + * other network devices. + * + * Input Parameters: + * dev - The device on which the packet was received and which contains + * the IPv6 packet. + * ipv6 - A convenience pointer to the IPv6 header in within the IPv6 + * packet + * + * On input: + * - dev->d_buf holds the received packet. + * - dev->d_len holds the length of the received packet MINUS the + * size of the L1 header. That was subtracted out by ipv6_input. + * - ipv6 points to the IPv6 header with dev->d_buf. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IPFORWARD_BROADCAST) && \ + defined(CONFIG_NETDEV_MULTINIC) +void ipv6_forward_broadcast(FAR struct net_driver_s *dev, + FAR struct ipv6_hdr_s *ipv6) +{ + /* Don't bother if the TTL would expire */ + + if (ipv6->ttl > 1) + { + /* Forward the the broadcast/multicast packet to all devices except, + * of course, the device that received the packet. + */ + + (void)netdev_foreach(ipv6_forward_callback, dev); + } +} +#endif + #endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_IPv6 */ diff --git a/net/neighbor/Kconfig b/net/neighbor/Kconfig index 6792e0846d3..89405c4e48f 100644 --- a/net/neighbor/Kconfig +++ b/net/neighbor/Kconfig @@ -9,6 +9,4 @@ config NET_IPv6_NCONF_ENTRIES int "Number of IPv6 neighbors" default 8 -#config NET_IPv6_NEIGHBOR_ADDRTYPE - endif # NET_IPv6 diff --git a/net/neighbor/Make.defs b/net/neighbor/Make.defs index 7f6b56244ec..dd466a9c248 100644 --- a/net/neighbor/Make.defs +++ b/net/neighbor/Make.defs @@ -50,6 +50,10 @@ ifeq ($(CONFIG_NET_6LOWPAN),y) # NET_CSRCS += neighbor_6lowpan_out.c endif +ifeq ($(CONFIG_DEBUG_NET_INFO),y) +NET_CSRCS += neighbor_dumpentry.c +endif + # Include utility build support DEPPATH += --dep-path neighbor diff --git a/net/neighbor/neighbor.h b/net/neighbor/neighbor.h index a8317f6d362..bf9a3839d26 100644 --- a/net/neighbor/neighbor.h +++ b/net/neighbor/neighbor.h @@ -3,7 +3,7 @@ * Header file for database of link-local neighbors, used by IPv6 code and * to be used by future ARP code. * - * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * A leverage of logic from uIP which also has a BSD style license @@ -51,6 +51,7 @@ #include #include +#include #ifdef CONFIG_NET_IPv6 @@ -67,15 +68,24 @@ /**************************************************************************** * Public Types ****************************************************************************/ + /* Describes the link layer address */ struct neighbor_addr_s { -#ifdef CONFIG_NET_IPv6_NEIGHBOR_ADDRTYPE - CONFIG_NET_IPv6_NEIGHBOR_ADDRTYPE na_addr; -#else - struct ether_addr na_addr; + union + { +#ifdef CONFIG_NET_MULTILINK + uint8_t na_lltype; #endif + +#ifdef CONFIG_NET_ETHERNET + struct ether_addr na_ethernet; +#endif +#ifdef CONFIG_NET_6LOWPAN + struct sixlowpan_addr_s na_sixlowpan; +#endif + } u; }; /* This structure describes on entry in the neighbor table. This is intended @@ -149,6 +159,7 @@ FAR struct neighbor_entry *neighbor_findentry(const net_ipv6addr_t ipaddr); * * Input Parameters: * ipaddr - The IPv6 address of the mapping. + * lltype - The link layer address type * addr - The link layer address of the mapping * * Returned Value: @@ -156,7 +167,8 @@ FAR struct neighbor_entry *neighbor_findentry(const net_ipv6addr_t ipaddr); * ****************************************************************************/ -void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr); +void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, + FAR uint8_t *addr); /**************************************************************************** * Name: neighbor_lookup @@ -211,6 +223,50 @@ void neighbor_update(const net_ipv6addr_t ipaddr); void neighbor_periodic(int hsec); +/**************************************************************************** + * Name: neighbor_dumpentry + * + * Description: + * Dump the conents of an entry Neighbor Table. + * + * Input Parameters: + * msg - Message to print with the entry + * neighbor - The table entry to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_NET_INFO +void neighbor_dumpentry(FAR const char *msg, + FAR struct neighbor_entry *neighbor); +#else +# define neighbor_dumpentry(msg,neighbor) +#endif + +/**************************************************************************** + * Name: neighbor_dumpipaddr + * + * Description: + * Dump an IP address. + * + * Input Parameters: + * msg - Message to print with the entry + * ipaddr - The IP address to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_NET_INFO +void neighbor_dumpipaddr(FAR const char *msg, + const net_ipv6addr_t ipaddr); +#else +# define neighbor_dumpipaddr(msg,ipaddr) +#endif + #endif /* CONFIG_NET_IPv6 */ #endif /* __NET_NEIGHBOR_NEIGHBOR_H */ diff --git a/net/neighbor/neighbor_add.c b/net/neighbor/neighbor_add.c index fed15353ae0..11e67ef5680 100644 --- a/net/neighbor/neighbor_add.c +++ b/net/neighbor/neighbor_add.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/neighbor/neighbor_add.c * - * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * A leverage of logic from uIP which also has a BSD style license @@ -43,11 +43,16 @@ #include +#include #include #include +#include + +#include #include +#include "netdev/netdev.h" #include "neighbor/neighbor.h" /**************************************************************************** @@ -63,6 +68,7 @@ * * Input Parameters: * ipaddr - The IPv6 address of the mapping. + * lltype - The link layer address type * addr - The link layer address of the mapping * * Returned Value: @@ -70,24 +76,13 @@ * ****************************************************************************/ -void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr) +void neighbor_add(FAR net_ipv6addr_t ipaddr, uint8_t lltype, + FAR uint8_t *addr) { uint8_t oldest_time; int oldest_ndx; int i; - ninfo("Add neighbor: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), - ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]), - ntohs(ipaddr[6]), ntohs(ipaddr[7])); - ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x\n", - addr->na_addr.ether_addr_octet[0], - addr->na_addr.ether_addr_octet[1], - addr->na_addr.ether_addr_octet[2], - addr->na_addr.ether_addr_octet[3], - addr->na_addr.ether_addr_octet[4], - addr->na_addr.ether_addr_octet[5]); - /* Find the first unused entry or the oldest used entry. */ oldest_time = 0; @@ -101,7 +96,12 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr) break; } +#ifdef CONFIG_NET_MULTILINK + if (g_neighbors[i].ne_addr.u.na_lltype == lltype && + net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr)) +#else if (net_ipv6addr_cmp(g_neighbors[i].ne_ipaddr, ipaddr)) +#endif { oldest_ndx = i; break; @@ -120,5 +120,13 @@ void neighbor_add(FAR net_ipv6addr_t ipaddr, FAR struct neighbor_addr_s *addr) g_neighbors[oldest_ndx].ne_time = 0; net_ipv6addr_copy(g_neighbors[oldest_ndx].ne_ipaddr, ipaddr); - memcpy(&g_neighbors[oldest_ndx].ne_addr, addr, sizeof(struct neighbor_addr_s)); + +#ifdef CONFIG_NET_MULTILINK + g_neighbors[oldest_ndx].ne_addr.u.na_lltype = lltype; +#endif + memcpy(&g_neighbors[oldest_ndx].ne_addr.u, addr, netdev_type_lladdrsize(lltype)); + + /* Dump the contents of the new entry */ + + neighbor_dumpentry("Added entry", &g_neighbors[oldest_ndx]); } diff --git a/net/neighbor/neighbor_dumpentry.c b/net/neighbor/neighbor_dumpentry.c new file mode 100644 index 00000000000..78369f09172 --- /dev/null +++ b/net/neighbor/neighbor_dumpentry.c @@ -0,0 +1,140 @@ +/**************************************************************************** + * net/neighbor/neighbor_dumpentry.c + * + * 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 of the Institute 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 INSTITUTE 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 INSTITUTE 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 "neighbor/neighbor.h" + +#ifdef CONFIG_DEBUG_NET_INFO + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: neighbor_dumpentry + * + * Description: + * Dump the conents of an entry Neighbor Table. + * + * Input Parameters: + * msg - Message to print with the entry + * neighbor - The table entry to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +void neighbor_dumpentry(FAR const char *msg, + FAR struct neighbor_entry *neighbor) +{ + ninfo("%s: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + msg, + ntohs(neighbor->ne_ipaddr[0]), ntohs(neighbor->ne_ipaddr[1]), + ntohs(neighbor->ne_ipaddr[2]), ntohs(neighbor->ne_ipaddr[3]), + ntohs(neighbor->ne_ipaddr[4]), ntohs(neighbor->ne_ipaddr[5]), + ntohs(neighbor->ne_ipaddr[6]), ntohs(neighbor->ne_ipaddr[7])); + +#ifdef CONFIG_NET_ETHERNET +#ifdef CONFIG_NET_6LOWPAN + if (neighbor->ne_addr.u.na_lltype == NET_LL_ETHERNET) +#endif + { + ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x\n", + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[0], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[1], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[2], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[3], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[4], + neighbor->ne_addr.u.na_ethernet.ether_addr_octet[5]); + } +#endif +#ifdef CONFIG_NET_6LOWPAN +#ifdef CONFIG_NET_ETHERNET + else +#endif + { +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR + ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", + neighbor->ne_addr.u.na_sixlowpan.u8[0], + neighbor->ne_addr.u.na_sixlowpan.u8[1], + neighbor->ne_addr.u.na_sixlowpan.u8[2], + neighbor->ne_addr.u.na_sixlowpan.u8[3], + neighbor->ne_addr.u.na_sixlowpan.u8[4], + neighbor->ne_addr.u.na_sixlowpan.u8[5], + neighbor->ne_addr.u.na_sixlowpan.u8[6], + neighbor->ne_addr.u.na_sixlowpan.u8[7]); +#else + ninfo(" at: %02x:%02x\n", + neighbor->ne_addr.u.na_sixlowpan.u8[0], + neighbor->ne_addr.u.na_sixlowpan.u8[1]); + } +#endif +#endif +} + +/**************************************************************************** + * Name: neighbor_dumpipaddr + * + * Description: + * Dump an IP address. + * + * Input Parameters: + * msg - Message to print with the entry + * ipaddr - The IP address to dump + * + * Returned Value: + * None + * + ****************************************************************************/ + +void neighbor_dumpipaddr(FAR const char *msg, + const net_ipv6addr_t ipaddr) +{ + ninfo("%s: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + msg, + ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), + ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]), + ntohs(ipaddr[6]), ntohs(ipaddr[7])); +} + +#endif /* CONFIG_DEBUG_NET_INFO */ diff --git a/net/neighbor/neighbor_ethernet_out.c b/net/neighbor/neighbor_ethernet_out.c index f342f7cc403..4da54e42fc2 100644 --- a/net/neighbor/neighbor_ethernet_out.c +++ b/net/neighbor/neighbor_ethernet_out.c @@ -240,7 +240,7 @@ void neighbor_out(FAR struct net_driver_s *dev) /* Build an Ethernet header. */ - memcpy(eth->dest, naddr->na_addr.ether_addr_octet, ETHER_ADDR_LEN); + memcpy(eth->dest, naddr->u.na_ethernet.ether_addr_octet, ETHER_ADDR_LEN); } /* Finish populating the Ethernet header */ diff --git a/net/neighbor/neighbor_findentry.c b/net/neighbor/neighbor_findentry.c index fe6a7b7b319..7cd1e3fd760 100644 --- a/net/neighbor/neighbor_findentry.c +++ b/net/neighbor/neighbor_findentry.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/neighbor/neighbor_findentry.c * - * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * A leverage of logic from uIP which also has a BSD style license @@ -49,7 +49,7 @@ #include "neighbor/neighbor.h" /**************************************************************************** - * Private Functions + * Public Functions ****************************************************************************/ /**************************************************************************** @@ -72,29 +72,17 @@ FAR struct neighbor_entry *neighbor_findentry(const net_ipv6addr_t ipaddr) { int i; - ninfo("Find neighbor: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), - ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]), - ntohs(ipaddr[6]), ntohs(ipaddr[7])); - for (i = 0; i < CONFIG_NET_IPv6_NCONF_ENTRIES; ++i) { FAR struct neighbor_entry *neighbor = &g_neighbors[i]; if (net_ipv6addr_cmp(neighbor->ne_ipaddr, ipaddr)) { - ninfo(" at: %02x:%02x:%02x:%02x:%02x:%02x\n", - neighbor->ne_addr.na_addr.ether_addr_octet[0], - neighbor->ne_addr.na_addr.ether_addr_octet[1], - neighbor->ne_addr.na_addr.ether_addr_octet[2], - neighbor->ne_addr.na_addr.ether_addr_octet[3], - neighbor->ne_addr.na_addr.ether_addr_octet[4], - neighbor->ne_addr.na_addr.ether_addr_octet[5]); - - return &g_neighbors[i]; + neighbor_dumpentry("Entry found", neighbor); + return neighbor; } } - ninfo(" Not found\n"); + neighbor_dumpipaddr("Not found", ipaddr); return NULL; } diff --git a/net/neighbor/neighbor_lookup.c b/net/neighbor/neighbor_lookup.c index 01f029b69fa..67d8764303a 100644 --- a/net/neighbor/neighbor_lookup.c +++ b/net/neighbor/neighbor_lookup.c @@ -76,14 +76,6 @@ FAR const struct neighbor_addr_s *neighbor_lookup(const net_ipv6addr_t ipaddr) neighbor = neighbor_findentry(ipaddr); if (neighbor != NULL) { - ninfo("Lookup neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", - neighbor->ne_addr.na_addr.ether_addr_octet[0], - neighbor->ne_addr.na_addr.ether_addr_octet[1], - neighbor->ne_addr.na_addr.ether_addr_octet[2], - neighbor->ne_addr.na_addr.ether_addr_octet[3], - neighbor->ne_addr.na_addr.ether_addr_octet[4], - neighbor->ne_addr.na_addr.ether_addr_octet[5]); - return &neighbor->ne_addr; } diff --git a/net/net_initialize.c b/net/net_initialize.c index a5e0c2d31e4..597aaeb717c 100644 --- a/net/net_initialize.c +++ b/net/net_initialize.c @@ -47,6 +47,7 @@ #include "socket/socket.h" #include "devif/devif.h" #include "netdev/netdev.h" +#include "ipforward/ipforward.h" #include "arp/arp.h" #include "sixlowpan/sixlowpan.h" #include "neighbor/neighbor.h" @@ -112,6 +113,12 @@ void net_setup(void) devif_initialize(); +#ifdef HAVE_FWDALLOC + /* Initialize IP forwarding support */ + + ipfwd_initialize(); +#endif + #ifdef CONFIG_NET_PKT /* Initialize packet socket support */ diff --git a/net/netdev/Make.defs b/net/netdev/Make.defs index c5262a1aacc..8a329b0e30c 100644 --- a/net/netdev/Make.defs +++ b/net/netdev/Make.defs @@ -39,6 +39,7 @@ NETDEV_CSRCS += netdev_register.c netdev_ioctl.c netdev_txnotify.c NETDEV_CSRCS += netdev_findbyname.c netdev_findbyaddr.c netdev_findbyindex.c NETDEV_CSRCS += netdev_count.c netdev_foreach.c netdev_unregister.c NETDEV_CSRCS += netdev_carrier.c netdev_default.c netdev_verify.c +NETDEV_CSRCS += netdev_lladdrsize.c ifeq ($(CONFIG_NET_RXAVAIL),y) NETDEV_CSRCS += netdev_rxnotify.c diff --git a/net/netdev/netdev.h b/net/netdev/netdev.h index 206a9e67faa..83aa7c5f808 100644 --- a/net/netdev/netdev.h +++ b/net/netdev/netdev.h @@ -47,6 +47,31 @@ #include +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* If there is only one supported link layer, then the size of the link + * layer address is a constant. + * + * NOTE: Literal constants are used here to avoid bringing in all of the + * header files where they are correctly defined. + */ + +#ifndef CONFIG_NET_MULTILINK +# if defined(CONFIG_NET_ETHERNET) +# define NETDEV_LLADDRSIZE 6 /* IFHWADDRLEN */ +# elif defined(CONFIG_NET_6LOWPAN) +# ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR +# define NETDEV_LLADDRSIZE 10 /* NET_6LOWPAN_EADDRSIZE */ +# else +# define NETDEV_LLADDRSIZE 2 /* NET_6LOWPAN_SADDRSIZE */ +# endif +# else +# define NETDEV_LLADDRSIZE 0 /* No link layer address */ +# endif +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -437,6 +462,42 @@ void netdev_ipv6_rxnotify(FAR const net_ipv6addr_t ripaddr); int netdev_count(void); #endif +/**************************************************************************** + * Name: netdev_type_lladdrsize + * + * Description: + * Returns the size of the MAC address associated with a link layer type. + * + * Parameters: + * lltype - link layer type code + * + * Returned Value: + * The size of the MAC address associated with this device + * + ****************************************************************************/ + +int netdev_type_lladdrsize(uint8_t lltype); + +/**************************************************************************** + * Name: netdev_dev_lladdrsize + * + * Description: + * Returns the size of the MAC address associated with a network device. + * + * Parameters: + * dev - A reference to the device of interest + * + * Returned Value: + * The size of the MAC address associated with this device + * + ****************************************************************************/ + +#ifdef CONFIG_NET_MULTILINK +# define netdev_dev_lladdrsize(dev) netdev_type_lladdrsize((dev)->d_lltype) +#else +# define netdev_dev_lladdrsize(dev) NETDEV_LLADDRSIZE +#endif + #undef EXTERN #ifdef __cplusplus } diff --git a/net/netdev/netdev_lladdrsize.c b/net/netdev/netdev_lladdrsize.c new file mode 100644 index 00000000000..f3e69d39051 --- /dev/null +++ b/net/netdev/netdev_lladdrsize.c @@ -0,0 +1,105 @@ +/**************************************************************************** + * net/netdev/netdev_lladdrsize.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include +#include + +#include "netdev/netdev.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: netdev_type_lladdrsize + * + * Description: + * Returns the size of the MAC address associated with a link layer type. + * + * Parameters: + * lltype - link layer type code + * + * Returned Value: + * The size of the MAC address associated with this device + * + ****************************************************************************/ + +int netdev_type_lladdrsize(uint8_t lltype) +{ + /* Get the length of the address for this link layer type */ + +#ifdef CONFIG_NET_ETHERNET + if (lltype == NET_LL_ETHERNET) + { + /* size of the Ethernet MAC address */ + + return IFHWADDRLEN; + } + else +#endif +#ifdef CONFIG_NET_6LOWPAN + if (lltype == NET_LL_IEEE802154) + { + /* 6LoWPAN can be configured to use either extended or short + * addressing. + */ + +#ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR + return NET_6LOWPAN_EADDRSIZE; +#else + return NET_6LOWPAN_SADDRSIZE; +#endif + } + else +#endif + { + /* Either the link layer type associated with lltype has no address, + * or support for that link layer type is not enabled. + */ + + return 0; + } +} diff --git a/net/netdev/netdev_register.c b/net/netdev/netdev_register.c index 745da4f50a7..efe545fb187 100644 --- a/net/netdev/netdev_register.c +++ b/net/netdev/netdev_register.c @@ -68,14 +68,16 @@ #define NETDEV_WLAN_FORMAT "wlan%d" #define NETDEV_WPAN_FORMAT "wpan%d" -#if defined(CONFIG_NET_SLIP) -# define NETDEV_DEFAULT_FORMAT NETDEV_SLIP_FORMAT -#elif defined(CONFIG_DRIVERS_IEEE80211) /* Usually also has CONFIG_NET_ETHERNET */ +#if defined(CONFIG_DRIVERS_IEEE80211) /* Usually also has CONFIG_NET_ETHERNET */ # define NETDEV_DEFAULT_FORMAT NETDEV_WLAN_FORMAT #elif defined(CONFIG_NET_ETHERNET) # define NETDEV_DEFAULT_FORMAT NETDEV_ETH_FORMAT #elif defined(CONFIG_NET_6LOWPAN) # define NETDEV_DEFAULT_FORMAT NETDEV_WPAN_FORMAT +#elif defined(CONFIG_NET_SLIP) +# define NETDEV_DEFAULT_FORMAT NETDEV_SLIP_FORMAT +#elif defined(CONFIG_NET_TUN) +# define NETDEV_DEFAULT_FORMAT NETDEV_TUN_FORMAT #else /* if defined(CONFIG_NET_LOOPBACK) */ # define NETDEV_DEFAULT_FORMAT NETDEV_LO_FORMAT #endif diff --git a/net/netdev/netdev_txnotify.c b/net/netdev/netdev_txnotify.c index 72382e01df5..fca1b9d0707 100644 --- a/net/netdev/netdev_txnotify.c +++ b/net/netdev/netdev_txnotify.c @@ -167,7 +167,7 @@ void netdev_ipv6_txnotify(FAR const net_ipv6addr_t ripaddr) void netdev_txnotify_dev(FAR struct net_driver_s *dev) { - if (dev && dev->d_txavail) + if (dev != NULL && dev->d_txavail != NULL) { /* Notify the device driver that new TX data is available. */ diff --git a/net/socket/send.c b/net/socket/send.c index 33060b5a327..c47158aca25 100644 --- a/net/socket/send.c +++ b/net/socket/send.c @@ -255,6 +255,7 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, set_errno(-ret); ret = ERROR; } + return ret; } diff --git a/net/tcp/Make.defs b/net/tcp/Make.defs index 7f3a88582b5..c7b00b60406 100644 --- a/net/tcp/Make.defs +++ b/net/tcp/Make.defs @@ -60,14 +60,6 @@ NET_CSRCS += tcp_conn.c tcp_seqno.c tcp_devpoll.c tcp_finddev.c tcp_timer.c NET_CSRCS += tcp_send.c tcp_input.c tcp_appsend.c tcp_listen.c NET_CSRCS += tcp_callback.c tcp_backlog.c tcp_ipselect.c -# IP forwarding - -ifeq ($(CONFIG_NET_IPFORWARD),y) -ifeq ($(CONFIG_NETDEV_MULTINIC),y) -NET_CSRCS += tcp_forward.c -endif -endif - # TCP write buffering ifeq ($(CONFIG_NET_TCP_WRITE_BUFFERS),y) diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h index 8b554fff864..f13170668d9 100644 --- a/net/tcp/tcp.h +++ b/net/tcp/tcp.h @@ -794,35 +794,6 @@ int tcp_accept_connection(FAR struct net_driver_s *dev, void tcp_send(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, uint16_t flags, uint16_t len); -/**************************************************************************** - * Name: tcp_forward - * - * Description: - * Called by the IP forwarding logic when an TCP packet is received on - * one network device, but must be forwarded on another network device. - * - * Set up to forward the TCP packet on the specified device. This - * function will set up a send "interrupt" handler that will perform - * the actual send asynchronously and must return without waiting for the - * send to complete. - * - * Input Parameters: - * fwd - An initialized instance of the common forwarding structure that - * includes everything needed to perform the forwarding operation. - * - * Returned Value: - * Zero is returned if the packet was successfully forwarded; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller should free the IOB list and drop the packet. - * - ****************************************************************************/ - -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6) && \ - defined(CONFIG_NETDEV_MULTINIC) -struct forward_s; /* Forward reference */ -int tcp_forward(FAR struct forward_s *fwd); -#endif - /**************************************************************************** * Name: tcp_reset * diff --git a/net/tcp/tcp_forward.c b/net/tcp/tcp_forward.c deleted file mode 100644 index 22c021aa367..00000000000 --- a/net/tcp/tcp_forward.c +++ /dev/null @@ -1,427 +0,0 @@ -/**************************************************************************** - * net/tcp/tcp_forward.c - * - * 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. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 -#include - -#include "devif/ip_forward.h" -#include "devif/devif.h" -#include "netdev/netdev.h" -#include "tcp/tcp.h" - -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_TCP) && \ - defined(CONFIG_NETDEV_MULTINIC) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: forward_ipselect - * - * Description: - * If both IPv4 and IPv6 support are enabled, then we will need to select - * which one to use when generating the outgoing packet. If only one - * domain is selected, then the setup is already in place and we need do - * nothing. - * - * Parameters: - * fwd - The forwarding state structure - * - * Returned Value: - * None - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) -static inline void forward_ipselect(FAR struct forward_s *fwd) -{ - /* Which domain the connection support */ - - if (fwd->f_conn.tcp.domain == PF_INET) - { - /* Select the IPv4 domain */ - - tcp_ipv4_select(dev); - } - else /* if (conn->domain == PF_INET6) */ - { - /* Select the IPv6 domain */ - - DEBUGASSERT(conn->domain == PF_INET6); - tcp_ipv6_select(dev); - } -} -#endif - -/**************************************************************************** - * Name: tcp_forward_addrchck - * - * Description: - * Check if the destination IP address is in the IPv4 ARP or IPv6 Neighbor - * tables. If not, then the send won't actually make it out... it will be - * replaced with an ARP request (IPv4) or a Neighbor Solicitation (IPv6). - * - * NOTE 1: This could be an expensive check if there are a lot of - * entries in the ARP or Neighbor tables. - * - * NOTE 2: If we are actually harvesting IP addresses on incoming IP - * packets, then this check should not be necessary; the MAC mapping - * should already be in the ARP table in many cases (IPv4 only). - * - * NOTE 3: If CONFIG_NET_ARP_SEND then we can be assured that the IP - * address mapping is already in the ARP table. - * - * Parameters: - * fwd - The forwarding state structure - * - * Returned Value: - * None - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_ETHERNET -static inline bool tcp_forward_addrchck(FAR struct forward_s *fwd) -{ - FAR struct tcp_conn_s *conn = &fwd->f_conn.tcp; - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if (conn->domain == PF_INET) -#endif - { -#if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND) - return (arp_find(conn->u.ipv4.raddr) != NULL); -#else - return true; -#endif - } -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { -#if !defined(CONFIG_NET_ICMPv6_NEIGHBOR) - return (neighbor_findentry(conn->u.ipv6.raddr) != NULL); -#else - return true; -#endif - } -#endif /* CONFIG_NET_IPv6 */ - - UNUSED(conn); -} - -#else /* CONFIG_NET_ETHERNET */ -# define tcp_forward_addrchck(r) (true) -#endif /* CONFIG_NET_ETHERNET */ - -/**************************************************************************** - * Name: tcp_dropstats - * - * Description: - * Update statistics for a dropped packet. - * - * Input Parameters: - * fwd - The forwarding state structure - * - * Returned Value: - * None - * - ****************************************************************************/ - -#ifdef CONFIG_NET_STATISTICS -static void tcp_dropstats(FAR struct forward_s *fwd) -{ - /* Increment the count of dropped TCP packets */ - - g_netstats.tcp.drop++; - - /* Increment the count of dropped IPv4 or IPv6 packets */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if (fwd->f_conn.tcp.domain == PF_INET) -#endif - { - g_netstats.ipv4.drop++; - } -#endif -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { - g_netstats.ipv6.drop++; - } -#endif -} -#else -# define tcp_dropstats(ipv6) -#endif - -/**************************************************************************** - * Name: tcp_forward_interrupt - * - * Description: - * This function is called from the interrupt level to perform the actual - * send operation when polled by the lower, device interfacing layer. - * - * NOTE: Our role here is just data passthrough. We don't really care - * about ACKing, dynamic windows or any of the other TCP complexities. - * That is really something between the two endpoints and does not matter - * the forwarding hub. - * - * Parameters: - * dev The structure of the network driver that caused the interrupt - * conn An instance of the TCP connection structure cast to void * - * pvpriv An instance of struct forward_s cast to void* - * flags Set of events describing why the callback was invoked - * - * Returned Value: - * Modified value of the input flags - * - * Assumptions: - * The network is locked - * - ****************************************************************************/ - -static uint16_t tcp_forward_interrupt(FAR struct net_driver_s *dev, - FAR void *conn, FAR void *pvpriv, - uint16_t flags) -{ - FAR struct forward_s *fwd = (FAR struct forward_s *)pvpriv; - - ninfo("flags: %04x\n", flags); - DEBUGASSERT(fwd != NULL); - - /* Make sure that this is from the forwarding device */ - - if (dev == fwd->f_dev) - { - /* If the network device has gone down, then we will have terminate - * the wait now with an error. - * - * REVISIT: TCP disconnection events should should not be recieved here. - * Rather the disconnection events will be handled by the TCP endpoints. - */ - - if ((flags & NETDEV_DOWN) != 0) - { - /* Terminate the transfer with an error. */ - - nwarn("WARNING: Network is down... Dropping\n"); - tcp_dropstats(fwd); - } - - /* Check if the outgoing packet is available. It may have been claimed - * by a sendto interrupt serving a different thread -OR- if the output - * buffer currently contains unprocessed incoming data. In these cases - * we will just have to wait for the next polling cycle. - */ - - else if (dev->d_sndlen > 0 || (flags & TCP_NEWDATA) != 0) - { - /* Another thread has beat us sending data or the buffer is busy, - * Wait for the next polling cycle and check again. - */ - - return flags; - } - - /* It looks like we are good to forward the data */ - - else - { -#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) - /* If both IPv4 and IPv6 support are enabled, then we will need to - * select which one to use when generating the outgoing packet. - * If only one domain is selected, then the setup is already in - * place and we need do nothing. - */ - - forward_ipselect(dev, fwd); -#endif - /* Copy the user data into d_appdata and send it. */ - - devif_forward(fwd); - - /* Check if the destination IP address is in the ARP or Neighbor - * table. If not, then the send won't actually make it out... it - * will be replaced with an ARP request or Neighbor Solicitation. - */ - - if (!tcp_forward_addrchck(fwd)) - { - return flags; - } - } - - /* Free the allocated callback structure */ - - fwd->f_cb->flags = 0; - fwd->f_cb->priv = NULL; - fwd->f_cb->event = NULL; - - tcp_callback_free(&fwd->f_conn.tcp, fwd->f_cb); - - /* Free any IOBs */ - - if (fwd->f_iob != NULL) - { - iob_free_chain(fwd->f_iob); - } - - /* And release the forwarding state structure */ - - ip_forward_free(fwd); - } - - return flags; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: tcp_forward - * - * Description: - * Called by the IP forwarding logic when an TCP packet is received on - * one network device, but must be forwarded on another network device. - * - * Set up to forward the TCP packet on the specified device. This - * function will set up a send "interrupt" handler that will perform the - * actual send asynchronously and must return without waiting for the - * send to complete. - * - * Input Parameters: - * fwd - An initialized instance of the common forwarding structure that - * includes everything needed to perform the forwarding operation. - * - * Returned Value: - * Zero is returned if the packet was successfully forwarded; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller should free the IOB list and drop the packet. - * - ****************************************************************************/ - -int tcp_forward(FAR struct forward_s *fwd) -{ - DEBUGASSERT(fwd != NULL && fwd->f_dev != NULL); - FAR struct tcp_conn_s *conn = &fwd->f_conn.tcp; - - /* Set up some minimal connection structure so that we appear to be a - * real TCP connection. - */ - - conn->dev = fwd->f_dev; - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if ((fwd->f_hdr.ipv4.l2.vhl & IP_VERSION_MASK) == IPv4_VERSION) -#endif - { - FAR struct ipv4_hdr_s *ipv4 = &fwd->f_hdr.ipv4.l2; - FAR struct tcp_hdr_s *tcp = &fwd->f_hdr.ipv4.l3.tcp; - -#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) - conn->domain = PF_INET; -#endif - conn->lport = tcp->srcport; - conn->rport = tcp->destport; - net_ipv4addr_copy(conn->u.ipv4.laddr, ipv4->srcipaddr); - net_ipv4addr_copy(conn->u.ipv4.raddr, ipv4->destipaddr); - } -#endif -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { - FAR struct ipv6_hdr_s *ipv6 = &fwd->f_hdr.ipv6.l2; - FAR struct tcp_hdr_s *tcp = &fwd->f_hdr.ipv6.l3.tcp; - -#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) - conn->domain = PF_INET6; -#endif - conn->lport = tcp->srcport; - conn->rport = tcp->destport; - net_ipv6addr_copy(conn->u.ipv6.laddr, ipv6->srcipaddr); - net_ipv6addr_copy(conn->u.ipv6.raddr, ipv6->destipaddr); - } -#endif - - /* Set up the callback in the connection */ - - fwd->f_cb = tcp_callback_alloc(conn); - if (fwd->f_cb != NULL) - { - fwd->f_cb->flags = (TCP_POLL | NETDEV_DOWN); - fwd->f_cb->priv = (FAR void *)fwd; - fwd->f_cb->event = tcp_forward_interrupt; - - /* Notify the device driver of the availability of TX data */ - - netdev_txnotify_dev(fwd->f_dev); - return OK; - } - - return -EBUSY; -} - -#endif /* CONFIG_NET_IPFORWARD && CONFIG_NET_TCP && CONFIG_NETDEV_MULTINIC */ diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index 8b349884019..aefde83fd2e 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -285,7 +285,7 @@ static void tcp_input(FAR struct net_driver_s *dev, uint8_t domain, } } - nwarn("WARNING: Old packet .. reset\n"); + nwarn("WARNING: SYN with no listener (or old packet) .. reset\n"); /* This is (1) an old duplicate packet or (2) a SYN packet but with * no matching listener found. Send RST packet in either case. diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 7b6d7e639ef..afb8355a344 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -243,7 +243,7 @@ static inline void send_ipselect(FAR struct net_driver_s *dev, /* Select the IPv6 domain */ DEBUGASSERT(conn->domain == PF_INET6); - tcp_ipv4_select(dev); + tcp_ipv6_select(dev); } } #endif @@ -270,7 +270,8 @@ static inline void send_ipselect(FAR struct net_driver_s *dev, * conn - The TCP connection structure * * Returned Value: - * None + * true - The Ethernet MAC address is in the ARP or Neighbor table (OR + * the network device is not Ethernet). * * Assumptions: * Running at the interrupt level @@ -280,6 +281,15 @@ static inline void send_ipselect(FAR struct net_driver_s *dev, #ifdef CONFIG_NET_ETHERNET static inline bool psock_send_addrchck(FAR struct tcp_conn_s *conn) { + /* REVISIT: Could the MAC address not also be in a routing table? */ + +#ifdef CONFIG_NET_MULTILINK + if (conn->dev->d_lltype != NET_LL_ETHERNET) + { + return true; + } +#endif + #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 if (conn->domain == PF_INET) diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index 2de4a5a975d..e9f2a926278 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -194,7 +194,7 @@ static inline void tcpsend_ipselect(FAR struct net_driver_s *dev, /* Select the IPv6 domain */ DEBUGASSERT(conn->domain == PF_INET6); - tcp_ipv4_select(dev); + tcp_ipv6_select(dev); } } #endif @@ -221,7 +221,8 @@ static inline void tcpsend_ipselect(FAR struct net_driver_s *dev, * conn - The TCP connection structure * * Returned Value: - * None + * true - The Ethernet MAC address is in the ARP or Neighbor table (OR + * the network device is not Ethernet). * * Assumptions: * The network is locked. @@ -231,6 +232,15 @@ static inline void tcpsend_ipselect(FAR struct net_driver_s *dev, #ifdef CONFIG_NET_ETHERNET static inline bool psock_send_addrchck(FAR struct tcp_conn_s *conn) { + /* REVISIT: Could the MAC address not also be in a routing table? */ + +#ifdef CONFIG_NET_MULTILINK + if (conn->dev->d_lltype != NET_LL_ETHERNET) + { + return true; + } +#endif + #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 if (conn->domain == PF_INET) diff --git a/net/udp/Make.defs b/net/udp/Make.defs index 9dda0a16042..4b3992911df 100644 --- a/net/udp/Make.defs +++ b/net/udp/Make.defs @@ -48,14 +48,6 @@ NET_CSRCS += udp_netpoll.c endif endif -# IP forwarding - -ifeq ($(CONFIG_NET_IPFORWARD),y) -ifeq ($(CONFIG_NETDEV_MULTINIC),y) -NET_CSRCS += udp_forward.c -endif -endif - # Transport layer NET_CSRCS += udp_conn.c udp_devpoll.c udp_send.c udp_input.c udp_finddev.c diff --git a/net/udp/udp.h b/net/udp/udp.h index 91a690f5fe0..cb6ca378f5c 100644 --- a/net/udp/udp.h +++ b/net/udp/udp.h @@ -428,35 +428,6 @@ FAR struct net_driver_s *udp_find_raddr_device(FAR struct udp_conn_s *conn); uint16_t udp_callback(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn, uint16_t flags); -/**************************************************************************** - * Name: udp_forward - * - * Description: - * Called by the IP forwarding logic when an UDP packet is received on - * one network device, but must be forwarded on another network device. - * - * Set up to forward the UDP packet on the specified device. This - * function will set up a send "interrupt" handler that will perform the - * actual send asynchronously and must return without waiting for the - * send to complete. - * - * Input Parameters: - * fwd - An initialized instance of the common forwarding structure that - * includes everything needed to perform the forwarding operation. - * - * Returned Value: - * Zero is returned if the packet was successfully forwarded; A negated - * errno value is returned if the packet is not forwardable. In that - * latter case, the caller should free the IOB list and drop the packet. - * - ****************************************************************************/ - -#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6) && \ - defined(CONFIG_NETDEV_MULTINIC) -struct forward_s; /* Forward reference */ -int udp_forward(FAR struct forward_s *fwd); -#endif - /**************************************************************************** * Name: psock_udp_send *