You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/06/02 14:09:18 UTC
[incubator-nuttx] branch SocketCAN updated (79e58cb -> 5f0179e)
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a change to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
discard 79e58cb Use LPO 32Khz clock for RTC
discard bf1ac2f Backport code style fixes
discard 3a0f32b NET_CAN_RAW_TX_DEADLINE use relative time with watchdog Instead of a polling timer, also every mailbox get its own watchdog and gets cancelled when a tx interrupt for the corresponding mailbox occurs.
discard 43c1269 Made can/error.h nxstyle compliant
discard 7308aa6 Implement NET_CAN_RAW_TX_DEADLINE in SocketCAN and S32K1XX FlexCAN driver
discard bae5408 Code style fixes 4
discard 98c957a Socket: Control message addded initial stubs for sendmsg()
discard 2da296d Code style fixes 3
discard d4e2851 Code style fixes 2
discard 8c195c2 Code style fixes
discard 69bc44b S32K1XX SocketCAN style fixes
discard 5a8ec79 S32K1XX Added High res timer support FlexCAN allocate memory for timestamp
discard ecd3ef7 Added support for SO_TIMESTAMP in socketlayer and SocketCAN Cleanup FlexCAN driver driver Disabled workqueue based TX in FlexCAN
discard bf7b307 Added support for SO_TIMESTAMP in socketlayer and SocketCAN Cleanup FlexCAN driver driver Disabled workqueue based TX in FlexCAN
discard 53221d2 Added devif_cansend.c (forgotten in commit e485581)
discard 9359fd3 SocketCAN added protocol 0 to suport netlib_ifup with NET_PKT disabled
discard 010709b Added functional support for CAN_RAW_FILTER sockopt
discard d34a54d SocketCAN recfrom added non-blocking behavior support FlexCAN support sending extended CAN id
discard a99d7da SocketCAN removed NET_TCP and NET_PKT dependencies
discard 1f93523 Fixed SocketCAN IOB default config and IOB typos
discard 6d19a98 Added CAN_RAW_FD_FRAMES sockopt support
discard 83af55a FlexCAN transmit CAN FD support
discard 94a5f0e Added CAN FD driver support
discard 320800e PR350 Coding Standard Corrections
discard fa8f658 Added basic poll()/select support
discard c44f97c SocketCAN initial receive working as well
discard 4d7f440 Added GPIO code to test SocketCAN performance
discard 9b9b636f PoC S32K1XX FlexCAN sends CAN msgs through SocketCAN
discard 26738d4 net/: Add WIP initial framework for SocketCAN sockets.
discard fa2c7a61 include/netpacket/can.h: Add CAN socket family definitions
discard 7db039b include/sys/socket.h: Add CAN socket family.
add fe0ba38 fs/littlefs: upgrade littlefs to v2.2.1
add 63b3737 CI: Add logic for determining which branches of OS App and Testing repos should be used
add f07067d Update timer_gettime.c
add 4476a16 README.txt: Address issues raised in -RC0 review
add ee3ad39 Remove improper uImage file
add 9a17ed4 NOTICE: Move "This product includes software developed at the ASF” to the top
add 38bd036 stm32l4_lptim: add various functions
add d5eaa68 stm32l4_lptim: nxstyle fixes
add f0033f7 stm32l4_lptim: nxstyle fix
add 977f319 stm32l4_lptim: nxstyle fix
add e3e9b9a Fix a typo in PR860
add 2a76451 stm32l4 PWR: add VOS setting function
add 891acc5 stm32l4x6 RCC: fix MSI clock speed setting
add 34bf9b2 stm32l4x6 RCC: set CORE regulator range according to CPU clock
add e9319fa stm32l4x6 RCC: allow choosing HSI, MSI or HSE as SYSCLK instead of PLL to reduce power
add a0d4370 STM32L4 RCC/PWR: nxstyle fixes
add 3fcb441 STM32L4 PWR/RCC: nxstyle
add ff85335 fix use of undefined CONFIG_STM32L4_LPTIM1_CH1POL
add 436979b STM32L4 PWM: nxstyle
add a0d4e61 STM32L4 PWM: nxstyle
add e496618 Remove the obsolete ChangeLog file
add 6168f3e Remove tools/logparser.c
add bd4fceb graphics: Correct various typo error
add 9a7d5fa graphics/nxglib: Remove clean target from Makefile.*
add 87a029b Update the disclaimer to note that some ASF files don't have correct ASF header
add 4d5bbcf Update disclaimer
add 2376d8a Porting arch/armv8-m support
add d6f7821 Docs and comments: Change OSX -> macOS
add 6766aa0 Mea Culpa. Fix nxstyle problems from PR879
add 15f003d arch/arm/src/armv8-m: Rename files to correspond to naming conventions.
add 0106033 More compliance to the naming standard.
add 4cb8be9 arch/arm/src/stm32/stm32_adc.c: move adc_offset_set to llops section
add a85ffd0 arch/arm/src/stm32/stm32_adc.c: enable callback logic if DMA enabled
add 0e09d16 arch/arm/src/stm32/stm32_adc.c: fix injected channels configuration for ADC IPv1
add 1b4e0fd arch/arm/src/stm32/stm32_adc.h: move generalized ADC definitions to the header file
add f837bfe arch/arm/src/stm32/stm32_adc.h: add prefix STM32 to low-level ops macros
add 6b7b18e boards/arm/stm32/nucleo-f302r8/src/stm32_highpri.c: fix nxstyle issues
add 7cdd9b1 boards/arm/stm32/nucleo-f334r8/src/stm32_highpri.c: fix nxstyle issues
add a916000 boards/arm/stm32/stm32f334-disco/src/stm32_smps.c fix nxstyle issues
add b2c7f1e boards/arm/stm32/stm32f429i-disco/src/stm32_highpri.c: fix nxstyle issues
add de4c9e0 README.txt: Improve links to Windows kconfig-frontends
add a0fdda6 arch/z80: Fix z80 file naming
add dcd50db Run files in previous commit through nxstyle, fixing issues.
add bd7217e Remove boilerplate from the PR template.
add 546e35f drivers/rptun: replace 'rxbuf_size' and 'txbuf_size' to 'buf_size' in struct 'rptun_rsc_s'.
add 927cb00 fix nxstyle warning
add 4ec8fd5 arch/sim: change 'VIRTIO_RPMSG_F_BIND' to 'VIRTIO_RPMSG_F_ACK'
add ef9735f arch/sim: initialize 'rxbuf_size' and 'txbuf_size' instead of 'buf_size'.
add 32597a7 arch/mips: Fix file naming.
add e9773ad syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used
add 972033a syslog: Check sc_flush in't NULL before invocation
add 2bfc03f openamp: Download libmetal and open-amp from github
add e5443a4 Remove a duplicate file introduced by the previous PR.
add ba0a17c libc/netdb: make getaddrinfo re-entrant also when querying with service name
add b34d7bf libc/netdb: support multiple DNS nameservers when not using resolv.conf
add daedc1f openamp: Download libmetal and open-amp from github
add 67b10fe syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used
add ac55fab syslog: Check sc_flush in't NULL before invocation
add 434086f Merge branch 'master' of github.com:apache/incubator-nuttx into openamp
add e11c1e7 tools/incdir.sh: Correct error in select of include path
add 100bd74 tools/sethost.sh: Correct error in setting a different host.
add 1b03a42 arch/arm/src/stm32/Kconfig - Remove redundant ARCH_CHIP configs
add 7ffccf7 Makefile: Remove KERNEL variable which isn't really used
add 0932f08 tools/zipme.sh: Let major.minor.patch argument optional
add 9400cf2 sched/group: On task creation, do not clone uninitialized descriptors.
add d6b24a4 build.yml: Remove -G from cibuild.sh command line
add ea58adb esp32-core/Make.defs: Remove "-MMD -MP" from ARCHCFLAGS
add ee9daea Remove the residual files in the distclean action
add f2f1d4d toots/testbuild.sh: Remove .version manually after distclean
add 2338921 libnx/nxfonts: change the generated file nxfonts_tom-thumb-4x6.c to nxfonts_bitmap_tom-thumb-4x6.c
add 97afe1c tools/refresh.sh: restore BOARD_DIR when refresh with a different host
add bd924bf syslog: correct to #ifdef CONFIG_SYSLOG_RPMSG to call syslog_rpmsg_init
add e006054 lpc31xx/ea3131: Fix ld-locked.inc can't find
add d2a2626 tiva/cc13x0: fix error 'TIVA_GPIO_BASE' undeclared
add 01ad7a8 stm32/mikroe-stm32f4: Fix nsh_romfsimg.h can't find
add ed2b567 stm32/mikroe-stm32f4: Fix the several macros undefine issue
add ab2e24b sama5d3x-ek/nxwm: Fix error: 'g_adcdev' undeclared
add 304ecb2 mikroe-stm32f4/fulldemo: Fix undefined reference to `stm32_spi2register'
add c82b446 Fix nxstyle issue
add 5b83906 net/usrsock: fix error: variable 'pos' is used uninitialized
add 1c483d8 arm/up_allocpage: fix warning: "PG_POOL_MAXL1NDX" is not defined
add 36108d8 lpc31xx/ea3131: Fix error: libboard.a can't find
add bf7dcbc sched/paging: Fix typo error in Make.defs
add bebc887 arch: x86_64: add no-relax to the linker flags
add fd38623 mm/iob/iob_clone.c: Correct newline character
add ddda00e Kconfig: Refine BUILD_FLAT, BUILD_PROTECTED and BUILD_KERNEL usage
add 1692c90 Revert "sama5d3x-ek/nxwm: Fix error: 'g_adcdev' undeclared"
add 5d12735 sama5d3x-ek/nxwm: Fix error: 'g_adcdev' undeclared
add d0bb7c1 Use NuttX's signal set functions inside the OS.
add f23a756 arch/z16: Correct file naming for coding standard
add 1aa9ff8 Run .c and .h files in this PR through nxstyle and fix complaints
add 45c168c sched/paging: Fix error: variable 'result' set but not used
add a5e4f04 drivers: wireless: Fix packet queue overflow in gs2200m.c
add 350ffb2 drivers: wireless: Improve packet receiving performance in gs2200m.c
add 1e47d60 boards: spresense: Improve memcpy/memset performance for wifi
add e479a97 boards: spresense: Enable tcpblaster and udpblaster for wifi
add 1dcf2c7 tmpfs: Fix tmpfs_foreach recursively removing files in directories
add aeebbd0 fs_tmpfs.c: Shorten long lines according to codestyle
add bab6118 sim: Add host mmap and perror support
add 40c990f Add missing Elf_Addr typedef
add 55ff12a arch/arm/src/common/up_exit.c: _exit should call arm_fullcontextrestore for armv8-m
add 317a8a8 arch/z16: Build update
add e2a65ce Rename up_fullcontextrestore to arm_fullcontextrestore
add a7558cf Run all .c and .h modified by the PR through nxstyle.
add b1e661e sama5/sam_tsd: Fix error: 'ret' may be used uninitialized
add bb4458b include/sys/stat.h: Per the POSIX standard, the atime, ctime and mtime fields have changed their type from time_t to struct timespec.
add 3d2cd14 Rename up_copyfullstate to arm_copyfullstate
add 3a82a20 Rename up_copyarmstate to arm_copyarmstate
add 6398a64 Rename up_saveusercontext to arm_saveusercontext
add 84ccee4 Rename up_switchcontext to arm_switchcontext
add a86884c Run all .c and .h files modifed in this PR through nxstyle.
add c6c712b arch/arm: Rename all up_*.c files to arm_*.c
add ee05672 Run all .c and .h files modified by this PR through nxstyle.
add 037c9ea arch/arm: Rename all up_*.h files to arm_*.h
add 21302fc arch/risc-v/src: Rename files starting by up_ to risc_ to conform to the naming standard.
add 6b4cc30 Remove the residual files in distclean
add 8b054db sim: Update hostfs after the recent struct stat timespec changes
add fe5cb95 builtin: Remove HAVE_BUILTIN_CONTEXT macro
add eca7059 Refine __KERNEL__ and CONFIG_BUILD_xxx usage in the code base
add f8a809e Fix nxstyle issue
add 542b684 arch/arm: Rename all up_*.S files to arm_*.S
add 1c024a6 Remove the argument from get_errno
add 261ce70 rpmsg/hostfs: fix: taking address of packed member may result in an unaligned pointer value
add c1beda5 sim: Suppress "has no symbols" warnings for macOS
add 2aa85fd arch/arm, board/arm: Rename all up_* functions to arm_*
add 17112f4 openamp: Update to 2020.04.0 release
add 2476aad sim: Fix librt can't find on macOS
add b0dbdd7 arch/arm, board/arm: Rename all up_ramvec_* functions to arm_ramvec_*
add 673640b Run all .c and .h modified by this PR through nxstyle
add f2aba8d build: Remove 'u' prefix from userspace library
add 4b1dab8 tools/LibTargets.mk: Pass EXTRAFLAGS to all sub make
add a2f657e build: Move KDEFINE to a common place(tools/Config.mk)
add bb29541 Remove garbage file accidentally added
add 8e21568 build.yml: Remove all tail space character
add b29efe4 .asf.yaml: Disable squash and merge option
add 8c0fc09 Vik memcpy() is already defined on string/Kconfig
add 54d0256 Remove the not existent CONFIG_XXX_CMNVECTOR
add 31c60c3 syscall: nx_task_spawn should exist in the flat build just like the protected build
add cbc931b arch/arm: Rename up_savestate and up_restorestate
add 6204e10 x86_64: Add nsh configuration with procfs bringup
add 4e7d59f Fix debug assert in ioctl to check if int will fit in unsigned long not be unsigned long
add f09e58f Update libs/libc/misc/lib_ioctl.c
add 01d32a2 arch/arm/stm32, stm32f7, stm32l4: Rename up_waste to stm32_waste
add da4c597 Run all .c and .h files modified by this PR through nxstyle.
add 1bab5b6 arch/arm/: Rename up_intstack_* to arm_intstack_*
add 7980673 fs/vfs: Add nx_seek function
add 6418d13 fs/vfs: Add nx_close function
add 65308ea fs/vfs: Add nx_stat function
add 4b53603 fs/vfs: Add nx_ioctl/nx_fcntl function
add 4c680bf fs/vfs: Rename fdesc_poll to fs_poll
add 8d1a0c2 binfmt: exec_spawn as internal function shouldn't modify errno
add 3c84278 sched: task_init as internal function shouldn't modify errno
add 5c748ce sched: Don't need call get_errno after task_activate
add a2f6dc9 errno: Rename get_errno_ptr to __errno
add d4bf61c x86_64: Set kernel entry to 1M to avoid EPT Violation
add e2a3266 arch/arm/src/stm32/stm32_adc: add interface to configure EXTSEL/JEXTSEL from low-level ops
add 7b0ee05 boards/arm/stm32: fix board configurations according to changes in previous commit
add 31607f7 fix nxstyle issues
add 5857c48 arch/arm/src/stm32/stm32_adc.c: setup/shutdown ADC instance only once
add b3a1aef arch/arm/src/stm32/stm32_adc.c: cosmetics
add 534ba2c arch/arm/src/stm32/stm32_adc: add setup and shutdown operations to the low-level interface
add f03ed73 arch/arm/src/stm32/stm32_adc.c: remove obsolete warnings
add 00933cf sched/sched: Add sched_get_stackinfo()
add 252f58f sched/sched/sched_get_stackinfo.c: Add some security.
add cd8492b boards: qemu-i486: Fix CONFIG_16550_UART0_IRQ number to handle console input
add 11bbe39 arch: x86: Add hlt instruction to save power in qemu_idle.c
add f6c6fea boards: qemu-i486: Enable procfs and builtin apps (hello/ostest) in nsh/defconfig
add d385169 boards: qemu-i486: Mount procfs in board_app_initialize()
add 1da8cd6 fs/vfs: Add nx_poll function
add 390f9a5 fs/vfs: Add nx_dup and nx_dup2 function
add de2a9d8 sched: add nx_wait, nx_waitid and nx_waitpid
add 929292f mqueue: Add nxmq_open/nxmq_close/nxmq_unlink function
add 32b79b2 Rename pipe2/mkfifo2 to nx_pipe/nx_mkfifo
add a9871f5 Resolve linking issues with x86_64 port
add 19afc57 Fix null pointer reference in x86_64 rng
add 4c24d91 Surpress unused rtcb variable
add 2405901 Use mempy to perform type punning for setting gdt entry
add aea90e7 Clean code to match nxstyle requirements
add 8110ea6 x86_64: Make sure to clone ap list in vasprintf
add 2d4a876 sched/semaphore/sem_holder.c: Remove DEBUGPANIC
add 370eb16 Restore Git Credentials on NuttX repo
add 2936f72 arch: x86_64: revoke lower 128MB mapping later, ldmxcsr require 32-bit address
add 8b86fae arch: x86_64: Check only XSAVE and rename __eanble_sse3 to __enable_sse_avx
add 521e635 arch: x86_64: fix style of intel64_lowsetup.c
add 093aa04 x86_64: Fix /dev/random rdrand implementation
add 1195228 Revert "sim: Suppress "has no symbols" warnings for macOS"
add 19cc84e sim: Suppress no symbol warnings for macOS
add 6604cdb fs: Remove all LIBC_IOCTL_VARIADIC related stuff
add d9d2fc0 debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
add c11325d stm32f103-minimum/src/stm32_tone: remove unnecessary call to tone start()
add 1ef0fe3 stm32f103-minimum/src/stm32_tone: fix style issues
add d96565a arch/arm/src/stm32h7: add support for oneshot timer
add 8d763d3 arch/arm/src/stm32h7/stm32_oneshot: fix style issues
add b1071cc libs/libc/tls/Kconfig: Add CONFIG_TLS_ALIGNED
add b7e7fba TLS_UNALIGNED (#2)
add bda24f0 libs/libc/tls/tls_getinfo.c: Add tls_get_info()
add 5c7a0bd Fix nxstyle complaints from files changed by this PR
add 8a0b2bc Added driver for the hdc1008 temperature/humidity sensor.
add 59fcd9a hdc1008: minor fixes to comments.
add b525218 Changed headers for apache 2.0 license
add 6906853 Improve proxy/stub parameter passing for variadic OS interfaces.
add 4ca19e7 arch: k210: Set CPU clock based on PLL0 settings
add ca8f0aa boards: maix-bit: Add descriptions on how to write nuttx.bin to SPI-Flash
add 180ddd0 syscall/README.txt: Describe new sycall.csv extensions.
add 7fa20cf board/sim: Change CONFIG_SYSTEM_USRSOCK_RPMSG to CONFIG_NETUTILS_USRSOCK_RPMSG
add 6077124 syscall/syscall.csv: Corect type for ioctl parameter
add 235d905 arch: x86_64: remove leftover debug output
add 9ab6b92 arch: x86_64: move the disable multiboot2 marco around to retain labels
add c63c8a3 arch: x86_64: Add real-mode bootstrap stub
add ffa2027 arch: x86_64: Add option to disable interrupt controller initialization
add 6b1f94e arch: x86_64: real-mode bootstrap code should jump to 1M
add 94bb2e0 syslog: Code outside libc shouldn't call nx_vsyslog directly
add 3e00d18 Fix nxstyle issue
add 1e3ec6e arch/: Implement Thread Local Storage for the rest of the architectures. The change consisted on modifying *_usestack.c and *_createstack.c
add a4dd967 arch/: Implement up_tls_info() for the rest of the architectures.
add d56c613 arch/avr,renesas,risc-v: The *_getsp function was moved to a header file, remove it from the different source files that used to implement it to avoid redefinitions.
add 6eb6d31 Fix nxstyle complaints
add 1cf62c7 arch: k210: Fix cpu1 hangup during boot with qemu
add d07fde0 Fix syscall lookup table
add 2c9f912 tools/pic32: update pic32 scripts to fix jobserver unavailable warning
add 8d8ceee boards/arm/stm32h7/stm32h747i-disco: support for FMC SDRAM
add 608e092 boards/arm/stm32h7/stm32h747i-disco: fix style issues
add 2c0381d syscall: Apply the new vararg syntax to fcntl
add a2d924e syscall: Fix typo error in cvs and header file
add 32cec2a syscall: Generate SYS_ number from syscall_lookup.h
add 1ad03a5 syscall: Generate STUB prototype automatically
add 930a446 sched/init/nx_start.c: Reinstate logic to remove compiler warning
add c2244a2 Remove CONFIG_TLS
add e74899f arch/risc-v/src/common/riscv_createstack.c: Fix the stack_color name.
add a6da3c2 arch/*/*_checkstack.c: Get aligned address only when CONFIG_TLS_ALIGNED is enabled.
add 3dca5eb Completes the Implementation of the TLS-based errno
add 26a1e76 Merge branch 'errno' of github.com:apache/incubator-nuttx into errno
add 958999c arch/mips/src/common/mips_usestack.c: Include tls.h header.
add 2d78ed7 arch/sim/src/nuttx-names.dat: Add __errno()
add f801d04 boards/Board.mk: Fix MSYS build problem w/ ZDS-II Toolchain
add 350131d CI: use 'git diff $commits' as a whole patchset to do checkpatch
add 610fa1a openamp: Fix libmetal build break for arm
add f2c9571 cxd56: Add input support to Spresense audio driver
add 4a3d28a fs: Move inode_checkflags from include/nuttx/fs/fs.h to fs/inode/inode.h
add de33f86 fs: Add nx_mount/nx_umount2 function
add b7d9229 Fix nxstyle issue
add e7e81dd tools/LibTargets.mk: Remove # from the action of syscall
add a6c82a2 tools/mksyscall: Unify the fixed and variable arguments process
add 9ce03b1 Move pthread-specific data into TLS
add 4301682 Fix up some problems/issues remaining from PR 1007
add 75a8883 net: netdev: Fix netdev_vioctl()
add b94a769 Revert "CI: use 'git diff $commits' as a whole patchset to do checkpatch"
add 027ffa1 boards: update the defconfig
add 0887203 tcp/conn: request arp before the 3-way handshake
add 8b28902 semaphore: do not assert if the count exceeds the limit
add a4218e2 include/nuttx/sched.h: Make naming of all internal names consistent:
add 4b44b62 Run nxstyle against all .c and .h files modified by this PR.
add f92dba2 sched/sched/sched.h: Make naming of all internal names consistent:
add 3ac629b Run all .c and .h files modifed by the PR though nxstyle.
add fbbf1df Fix minor spacing problems from 1017 and 1018
add 153eee6 Make more OS internal names consistent
add 5179747 Rename clock_systime[r|spec] to clock_systime_[ticks|timespec]
add d666aa6 drivers/mtd/filemtd.c: fix build error
add 46baccb Remove unnecessary enter/leave_critical_section() in setlogmask() because it is MT-unsafe.
add 2b5ff17 setlogmask(): Add comments
add b4dceaa tools/refresh.sh: shouldn't redirect "make oldconfig" to /dev/null
add 3f83d2d tools/refresh.sh: replace cmpconfig with diff
add 92c721a boards: Fix the wrong order in some defconfig
add f60b79f Add defconfig for maix-bit:knsh
add 1d77061 boards: maix-bit: Update knsh/defconfig
add 78c8b43 libs/libxx: add .cpp files build support
add 21557ac ea3131/scripts/pg-ld.script: Rename up_head.o to arm_head.o
add 77f15c8 arch: cxd56xx: Apply the latest cxd56_dma.c and cxd56_spi from SDK
add 65b3acc boards: cxd56xx: Add SPI DMA support to cxd56_gs2200m.c
add ef169b7 drivers: wireless: Handle multiple incoming packets in gs2200m.c
add 7ffafa3 Remove executable bit from source code
add 9607152 arm/gic: Don't pirnt log in arm_decodeirq
add 4664642 Board specific code moved to boards directory and ipv6 support added
add 3d7678a nxstyle corrections for .c and .h file modified by PR1030
add 63e3054 Don't need monitor IOB buffer empty event for POLLOUT implementation
add 2ef5714 arch/arm/src/stm32h7/stm32_allocateheap.c: Fix compilation when CONFIG_MM_REGIONS == 1
add d618dad arch/arm/src/stm32h7/Make.defs: arm_mpu.c was added twice
add db492ca arch/arm/src/stm32h7/stm32_ethernet.c: Break long lines to pass style checks
add 4967352 arch/arm/src/stm32h7/stm32_ethernet.c: Comment and debug assertion fixes
add 63af18e arch/arm/src/stm32h7/stm32_spi.c: Fix long lines to pass style checks
add ace63ef arch/arm/src/stm32h7/stm32_spi.c: Remove un-used local variable
add d1c406d arch/arm/src/stm32h7/stm32_spi.c: Correct cache flush
add 574b259 arch/arm/src/stm32h7/stm32_spi.c: Correct the dmacapable check
add e989147 arch/arm/src/stm32h7: Add support for spi simplex configurations
add 801b9d6 arch/arm: Remove support for old redundant toolchains.
add edafecc stm32: make BMP180 initialization part of stm32 board-common logic
add cf8206a nxstyle fixes
add d444df5 stm32: move APA102, VEML6070 and MAX6675 initialization to board common logic
add 717fa46 stm32: move nunchuck driver to common board logic
add 35471e3 stm32: move ssd1306 and tone driver handling to common board logic
add 7c7836d stm32: move lm75 handling into common board logic; delete unused lm75 file for stm3210e-eval
add 944ed5a stm32: move NRF24L01 support into common board logic
add 64987db stm32: use macros from board.h to pass configuration to common board logic, not structs
add 6ca4652 stm32: migrate all boards to common logic system (Makefile -> Make.defs)
add c442725 nxstyle fix
add 126be36 stm32: fix NRF24L01 initialization for stm32_tiny
add 382ccf7 nxstyle fixes
add beba7a8 stm32: move HCSR04 initialization to common board logic
add 562210a stm32: move APDS9960 initialization to common board logic
add cf1ff36 stm32: move zerocross sensor initialization to common board logic
add 856c3e4 nxstyle fixes
add 4fdf252 stm32: move qencoder initialization to common board logic
add 60d51f2 nxstyle fixes
add 05e005c stm32: move ina219 initialization to common board logic directory
add 5fd9bd5 stm32: moved all remaining sensor initialization to common board logic
add 2d8a534 nxstyle
add e0d2127 fix all remaining nxstyle errors
add c86258c stm32 nunchuck: small fixes
add 21c588b drivers: wireless: Add support for getsockname() to gs2200m
add 3ead63c drivers: wireless: Fix to bind() with port=0 in gs2200m.c
add d2de923 boards: spresense: Add support ftpc and ftpd to wifi/defconfig
add 2a47370 include: wireless: Fix style violations in ioctl.h
add 0bd5dda boards: spresense: Remove CONFIG_EXAMPLES_FTPC=y to avoid compile error on CI
add 608436a net/sockopt: do not set the errno to SO_ERROR
add 03f462c net/sockopt: fix nxstyle warning
add 9cc2f50 netdev/register: configurable net packet size
add 8bce416 sim/tapdev: follow the tunnel MTU size
add a586886 net: remove unnecessary spaces
add 8d98581 Fix typos
add 573f027 netdev_ioctl: Update a comment
add f9a886f arch/arm/src/stm32h7/stm32_flash.c: Lock flash option register
add de8f3b7 arch/arm/src/stm32h7/stm32_flash.c: fix write and erase
add 1e0f416 arch/arm/src/stm32h7: Make flash program size configurable
add 8f559b1 arch/arm/src/stm32h7/stm32_dma.c: Split long lines to pass style checks
add f5571b2 arch/arm/src/stm32h7/stm32_dma.c: Fix DEBUGASSERT compilation
add c7acbb8 arch/arm/src/stm32h7/stm32_dma.c: Allow transfer from peripheral to AXI SRAM
add a532b0b arch/arm/src/stm32h7/stm32_dma.c: Optimization for stm32_sdma_capable
add 1071934 arch/arm/src/stm32h7/stm32_sdmmc.c: Fixes for IDMA transfer and cache usage
add b36420e Bump the default of CONFIG_NETDB_BUFSIZE
add e783a59 netdb: Truncate the list of ips instead of bailing out with ERANGE
add 76add63 Bump the default of CONFIG_NETDB_DNSCLIENT_MAXRESPONSE
add 60b404e drivers: wireless: Apply max payload size to gs2200m.c
add 7a62a59 net/conn: generate port base dynamically
add 87af256 net/udp: fix nxstyle warning
add 35efcee net/netdev/netdev_register.c: Add some comments.
add 369293d boards/arm/stm32h7/stm32h747i-disco: bring support for SDMMC
add 07bd520 arch/arm/src/stm32h7/stm32_sdmmc: check IDMA buffer address
add 583d81e boards/arm/stm32h7/stm32h747i-disco: bring FAT DMA allocator
add 2d43c57 boards/arm/stm32h7/stm32h747i-disco: SDMMC card detect interrupt
add 4585af3 boards/arm/stm32h7/stm32h747i-disco: change the license header of all new files to an Apache 2.0 license.
add 671191d boards/arm/stm32h7/stm32h747i-disco: fix nxstyle warnings
add e6a984d arch/arm/src/stm32h7/stm32_sdmmc.c: Fix wrong selection in modifying the conflict.
add d823a3a sched/: Make more naming consistent
add 00ed37b sched/: Run nxstyle on all .c/.h files modified by PR.
add 54c6431 Fix some very minor spacing problems.
add d938b50 arch/sim: Fix multiple definition of `g_cpu_wait' and `g_cpu_paused'
add a569006 sched/: Make more naming consistent
add 57bc329 Run nxstyle all .c and .h files modified by PR.
add cddd64f armv8-m: Add stack overflow by stack pointer limit register
add 86a412d arch/stack: fix check stack breakage
add 05ebb39 arch: complete logic in create/use stack to support stack coloration.
add bd65688 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
add 5eae325 build: Move INCDIROPT to common place
add 3334b40 nxstyle: Allow Hz, KHz, GHz in identifiers
add d5c45fb boards: lm3s6965-ek: Update discover/defconfig
add 6c4ef7b build: mkexport.sh copy Config.mk to tools folder too
add bb39907 boards: spresense: Add ftpc and ftpd to rndis/defconfig
add 3387da6 boards: spresense: Add ftpc to wifi/defconfig
add c7500c5 net: tcp: Fix port info in warning message in tcp_input.c
add 624b50f stm32: serial: nxstyle fixes
add 387d33c stm32: allocateheap: nxstyle fixes
add 5fe9085 stm32: lowputc: nxstyle fixes
add 6e94eff build: Make all variables inside Configs.mk overwritable
add 9ec9431 build: Move DIRLINK/DIRUNLINK definition to common place
add 8b42ee4 build: Move MKDEP definition to common place
add 5e7342b build: Move V definition to common place
add 567962b build: Move the extension definition to common place
add 7faf3c0 build: replace ${TOPDIR} with $(TOPDIR) in Makefile
add 48da64f Redo "Fix make target dependencies"
add a3b643f olimex-stm32-p407: update HAVE_MODSYMS judge for protected build
add 3b62765 nxstyle: Fix distinction be source and header file for long lines.
add ca8585e stm32: nxstyle fixes
add 611aa8b Documentation/NuttXCCodingStandard.html: Fix description of comments on the right.
add 28a0efb boards: imxrt1060-evk: Update netnsh/defconfig
add 34286df stm32: nxstyle fixes
add 62c5593 stm32: nxstyle fixes
add 3fdbff3 boards: spresense: Add nxplayer to rndis and wifi configs
add 3c622db drivers: wireless: Fix pkt_q_cnt overflow in gs2200m.c
add 1a95cce build: Move .config check to the top Makefile
add cf867b2 Makefile: Set the default goal to a target that prints what's going on.
add 65e81a6 drivers: wireless: Add do packet flow cotrol in gs2200m_ioctl_close()
add 76e2169 boards: spresense: Increase CONFIG_CXD56_AUDIO_NUM_BUFFERS for streaming
add 287b9f9 drivers: wireless: Add WPA2-PSK in AP mode for gs2200m
add adc0c3e build: parallel clean and distclean subdir build
add 154a879 fs/vfs/fd_open.c: fs_fdopen() must not set errno
add 31bb585 stm32h7:ethernet Use UUID for MAC
add 3b4e4c6 Add support for STM32G474: New files
add 168a4ca Add support for STM32G474: Modify existing files
add bb10e0f Add support for STM32G474: Add B-G474E-DPOW1 board
add f5482b5 stm32h7:stm32h7x3xx_irq STM32_IRQ_SDMMC->STM32_IRQ_SDMMC2
add bcf673a stm32h7 stm32h7x3xx_irq: Fix CS violation
add d930914 stm32h7:stm32h7x3xx_pinmap Fix missing |
add 21a96c4 stm32h7:ethernet Use proper Clock limits for H7
add 19111d9 stm32h7:stm32h7x3xx_rcc SDMMC2EN is in RCC_AHB2ENR
add 1c2e8cb stm32h7 stm32h7x3xx_rc: Fix CS violation
add 2a2ffe4 build: incdir.sh shouldn't check whether the path exist
add d2bb9bf tools/mkdeps: Always look in the current directory
add 02e028a tools/mkdeps: Fix the nxstyle problem
add dd61d3d build: Remve the unnecessary .gitignore
add 36c1f7c arch: tiva: Introduce tiva_idle.c
add 1f1dd43 b-g474e-dpow1: Run refresh.sh for nsh config
add 563d94d boards: lm3s6965-ek: Fix SYSCLK_FREQUENCY for QEMU
add c9aa98d boards: lm3s6965-ek: Update discover/defconfig
add 2e9a1b0 boards: lm3s6965-ek: Fix style violations in board.h
add edb0ce2 build: Don't need use $(DELIM) in include statement
add 1caf21b build: Remove the unused BOARD_INCLUDE variable
add 23668a4 build: Remove the empty variable assignment
add 7e5b0f8 build: Replace -I with INCDIR
add e83c140 build: Move BOARD_DIR definition to common place
add 8b20b97 build: Remove the dummy drivers folder under boards
add d66cb50 nrf52: add workaround to SPI Master 1 Byte transfer anomaly
add 3768511 arch/sim: Fix hostfs.h No such file or directory in makedep
add f6c3296 fs/vfs/fs_stat.c: fill file size for block inode
add e1dbb6b Update fs/vfs/fs_stat.c
add 9345cb5 arch: x86: Set the idle task stack to prevent get/set errno on idle task resulting NULL reference
add 8188171 b-g474e-dpow1: Apply recent build script changes
add fefd893 fs/nfs/nfs_util.c: Fix compilation error
add dd9d987 fs/vfs/fs_stat.c: fill file size for mtd inode
add 82debdc Make task_init() and task_activate() internal OS functions.
add 4f1258f sama5: Disable CONFIG_NETUTILS_NETLIB_GENERICURLPARSER for a config
add 075334c drivers: wireless: Fix buffer overrun in gs2200m.c
add 56e7a90 build: exit normaly once catch 'make depend' and 'make context' failure case
add 3b75201 fs/vfs/fs_stat.c: correct style
add a4012bf stm32h7:stm32h7x3xx_rcc Select FDCAN clock source
add 6a9b3de tools/testbuild.sh: fix testbuild.sh called without -e option fail issue
add 8dda796 arch: imxrt: Set the low power mode to 'remain in run mode'
add 3f88f57 arch: imxrt: Fix style violations in imxrt_clockconfig.c
add f90968a stddef.h: Add max_align_t typedef
add 954d251 build: make sure nuttx bins generated after both pass1 and pass2 built done
add 2aa1f5c Remove the copied locked.r file in clean stage
add d2f10e7 sched/task/task_create.c: Correct logic in error handling
add b9042f5 sched/task/task_init.c: Add nxtask_uninit()
add 124e6ee sched/sched/sched_releasetcb.c: Handle custom stack allocations.
add b5dc837 build: Update make dependency to enable 'configure.sh config' parallel build
add 102c4c2 tools/testbuild.sh: Call makefunc with JOPTION directly
add 8d3c9a8 arch/arm/src/stm32h7/stm32_spi.h: Split long lines
add e030047 update to SPI slave intefaces
add b2a9a8c arch/arm/src/samv7/sam_spi_slave.c: Change for modified spi slave interface
add 48c88f2 arch/arm/src/stm32h7: Add the spi slave bus control driver
add 1c002e1 fs/vfs/fs_fstat: Correct fstat() for proxied block and MTD drivers.
add 7f018e7 fs/nfs/nfs_proto.h: Use of uint64_t in the data types breaks NFS functionality.
add 20ef084 Fix the indentation and spacing that don't conform to the coding standard.
add 560ba3a usbhost: adds a driver for the FTDI FT232R USB to serial converter
add 5a9f792 nxstyle fixes
add 738f3c6 drivers/usbhost/usbhost_ft232r.c: Cosmetic
add f47151f Updated Rx65n rtc for non CONFIG_RTC_HIRES
add 1b8c072 stm32h7:stm32_spi Restores internal DMA buffer broken in 574b25
add b111e13 tools/incdir.c: Add faster, C version of incdir.sh
add 981734e tools/Makefile.host: Add incdir binary to Makefile.host
add 5555070 tools/: Hook incdir.c into build system.
add e92c91c tools/incdir.c: Various fixes to get a clean build
add 5d540f4 boards/arm/stm32/stm32f4discovery/scripts/Make.defs: Pre-calculate include paths
add 1414c55 boards/arm: Leverage PR 1150 to other ARM Make.defs
add 8190041 boards/mips: Leverage PR 1150 to MIPS make.defs.
add e018309 tools/Makefile*: Clean tools binaries at the end of distclean.
add 18e4ab9 Makefile: Build the tools/incdir binary immediately.
add 20615a9 Do not rewrite the root directory if it has not changed
add 198b8ae boards: Leverage PR 1150 to all remaining board Make.defs
add 0f7c2d6 fs/fat: Run all .c and .h files through nxstyle
add 06972c0 dps.h: Remove CONFIG_LIBM and CONFIG_ARCH_MATH_H
add 274ee57 x86_64: Use gcc compiler instead of clang for macOS
add f6a87c5 arch: Change dependence from ELF to LIBC_ARCH_ELF
add b932b65 arch: Select 64bit elf base on the architecture characteristic
add 9b87732 Fix wrong prefix on x86_64 builds in macOS
add 806710b drivers: wireless: New flow control based on total bulk size in gs2200m.c
add eac66d7 lib/stdlib: Change some macro to inline function
add b8b61dc lib/stdlib: Implement aligned_alloc and posix_memalign
add d1343df libc/time: Implement timespec_get for C11
add 1f8de34 net/inet/inet_sockif.c: Fix debugassert compilation
add 17e4582 net/inet/inet_sockif.c: Fix long lines
add ed0c38c arch/intel64: Don't include immintrin.h
add 43183e5 drivers/serial/pty.c: Correct returned number of bytes.
add 1041100 sched/task/task_spawn.c: Fix duplicate task_spawn()
add 0e42558 include/nuttx/video/video.h: Move global variable declaration out of header file
add 4fe0f3d stdint.h: Fix a comment
add 4f0957a threads.h: Support mtx_timedlock and recursive mutex
add d884dd3 Fix nxstyle complaints
add 86b7c20 Implement "j" modifier for printf format
new 53fe91c include/sys/socket.h: Add CAN socket family.
new 9ec0f58 include/netpacket/can.h: Add CAN socket family definitions
new 46c67a4 net/: Add WIP initial framework for SocketCAN sockets.
new d600a3d PoC S32K1XX FlexCAN sends CAN msgs through SocketCAN
new 5076da1 Added GPIO code to test SocketCAN performance
new 72d1045 SocketCAN initial receive working as well
new b76d609 Added basic poll()/select support
new a848408 PR350 Coding Standard Corrections
new 437ca3a Added CAN FD driver support
new 6d8e06b FlexCAN transmit CAN FD support
new 1fa53ed Added CAN_RAW_FD_FRAMES sockopt support
new e67d2cb Fixed SocketCAN IOB default config and IOB typos
new 8bc2922 SocketCAN removed NET_TCP and NET_PKT dependencies
new 8d24e58 SocketCAN recfrom added non-blocking behavior support FlexCAN support sending extended CAN id
new 1f32cf3 Added functional support for CAN_RAW_FILTER sockopt
new d6502bc SocketCAN added protocol 0 to suport netlib_ifup with NET_PKT disabled
new 785ef9d Added devif_cansend.c (forgotten in commit e485581)
new 754b9ae Added support for SO_TIMESTAMP in socketlayer and SocketCAN Cleanup FlexCAN driver driver Disabled workqueue based TX in FlexCAN
new e017495 Added support for SO_TIMESTAMP in socketlayer and SocketCAN Cleanup FlexCAN driver driver Disabled workqueue based TX in FlexCAN
new cd52a3f S32K1XX Added High res timer support FlexCAN allocate memory for timestamp
new 5f13717 S32K1XX SocketCAN style fixes
new 8058234 Code style fixes
new 95d8441 Code style fixes 2
new 8a73721 Code style fixes 3
new b37b616 Socket: Control message addded initial stubs for sendmsg()
new c9844c2 Code style fixes 4
new f08151c Implement NET_CAN_RAW_TX_DEADLINE in SocketCAN and S32K1XX FlexCAN driver
new 059d448 Made can/error.h nxstyle compliant
new 0fe722c NET_CAN_RAW_TX_DEADLINE use relative time with watchdog Instead of a polling timer, also every mailbox get its own watchdog and gets cancelled when a tx interrupt for the corresponding mailbox occurs.
new ec7b886 Backport code style fixes
new 5f0179e Use LPO 32Khz clock for RTC
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (79e58cb)
\
N -- N -- N refs/heads/SocketCAN (5f0179e)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 31 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.asf.yaml | 8 +-
.github/PULL_REQUEST_TEMPLATE.md | 68 +-
.github/workflows/build.yml | 290 +-
.gitignore | 54 +-
ChangeLog | 27615 -------------------
DISCLAIMER-WIP | 2 +
Documentation/NuttXCCodingStandard.html | 11 +-
Documentation/NuttxPortingGuide.html | 34 +-
Documentation/NuttxUserGuide.html | 246 +-
Documentation/style.css | 4 +-
Kconfig | 9 +-
Makefile | 65 +-
NOTICE | 6 +-
README.txt | 180 +-
ReleaseNotes | 10 +-
TODO | 18 +-
arch/Kconfig | 3 +-
arch/arm/Kconfig | 61 +-
arch/arm/include/armv8-m/irq.h | 401 +
arch/arm/include/armv8-m/irq_cmnvector.h | 158 +
arch/arm/include/armv8-m/irq_lazyfpu.h | 176 +
arch/arm/include/armv8-m/nvicpri.h | 81 +
arch/arm/include/armv8-m/spinlock.h | 24 +
arch/arm/include/armv8-m/syscall.h | 248 +
arch/arm/include/irq.h | 42 +-
arch/arm/include/setjmp.h | 2 +-
arch/arm/include/stm32/chip.h | 142 +-
arch/arm/include/stm32/irq.h | 8 +-
arch/arm/include/stm32/stm32g47xxx_irq.h | 200 +
arch/arm/include/stm32h7/stm32h7x3xx_irq.h | 241 +-
arch/arm/include/syscall.h | 41 +-
arch/arm/include/tls.h | 52 +-
arch/arm/include/types.h | 47 +-
arch/arm/src/.gitignore | 2 -
arch/arm/src/Makefile | 83 +-
arch/arm/src/a1x/Make.defs | 63 +-
arch/arm/src/a1x/a1x_boot.c | 6 +-
arch/arm/src/a1x/a1x_irq.c | 4 +-
arch/arm/src/a1x/a1x_lowputc.c | 8 +-
arch/arm/src/a1x/a1x_pio.c | 4 +-
arch/arm/src/a1x/a1x_serial.c | 24 +-
arch/arm/src/a1x/a1x_timerisr.c | 2 +-
arch/arm/src/am335x/Make.defs | 61 +-
arch/arm/src/am335x/am335x_boot.c | 8 +-
arch/arm/src/am335x/am335x_can.c | 2 +-
arch/arm/src/am335x/am335x_clockconfig.c | 2 +-
arch/arm/src/am335x/am335x_gpio.c | 2 +-
arch/arm/src/am335x/am335x_gpioirq.c | 2 +-
arch/arm/src/am335x/am335x_i2c.c | 28 +-
arch/arm/src/am335x/am335x_irq.c | 4 +-
arch/arm/src/am335x/am335x_lcdc.c | 2 +-
arch/arm/src/am335x/am335x_lowputc.c | 8 +-
arch/arm/src/am335x/am335x_pinmux.c | 2 +-
arch/arm/src/am335x/am335x_serial.c | 24 +-
arch/arm/src/am335x/am335x_sysclk.c | 2 +-
arch/arm/src/am335x/am335x_timerisr.c | 2 +-
arch/arm/src/am335x/am335x_wdog.c | 2 +-
arch/arm/src/am335x/am335x_wdog.h | 2 +-
arch/arm/src/arm/Kconfig | 17 +-
arch/arm/src/arm/Toolchain.defs | 105 +-
arch/arm/src/arm/arm_allocpage.c | 243 +
arch/arm/src/arm/arm_assert.c | 376 +
arch/arm/src/arm/arm_blocktask.c | 173 +
arch/arm/src/arm/arm_cache.S | 229 +
arch/arm/src/arm/arm_checkmapping.c | 108 +
arch/arm/src/arm/arm_copyfullstate.c | 81 +
arch/arm/src/arm/arm_dataabort.c | 165 +
arch/arm/src/arm/arm_doirq.c | 119 +
arch/arm/src/arm/arm_fullcontextrestore.S | 111 +
arch/arm/src/arm/arm_head.S | 705 +
arch/arm/src/arm/arm_initialstate.c | 145 +
arch/arm/src/arm/arm_nommuhead.S | 196 +
arch/arm/src/arm/arm_pginitialize.c | 81 +
arch/arm/src/arm/arm_prefetchabort.c | 128 +
arch/arm/src/arm/arm_releasepending.c | 128 +
arch/arm/src/arm/arm_reprioritizertr.c | 184 +
arch/arm/src/arm/arm_saveusercontext.S | 118 +
arch/arm/src/arm/arm_schedulesigaction.c | 189 +
arch/arm/src/arm/arm_sigdeliver.c | 115 +
arch/arm/src/arm/arm_syscall.c | 72 +
arch/arm/src/arm/arm_unblocktask.c | 144 +
arch/arm/src/arm/arm_undefinedinsn.c | 63 +
arch/arm/src/arm/arm_va2pte.c | 121 +
arch/arm/src/arm/arm_vectoraddrexcptn.S | 83 +
arch/arm/src/arm/arm_vectors.S | 447 +
arch/arm/src/arm/arm_vectortab.S | 103 +
arch/arm/src/arm/up_allocpage.c | 243 -
arch/arm/src/arm/up_assert.c | 377 -
arch/arm/src/arm/up_blocktask.c | 173 -
arch/arm/src/arm/up_cache.S | 229 -
arch/arm/src/arm/up_checkmapping.c | 123 -
arch/arm/src/arm/up_copyfullstate.c | 81 -
arch/arm/src/arm/up_dataabort.c | 179 -
arch/arm/src/arm/up_doirq.c | 134 -
arch/arm/src/arm/up_fullcontextrestore.S | 111 -
arch/arm/src/arm/up_head.S | 705 -
arch/arm/src/arm/up_initialstate.c | 145 -
arch/arm/src/arm/up_nommuhead.S | 196 -
arch/arm/src/arm/up_pginitialize.c | 96 -
arch/arm/src/arm/up_prefetchabort.c | 143 -
arch/arm/src/arm/up_releasepending.c | 144 -
arch/arm/src/arm/up_reprioritizertr.c | 198 -
arch/arm/src/arm/up_saveusercontext.S | 118 -
arch/arm/src/arm/up_schedulesigaction.c | 189 -
arch/arm/src/arm/up_sigdeliver.c | 131 -
arch/arm/src/arm/up_syscall.c | 72 -
arch/arm/src/arm/up_unblocktask.c | 159 -
arch/arm/src/arm/up_undefinedinsn.c | 63 -
arch/arm/src/arm/up_va2pte.c | 121 -
arch/arm/src/arm/up_vectoraddrexcptn.S | 83 -
arch/arm/src/arm/up_vectors.S | 447 -
arch/arm/src/arm/up_vectortab.S | 103 -
arch/arm/src/arm/vfork.S | 10 +-
arch/arm/src/armv6-m/Kconfig | 32 +-
arch/arm/src/armv6-m/Toolchain.defs | 140 +-
arch/arm/src/armv6-m/arm_assert.c | 433 +
arch/arm/src/armv6-m/arm_blocktask.c | 147 +
arch/arm/src/armv6-m/arm_copyfullstate.c | 85 +
arch/arm/src/armv6-m/arm_doirq.c | 106 +
arch/arm/src/armv6-m/arm_dumpnvic.c | 101 +
arch/arm/src/armv6-m/arm_exception.S | 280 +
arch/arm/src/armv6-m/arm_fullcontextrestore.S | 95 +
arch/arm/src/armv6-m/arm_hardfault.c | 141 +
arch/arm/src/armv6-m/arm_initialstate.c | 144 +
arch/arm/src/armv6-m/arm_releasepending.c | 116 +
arch/arm/src/armv6-m/arm_reprioritizertr.c | 175 +
arch/arm/src/armv6-m/arm_saveusercontext.S | 90 +
arch/arm/src/armv6-m/arm_schedulesigaction.c | 199 +
arch/arm/src/armv6-m/arm_sigdeliver.c | 141 +
arch/arm/src/armv6-m/arm_signal_dispatch.c | 90 +
arch/arm/src/armv6-m/arm_signal_handler.S | 115 +
arch/arm/src/armv6-m/arm_svcall.c | 488 +
arch/arm/src/armv6-m/arm_switchcontext.S | 82 +
arch/arm/src/armv6-m/arm_systemreset.c | 66 +
arch/arm/src/armv6-m/arm_unblocktask.c | 130 +
arch/arm/src/armv6-m/arm_vectors.c | 97 +
arch/arm/src/armv6-m/nvic.h | 48 +-
arch/arm/src/armv6-m/svcall.h | 48 +-
arch/arm/src/armv6-m/up_assert.c | 434 -
arch/arm/src/armv6-m/up_blocktask.c | 162 -
arch/arm/src/armv6-m/up_copyfullstate.c | 85 -
arch/arm/src/armv6-m/up_doirq.c | 121 -
arch/arm/src/armv6-m/up_dumpnvic.c | 101 -
arch/arm/src/armv6-m/up_exception.S | 280 -
arch/arm/src/armv6-m/up_fullcontextrestore.S | 95 -
arch/arm/src/armv6-m/up_hardfault.c | 141 -
arch/arm/src/armv6-m/up_initialstate.c | 144 -
arch/arm/src/armv6-m/up_releasepending.c | 132 -
arch/arm/src/armv6-m/up_reprioritizertr.c | 188 -
arch/arm/src/armv6-m/up_saveusercontext.S | 105 -
arch/arm/src/armv6-m/up_schedulesigaction.c | 199 -
arch/arm/src/armv6-m/up_sigdeliver.c | 141 -
arch/arm/src/armv6-m/up_signal_dispatch.c | 91 -
arch/arm/src/armv6-m/up_signal_handler.S | 115 -
arch/arm/src/armv6-m/up_svcall.c | 498 -
arch/arm/src/armv6-m/up_switchcontext.S | 97 -
arch/arm/src/armv6-m/up_systemreset.c | 81 -
arch/arm/src/armv6-m/up_unblocktask.c | 145 -
arch/arm/src/armv6-m/up_vectors.c | 97 -
arch/arm/src/armv6-m/vfork.S | 10 +-
arch/arm/src/armv7-a/Kconfig | 22 +-
arch/arm/src/armv7-a/Toolchain.defs | 105 +-
arch/arm/src/armv7-a/arm_addrenv_shm.c | 47 +-
arch/arm/src/armv7-a/arm_allocpage.c | 2 +-
arch/arm/src/armv7-a/arm_assert.c | 62 +-
arch/arm/src/armv7-a/arm_blocktask.c | 26 +-
arch/arm/src/armv7-a/arm_checkmapping.c | 2 +-
arch/arm/src/armv7-a/arm_copyarmstate.c | 8 +-
arch/arm/src/armv7-a/arm_copyfullstate.c | 6 +-
arch/arm/src/armv7-a/arm_cpuhead.S | 2 +-
arch/arm/src/armv7-a/arm_cpuidlestack.c | 2 +-
arch/arm/src/armv7-a/arm_cpupause.c | 10 +-
arch/arm/src/armv7-a/arm_cpustart.c | 6 +-
arch/arm/src/armv7-a/arm_dataabort.c | 2 +-
arch/arm/src/armv7-a/arm_doirq.c | 6 +-
arch/arm/src/armv7-a/arm_fullcontextrestore.S | 16 +-
arch/arm/src/armv7-a/arm_gicv2.c | 31 +-
arch/arm/src/armv7-a/arm_gicv2_dump.c | 2 +-
arch/arm/src/armv7-a/arm_head.S | 4 +-
arch/arm/src/armv7-a/arm_initialstate.c | 4 +-
arch/arm/src/armv7-a/arm_l2cc_pl310.c | 6 +-
arch/arm/src/armv7-a/arm_pgalloc.c | 57 +-
arch/arm/src/armv7-a/arm_pghead.S | 4 +-
arch/arm/src/armv7-a/arm_pginitialize.c | 8 +-
arch/arm/src/armv7-a/arm_prefetchabort.c | 2 +-
arch/arm/src/armv7-a/arm_releasepending.c | 60 +-
arch/arm/src/armv7-a/arm_reprioritizertr.c | 72 +-
arch/arm/src/armv7-a/arm_restorefpu.S | 14 +-
arch/arm/src/armv7-a/arm_savefpu.S | 14 +-
arch/arm/src/armv7-a/arm_saveusercontext.S | 14 +-
arch/arm/src/armv7-a/arm_schedulesigaction.c | 94 +-
arch/arm/src/armv7-a/arm_scu.c | 2 +-
arch/arm/src/armv7-a/arm_sigdeliver.c | 58 +-
arch/arm/src/armv7-a/arm_signal_dispatch.c | 7 +-
arch/arm/src/armv7-a/arm_syscall.c | 80 +-
arch/arm/src/armv7-a/arm_unblocktask.c | 63 +-
arch/arm/src/armv7-a/arm_undefinedinsn.c | 2 +-
arch/arm/src/armv7-a/arm_va2pte.c | 2 +-
arch/arm/src/armv7-a/arm_vectoraddrexcptn.S | 2 +-
arch/arm/src/armv7-a/arm_vfork.S | 140 -
arch/arm/src/armv7-a/gic.h | 2 +-
arch/arm/src/armv7-a/l2cc.h | 6 +-
arch/arm/src/armv7-a/svcall.h | 44 +-
arch/arm/src/armv7-a/vfork.S | 125 +
arch/arm/src/armv7-m/Kconfig | 40 +-
arch/arm/src/armv7-m/Toolchain.defs | 158 +-
arch/arm/src/armv7-m/arm_assert.c | 456 +
arch/arm/src/armv7-m/arm_blocktask.c | 147 +
arch/arm/src/armv7-m/arm_cache.c | 823 +
arch/arm/src/armv7-m/arm_copyarmstate.c | 90 +
arch/arm/src/armv7-m/arm_copyfullstate.c | 62 +
arch/arm/src/armv7-m/arm_doirq.c | 90 +
arch/arm/src/armv7-m/arm_hardfault.c | 136 +
arch/arm/src/armv7-m/arm_initialstate.c | 144 +
arch/arm/src/armv7-m/arm_itm.c | 158 +
arch/arm/src/armv7-m/arm_itm_syslog.c | 192 +
arch/arm/src/armv7-m/arm_memfault.c | 77 +
arch/arm/src/armv7-m/arm_mpu.c | 388 +
arch/arm/src/armv7-m/arm_ramvec_attach.c | 95 +
arch/arm/src/armv7-m/arm_ramvec_initialize.c | 154 +
arch/arm/src/armv7-m/arm_releasepending.c | 120 +
arch/arm/src/armv7-m/arm_reprioritizertr.c | 175 +
arch/arm/src/armv7-m/arm_schedulesigaction.c | 435 +
arch/arm/src/armv7-m/arm_sigdeliver.c | 196 +
arch/arm/src/armv7-m/arm_signal_dispatch.c | 75 +
arch/arm/src/armv7-m/arm_stackcheck.c | 118 +
arch/arm/src/armv7-m/arm_svcall.c | 500 +
arch/arm/src/armv7-m/arm_systemreset.c | 66 +
arch/arm/src/armv7-m/arm_systick.c | 327 +
arch/arm/src/armv7-m/arm_trigger_irq.c | 98 +
arch/arm/src/armv7-m/arm_unblocktask.c | 131 +
arch/arm/src/armv7-m/arm_vectors.c | 92 +
arch/arm/src/armv7-m/gnu/arm_exception.S | 331 +
arch/arm/src/armv7-m/gnu/arm_fetchadd.S | 242 +
arch/arm/src/armv7-m/gnu/arm_fpu.S | 270 +
arch/arm/src/armv7-m/gnu/arm_fullcontextrestore.S | 79 +
arch/arm/src/armv7-m/gnu/arm_lazyexception.S | 350 +
arch/arm/src/armv7-m/gnu/arm_saveusercontext.S | 88 +
arch/arm/src/armv7-m/gnu/arm_setjmp.S | 162 +
arch/arm/src/armv7-m/gnu/arm_signal_handler.S | 103 +
arch/arm/src/armv7-m/gnu/arm_switchcontext.S | 81 +
arch/arm/src/armv7-m/gnu/arm_testset.S | 108 +
arch/arm/src/armv7-m/gnu/up_exception.S | 331 -
arch/arm/src/armv7-m/gnu/up_fetchadd.S | 242 -
arch/arm/src/armv7-m/gnu/up_fpu.S | 270 -
arch/arm/src/armv7-m/gnu/up_fullcontextrestore.S | 79 -
arch/arm/src/armv7-m/gnu/up_lazyexception.S | 350 -
arch/arm/src/armv7-m/gnu/up_saveusercontext.S | 88 -
arch/arm/src/armv7-m/gnu/up_setjmp.S | 162 -
arch/arm/src/armv7-m/gnu/up_signal_handler.S | 103 -
arch/arm/src/armv7-m/gnu/up_switchcontext.S | 81 -
arch/arm/src/armv7-m/gnu/up_testset.S | 108 -
arch/arm/src/armv7-m/gnu/vfork.S | 10 +-
arch/arm/src/armv7-m/iar/arm_fetchadd.S | 223 +
arch/arm/src/armv7-m/iar/arm_fullcontextrestore.S | 79 +
arch/arm/src/armv7-m/iar/arm_saveusercontext.S | 86 +
arch/arm/src/armv7-m/iar/arm_switchcontext.S | 81 +
arch/arm/src/armv7-m/iar/arm_testset.S | 92 +
arch/arm/src/armv7-m/iar/up_fetchadd.S | 223 -
arch/arm/src/armv7-m/iar/up_fullcontextrestore.S | 79 -
arch/arm/src/armv7-m/iar/up_saveusercontext.S | 86 -
arch/arm/src/armv7-m/iar/up_switchcontext.S | 81 -
arch/arm/src/armv7-m/iar/up_testset.S | 92 -
arch/arm/src/armv7-m/iar/vfork.S | 10 +-
arch/arm/src/armv7-m/mpu.h | 2 +-
arch/arm/src/armv7-m/ram_vectors.h | 12 +-
arch/arm/src/armv7-m/svcall.h | 8 +-
arch/arm/src/armv7-m/up_assert.c | 457 -
arch/arm/src/armv7-m/up_blocktask.c | 147 -
arch/arm/src/armv7-m/up_cache.c | 823 -
arch/arm/src/armv7-m/up_copyarmstate.c | 90 -
arch/arm/src/armv7-m/up_copyfullstate.c | 62 -
arch/arm/src/armv7-m/up_doirq.c | 90 -
arch/arm/src/armv7-m/up_hardfault.c | 136 -
arch/arm/src/armv7-m/up_initialstate.c | 144 -
arch/arm/src/armv7-m/up_itm.c | 156 -
arch/arm/src/armv7-m/up_itm_syslog.c | 192 -
arch/arm/src/armv7-m/up_memfault.c | 77 -
arch/arm/src/armv7-m/up_mpu.c | 388 -
arch/arm/src/armv7-m/up_ramvec_attach.c | 95 -
arch/arm/src/armv7-m/up_ramvec_initialize.c | 154 -
arch/arm/src/armv7-m/up_releasepending.c | 120 -
arch/arm/src/armv7-m/up_reprioritizertr.c | 174 -
arch/arm/src/armv7-m/up_schedulesigaction.c | 435 -
arch/arm/src/armv7-m/up_sigdeliver.c | 196 -
arch/arm/src/armv7-m/up_signal_dispatch.c | 76 -
arch/arm/src/armv7-m/up_stackcheck.c | 114 -
arch/arm/src/armv7-m/up_svcall.c | 500 -
arch/arm/src/armv7-m/up_systemreset.c | 66 -
arch/arm/src/armv7-m/up_systick.c | 325 -
arch/arm/src/armv7-m/up_trigger_irq.c | 98 -
arch/arm/src/armv7-m/up_unblocktask.c | 131 -
arch/arm/src/armv7-m/up_vectors.c | 92 -
arch/arm/src/armv7-r/Kconfig | 22 +-
arch/arm/src/armv7-r/Toolchain.defs | 105 +-
arch/arm/src/armv7-r/arm_assert.c | 57 +-
arch/arm/src/armv7-r/arm_blocktask.c | 26 +-
arch/arm/src/armv7-r/arm_copyarmstate.c | 51 +-
arch/arm/src/armv7-r/arm_copyfullstate.c | 57 +-
arch/arm/src/armv7-r/arm_dataabort.c | 2 +-
arch/arm/src/armv7-r/arm_doirq.c | 6 +-
arch/arm/src/armv7-r/arm_fetchadd.S | 2 +-
arch/arm/src/armv7-r/arm_fullcontextrestore.S | 16 +-
arch/arm/src/armv7-r/arm_gicv2.c | 4 +-
arch/arm/src/armv7-r/arm_head.S | 4 +-
arch/arm/src/armv7-r/arm_initialstate.c | 4 +-
arch/arm/src/armv7-r/arm_l2cc_pl310.c | 6 +-
arch/arm/src/armv7-r/arm_mpu.c | 2 +-
arch/arm/src/armv7-r/arm_prefetchabort.c | 2 +-
arch/arm/src/armv7-r/arm_releasepending.c | 60 +-
arch/arm/src/armv7-r/arm_reprioritizertr.c | 72 +-
arch/arm/src/armv7-r/arm_restorefpu.S | 14 +-
arch/arm/src/armv7-r/arm_savefpu.S | 14 +-
arch/arm/src/armv7-r/arm_saveusercontext.S | 14 +-
arch/arm/src/armv7-r/arm_schedulesigaction.c | 55 +-
arch/arm/src/armv7-r/arm_sigdeliver.c | 55 +-
arch/arm/src/armv7-r/arm_signal_dispatch.c | 7 +-
arch/arm/src/armv7-r/arm_syscall.c | 80 +-
arch/arm/src/armv7-r/arm_unblocktask.c | 63 +-
arch/arm/src/armv7-r/arm_undefinedinsn.c | 2 +-
arch/arm/src/armv7-r/arm_vectoraddrexcptn.S | 2 +-
arch/arm/src/armv7-r/arm_vfork.S | 140 -
arch/arm/src/armv7-r/l2cc.h | 6 +-
arch/arm/src/armv7-r/mpu.h | 2 +-
arch/arm/src/armv7-r/svcall.h | 44 +-
arch/arm/src/armv7-r/vfork.S | 125 +
arch/arm/src/armv8-m/Kconfig | 228 +
arch/arm/src/armv8-m/Toolchain.defs | 133 +
arch/arm/src/armv8-m/arm_assert.c | 456 +
arch/arm/src/armv8-m/arm_blocktask.c | 147 +
arch/arm/src/armv8-m/arm_cache.c | 823 +
arch/arm/src/armv8-m/arm_copyarmstate.c | 90 +
arch/arm/src/armv8-m/arm_copyfullstate.c | 62 +
arch/arm/src/armv8-m/arm_doirq.c | 90 +
arch/arm/src/armv8-m/arm_exception.S | 365 +
arch/arm/src/armv8-m/arm_fetchadd.S | 242 +
arch/arm/src/armv8-m/arm_fpu.S | 270 +
arch/arm/src/armv8-m/arm_fullcontextrestore.S | 79 +
arch/arm/src/armv8-m/arm_hardfault.c | 136 +
arch/arm/src/armv8-m/arm_initialstate.c | 150 +
arch/arm/src/armv8-m/arm_itm.c | 157 +
arch/arm/src/armv8-m/arm_itm_syslog.c | 192 +
arch/arm/src/armv8-m/arm_lazyexception.S | 383 +
arch/arm/src/armv8-m/arm_memfault.c | 77 +
arch/arm/src/armv8-m/arm_mpu.c | 388 +
arch/arm/src/armv8-m/arm_ramvec_attach.c | 95 +
arch/arm/src/armv8-m/arm_ramvec_initialize.c | 154 +
arch/arm/src/armv8-m/arm_releasepending.c | 120 +
arch/arm/src/armv8-m/arm_reprioritizertr.c | 175 +
arch/arm/src/armv8-m/arm_saveusercontext.S | 88 +
arch/arm/src/armv8-m/arm_schedulesigaction.c | 435 +
arch/arm/src/armv8-m/arm_setjmp.S | 162 +
arch/arm/src/armv8-m/arm_sigdeliver.c | 196 +
arch/arm/src/armv8-m/arm_signal_dispatch.c | 75 +
arch/arm/src/armv8-m/arm_signal_handler.S | 103 +
arch/arm/src/armv8-m/arm_stackcheck.c | 118 +
arch/arm/src/armv8-m/arm_svcall.c | 500 +
arch/arm/src/armv8-m/arm_switchcontext.S | 81 +
arch/arm/src/armv8-m/arm_systemreset.c | 66 +
arch/arm/src/armv8-m/arm_systick.c | 312 +
arch/arm/src/armv8-m/arm_testset.S | 108 +
arch/arm/src/armv8-m/arm_trigger_irq.c | 83 +
arch/arm/src/armv8-m/arm_unblocktask.c | 131 +
arch/arm/src/armv8-m/arm_vectors.c | 92 +
arch/arm/src/armv8-m/barriers.h | 42 +
arch/arm/src/armv8-m/dwt.h | 191 +
arch/arm/src/armv8-m/etm.h | 917 +
arch/arm/src/armv8-m/exc_return.h | 104 +
arch/arm/src/armv8-m/fpb.h | 167 +
arch/arm/src/armv8-m/itm.h | 185 +
arch/arm/src/armv8-m/itm_syslog.h | 66 +
arch/arm/src/armv8-m/mpu.h | 446 +
arch/arm/src/armv8-m/nvic.h | 697 +
arch/arm/src/armv8-m/psr.h | 72 +
arch/arm/src/armv8-m/ram_vectors.h | 103 +
arch/arm/src/armv8-m/svcall.h | 131 +
arch/arm/src/armv8-m/systick.h | 76 +
arch/arm/src/armv8-m/tpi.h | 200 +
arch/arm/src/armv8-m/vfork.S | 126 +
arch/arm/src/c5471/Make.defs | 22 +-
arch/arm/src/c5471/c5471_ethernet.c | 6 +-
arch/arm/src/c5471/c5471_irq.c | 22 +-
arch/arm/src/c5471/c5471_lowputc.S | 12 +-
arch/arm/src/c5471/c5471_serial.c | 16 +-
arch/arm/src/c5471/c5471_timerisr.c | 4 +-
arch/arm/src/c5471/c5471_vectors.S | 78 +-
arch/arm/src/c5471/c5471_watchdog.c | 6 +-
arch/arm/src/common/README_lwl_console.txt | 2 +-
arch/arm/src/common/arm_allocateheap.c | 169 +
arch/arm/src/common/arm_arch.h | 77 +
arch/arm/src/common/arm_checkstack.c | 230 +
arch/arm/src/common/arm_createstack.c | 274 +
arch/arm/src/common/arm_etherstub.c | 70 +
arch/arm/src/common/arm_exit.c | 175 +
arch/arm/src/common/arm_hostfs.c | 332 +
arch/arm/src/common/arm_idle.c | 78 +
arch/arm/src/common/arm_initialize.c | 237 +
arch/arm/src/common/arm_internal.h | 503 +
arch/arm/src/common/arm_interruptcontext.c | 63 +
arch/arm/src/common/arm_lowputs.c | 62 +
.../common/{up_lwl_console.c => arm_lwl_console.c} | 0
arch/arm/src/common/arm_mdelay.c | 70 +
arch/arm/src/common/arm_modifyreg16.c | 73 +
arch/arm/src/common/arm_modifyreg32.c | 73 +
arch/arm/src/common/arm_modifyreg8.c | 73 +
arch/arm/src/common/arm_pthread_start.c | 87 +
arch/arm/src/common/arm_puts.c | 63 +
arch/arm/src/common/arm_releasestack.c | 120 +
arch/arm/src/common/arm_semi_syslog.c | 83 +
arch/arm/src/common/arm_stackframe.c | 140 +
arch/arm/src/common/arm_task_start.c | 87 +
arch/arm/src/common/arm_udelay.c | 117 +
arch/arm/src/common/arm_usestack.c | 155 +
arch/arm/src/common/arm_vfork.c | 258 +
arch/arm/src/common/arm_vfork.h | 73 +
arch/arm/src/common/up_allocateheap.c | 187 -
arch/arm/src/common/up_arch.h | 92 -
arch/arm/src/common/up_checkstack.c | 232 -
arch/arm/src/common/up_createstack.c | 304 -
arch/arm/src/common/up_etherstub.c | 70 -
arch/arm/src/common/up_exit.c | 191 -
arch/arm/src/common/up_hostfs.c | 332 -
arch/arm/src/common/up_idle.c | 78 -
arch/arm/src/common/up_initialize.c | 252 -
arch/arm/src/common/up_internal.h | 514 -
arch/arm/src/common/up_interruptcontext.c | 63 -
arch/arm/src/common/up_lowputs.c | 62 -
arch/arm/src/common/up_mdelay.c | 70 -
arch/arm/src/common/up_modifyreg16.c | 73 -
arch/arm/src/common/up_modifyreg32.c | 73 -
arch/arm/src/common/up_modifyreg8.c | 73 -
arch/arm/src/common/up_pthread_start.c | 87 -
arch/arm/src/common/up_puts.c | 63 -
arch/arm/src/common/up_releasestack.c | 132 -
arch/arm/src/common/up_semi_syslog.c | 83 -
arch/arm/src/common/up_stackframe.c | 140 -
arch/arm/src/common/up_task_start.c | 87 -
arch/arm/src/common/up_udelay.c | 117 -
arch/arm/src/common/up_usestack.c | 176 -
arch/arm/src/common/up_vfork.c | 272 -
arch/arm/src/common/up_vfork.h | 88 -
arch/arm/src/cxd56xx/Make.defs | 50 +-
arch/arm/src/cxd56xx/cxd56_adc.c | 2 +-
arch/arm/src/cxd56xx/cxd56_allocateheap.c | 4 +-
arch/arm/src/cxd56xx/cxd56_cisif.c | 2 +-
arch/arm/src/cxd56xx/cxd56_clock.c | 2 +-
arch/arm/src/cxd56xx/cxd56_cpufifo.c | 2 +-
arch/arm/src/cxd56xx/cxd56_cpuidlestack.c | 2 +-
arch/arm/src/cxd56xx/cxd56_cpuindex.c | 2 +-
arch/arm/src/cxd56xx/cxd56_cpupause.c | 12 +-
arch/arm/src/cxd56xx/cxd56_cpustart.c | 6 +-
arch/arm/src/cxd56xx/cxd56_dmac.c | 37 +-
arch/arm/src/cxd56xx/cxd56_emmc.c | 2 +-
arch/arm/src/cxd56xx/cxd56_farapi.c | 4 +-
arch/arm/src/cxd56xx/cxd56_ge2d.c | 4 +-
arch/arm/src/cxd56xx/cxd56_gpio.c | 2 +-
arch/arm/src/cxd56xx/cxd56_gpioint.c | 2 +-
arch/arm/src/cxd56xx/cxd56_i2c.c | 6 +-
arch/arm/src/cxd56xx/cxd56_icc.c | 2 +-
arch/arm/src/cxd56xx/cxd56_idle.c | 2 +-
arch/arm/src/cxd56xx/cxd56_irq.c | 18 +-
arch/arm/src/cxd56xx/cxd56_pinconfig.c | 2 +-
arch/arm/src/cxd56xx/cxd56_powermgr.c | 4 +-
arch/arm/src/cxd56xx/cxd56_powermgr_procfs.c | 2 +-
arch/arm/src/cxd56xx/cxd56_pwm.c | 2 +-
arch/arm/src/cxd56xx/cxd56_rtc.c | 4 +-
arch/arm/src/cxd56xx/cxd56_scu.c | 2 +-
arch/arm/src/cxd56xx/cxd56_scufifo.c | 2 +-
arch/arm/src/cxd56xx/cxd56_sdhci.c | 4 +-
arch/arm/src/cxd56xx/cxd56_serial.c | 24 +-
arch/arm/src/cxd56xx/cxd56_sph.c | 2 +-
arch/arm/src/cxd56xx/cxd56_spi.c | 89 +-
arch/arm/src/cxd56xx/cxd56_start.c | 8 +-
arch/arm/src/cxd56xx/cxd56_timer.c | 2 +-
arch/arm/src/cxd56xx/cxd56_timerisr.c | 4 +-
arch/arm/src/cxd56xx/cxd56_uart.c | 8 +-
arch/arm/src/cxd56xx/cxd56_uart0.c | 2 +-
arch/arm/src/cxd56xx/cxd56_udmac.c | 2 +-
arch/arm/src/cxd56xx/cxd56_uid.c | 2 +-
arch/arm/src/cxd56xx/cxd56_usbdev.c | 14 +-
arch/arm/src/cxd56xx/cxd56_wdt.c | 2 +-
arch/arm/src/dm320/Make.defs | 24 +-
arch/arm/src/dm320/dm320_allocateheap.c | 4 +-
arch/arm/src/dm320/dm320_boot.c | 6 +-
arch/arm/src/dm320/dm320_decodeirq.c | 52 +-
arch/arm/src/dm320/dm320_framebuffer.c | 2 +-
arch/arm/src/dm320/dm320_gio.h | 2 +-
arch/arm/src/dm320/dm320_irq.c | 8 +-
arch/arm/src/dm320/dm320_lowputc.S | 12 +-
arch/arm/src/dm320/dm320_restart.S | 4 +-
arch/arm/src/dm320/dm320_serial.c | 16 +-
arch/arm/src/dm320/dm320_timerisr.c | 4 +-
arch/arm/src/dm320/dm320_usbdev.c | 18 +-
arch/arm/src/efm32/Make.defs | 51 +-
arch/arm/src/efm32/efm32_adc.c | 4 +-
arch/arm/src/efm32/efm32_clockconfig.c | 2 +-
arch/arm/src/efm32/efm32_dma.c | 6 +-
arch/arm/src/efm32/efm32_flash.c | 4 +-
arch/arm/src/efm32/efm32_gpio.c | 2 +-
arch/arm/src/efm32/efm32_gpioirq.c | 2 +-
arch/arm/src/efm32/efm32_i2c.c | 16 +-
arch/arm/src/efm32/efm32_idle.c | 2 +-
arch/arm/src/efm32/efm32_irq.c | 100 +-
arch/arm/src/efm32/efm32_leserial.c | 16 +-
arch/arm/src/efm32/efm32_lowputc.c | 2 +-
arch/arm/src/efm32/efm32_pm.h | 2 +-
arch/arm/src/efm32/efm32_pwm.c | 4 +-
arch/arm/src/efm32/efm32_rmu.c | 2 +-
arch/arm/src/efm32/efm32_rtc_burtc.c | 2 +-
arch/arm/src/efm32/efm32_serial.c | 16 +-
arch/arm/src/efm32/efm32_spi.c | 8 +-
arch/arm/src/efm32/efm32_start.c | 6 +-
arch/arm/src/efm32/efm32_timer.c | 4 +-
arch/arm/src/efm32/efm32_timerisr.c | 4 +-
arch/arm/src/efm32/efm32_usbdev.c | 16 +-
arch/arm/src/efm32/efm32_usbhost.c | 76 +-
arch/arm/src/imx1/Make.defs | 24 +-
arch/arm/src/imx1/imx_allocateheap.c | 8 +-
arch/arm/src/imx1/imx_boot.c | 6 +-
arch/arm/src/imx1/imx_decodeirq.c | 49 +-
arch/arm/src/imx1/imx_gpio.c | 2 +-
arch/arm/src/imx1/imx_gpio.h | 6 +-
arch/arm/src/imx1/imx_irq.c | 4 +-
arch/arm/src/imx1/imx_lowputc.S | 12 +-
arch/arm/src/imx1/imx_serial.c | 16 +-
arch/arm/src/imx1/imx_spi.c | 6 +-
arch/arm/src/imx1/imx_timerisr.c | 4 +-
arch/arm/src/imx6/Make.defs | 60 +-
arch/arm/src/imx6/chip.h | 10 +-
arch/arm/src/imx6/imx_boot.c | 4 +-
arch/arm/src/imx6/imx_boot.h | 2 +-
arch/arm/src/imx6/imx_clockconfig.c | 2 +-
arch/arm/src/imx6/imx_cpuboot.c | 4 +-
arch/arm/src/imx6/imx_ecspi.c | 6 +-
arch/arm/src/imx6/imx_gpio.c | 2 +-
arch/arm/src/imx6/imx_idle.c | 2 +-
arch/arm/src/imx6/imx_iomuxc.c | 2 +-
arch/arm/src/imx6/imx_irq.c | 2 +-
arch/arm/src/imx6/imx_lowputc.c | 4 +-
arch/arm/src/imx6/imx_lowputc.h | 2 +-
arch/arm/src/imx6/imx_serial.c | 10 +-
arch/arm/src/imx6/imx_serial.h | 6 +-
arch/arm/src/imx6/imx_timerisr.c | 2 +-
arch/arm/src/imxrt/Make.defs | 51 +-
arch/arm/src/imxrt/imxrt_allocateheap.c | 8 +-
arch/arm/src/imxrt/imxrt_clockconfig.c | 39 +-
arch/arm/src/imxrt/imxrt_clrpend.c | 2 +-
arch/arm/src/imxrt/imxrt_daisy.c | 2 +-
arch/arm/src/imxrt/imxrt_edma.c | 10 +-
arch/arm/src/imxrt/imxrt_ehci.c | 8 +-
arch/arm/src/imxrt/imxrt_enc.c | 2 +-
arch/arm/src/imxrt/imxrt_enet.c | 6 +-
arch/arm/src/imxrt/imxrt_enet.h | 6 +-
arch/arm/src/imxrt/imxrt_gpio.c | 2 +-
arch/arm/src/imxrt/imxrt_gpioirq.c | 2 +-
arch/arm/src/imxrt/imxrt_hprtc.c | 2 +-
arch/arm/src/imxrt/imxrt_idle.c | 2 +-
arch/arm/src/imxrt/imxrt_iomuxc.c | 2 +-
arch/arm/src/imxrt/imxrt_irq.c | 141 +-
arch/arm/src/imxrt/imxrt_lcd.c | 2 +-
arch/arm/src/imxrt/imxrt_lowputc.c | 4 +-
arch/arm/src/imxrt/imxrt_lowputc.h | 2 +-
arch/arm/src/imxrt/imxrt_lpi2c.c | 20 +-
arch/arm/src/imxrt/imxrt_lpspi.c | 4 +-
arch/arm/src/imxrt/imxrt_lpsrtc.c | 2 +-
arch/arm/src/imxrt/imxrt_ocotp.c | 10 +-
arch/arm/src/imxrt/imxrt_periphclks.c | 2 +-
arch/arm/src/imxrt/imxrt_rtc_lowerhalf.c | 2 +-
arch/arm/src/imxrt/imxrt_serial.c | 14 +-
arch/arm/src/imxrt/imxrt_serial.h | 4 +-
arch/arm/src/imxrt/imxrt_start.c | 4 +-
arch/arm/src/imxrt/imxrt_start.h | 2 +-
arch/arm/src/imxrt/imxrt_timerisr.c | 4 +-
arch/arm/src/imxrt/imxrt_usbdev.c | 12 +-
arch/arm/src/imxrt/imxrt_usdhc.c | 12 +-
arch/arm/src/imxrt/imxrt_userspace.h | 2 +-
arch/arm/src/imxrt/imxrt_wdog.c | 2 +-
arch/arm/src/imxrt/imxrt_wdog.h | 2 +-
arch/arm/src/imxrt/imxrt_xbar.c | 2 +-
arch/arm/src/kinetis/Make.defs | 61 +-
arch/arm/src/kinetis/kinetis.h | 8 +-
arch/arm/src/kinetis/kinetis_allocateheap.c | 4 +-
arch/arm/src/kinetis/kinetis_clockconfig.c | 2 +-
arch/arm/src/kinetis/kinetis_clrpend.c | 2 +-
arch/arm/src/kinetis/kinetis_dma.c | 6 +-
arch/arm/src/kinetis/kinetis_enet.c | 6 +-
arch/arm/src/kinetis/kinetis_i2c.c | 14 +-
arch/arm/src/kinetis/kinetis_idle.c | 2 +-
arch/arm/src/kinetis/kinetis_irq.c | 126 +-
arch/arm/src/kinetis/kinetis_lowputc.c | 8 +-
arch/arm/src/kinetis/kinetis_lpserial.c | 16 +-
arch/arm/src/kinetis/kinetis_pin.c | 4 +-
arch/arm/src/kinetis/kinetis_pindma.c | 4 +-
arch/arm/src/kinetis/kinetis_pindump.c | 2 +-
arch/arm/src/kinetis/kinetis_pingpio.c | 4 +-
arch/arm/src/kinetis/kinetis_pinirq.c | 4 +-
arch/arm/src/kinetis/kinetis_pwm.c | 4 +-
arch/arm/src/kinetis/kinetis_rtc.c | 2 +-
arch/arm/src/kinetis/kinetis_sdhc.c | 12 +-
arch/arm/src/kinetis/kinetis_serial.c | 16 +-
arch/arm/src/kinetis/kinetis_serialinit.c | 6 +-
arch/arm/src/kinetis/kinetis_spi.c | 2 +-
arch/arm/src/kinetis/kinetis_start.c | 4 +-
arch/arm/src/kinetis/kinetis_timerisr.c | 4 +-
arch/arm/src/kinetis/kinetis_usbdev.c | 12 +-
arch/arm/src/kinetis/kinetis_wdog.c | 2 +-
arch/arm/src/kl/Make.defs | 35 +-
arch/arm/src/kl/kl_clockconfig.c | 2 +-
arch/arm/src/kl/kl_dumpgpio.c | 2 +-
arch/arm/src/kl/kl_gpio.c | 4 +-
arch/arm/src/kl/kl_gpioirq.c | 2 +-
arch/arm/src/kl/kl_idle.c | 2 +-
arch/arm/src/kl/kl_irq.c | 12 +-
arch/arm/src/kl/kl_irqprio.c | 2 +-
arch/arm/src/kl/kl_lowputc.c | 6 +-
arch/arm/src/kl/kl_pwm.c | 4 +-
arch/arm/src/kl/kl_serial.c | 16 +-
arch/arm/src/kl/kl_spi.c | 2 +-
arch/arm/src/kl/kl_start.c | 8 +-
arch/arm/src/kl/kl_timerisr.c | 4 +-
arch/arm/src/lc823450/Make.defs | 45 +-
arch/arm/src/lc823450/chip.h | 8 +-
arch/arm/src/lc823450/lc823450_adc.c | 2 +-
arch/arm/src/lc823450/lc823450_allocateheap2.c | 8 +-
arch/arm/src/lc823450/lc823450_clockconfig.c | 2 +-
arch/arm/src/lc823450/lc823450_cpuidlestack.c | 2 +-
arch/arm/src/lc823450/lc823450_cpuindex.c | 2 +-
arch/arm/src/lc823450/lc823450_cpupause.c | 12 +-
arch/arm/src/lc823450/lc823450_cpustart.c | 6 +-
arch/arm/src/lc823450/lc823450_dma.c | 6 +-
arch/arm/src/lc823450/lc823450_dvfs2.c | 4 +-
arch/arm/src/lc823450/lc823450_gpio.c | 2 +-
arch/arm/src/lc823450/lc823450_i2c.c | 6 +-
arch/arm/src/lc823450/lc823450_i2s.c | 8 +-
arch/arm/src/lc823450/lc823450_idle.c | 4 +-
arch/arm/src/lc823450/lc823450_ipl2.c | 4 +-
arch/arm/src/lc823450/lc823450_irq.c | 102 +-
arch/arm/src/lc823450/lc823450_lowputc.c | 8 +-
arch/arm/src/lc823450/lc823450_mpuinit2.c | 2 +-
arch/arm/src/lc823450/lc823450_rtc.c | 2 +-
arch/arm/src/lc823450/lc823450_sdc.c | 4 +-
arch/arm/src/lc823450/lc823450_sddrv_dep.c | 60 +-
arch/arm/src/lc823450/lc823450_serial.c | 20 +-
arch/arm/src/lc823450/lc823450_spi.c | 2 +-
arch/arm/src/lc823450/lc823450_spifi2.c | 2 +-
arch/arm/src/lc823450/lc823450_start.c | 10 +-
arch/arm/src/lc823450/lc823450_syscontrol.c | 4 +-
arch/arm/src/lc823450/lc823450_testset.c | 2 +-
arch/arm/src/lc823450/lc823450_timer.c | 4 +-
arch/arm/src/lc823450/lc823450_usbdev.c | 6 +-
arch/arm/src/lc823450/lc823450_wdt.c | 2 +-
arch/arm/src/lpc17xx_40xx/Make.defs | 61 +-
arch/arm/src/lpc17xx_40xx/lpc176x_clockconfig.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc176x_gpio.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc176x_rtc.c | 4 +-
.../src/lpc17xx_40xx/lpc178x_40xx_clockconfig.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc178x_40xx_gpio.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_adc.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_allocateheap.c | 8 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_can.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_clockconfig.c | 22 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_clrpend.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_dac.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_emc.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c | 6 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_gpdma.c | 10 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_gpiodbg.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_gpioint.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c | 6 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_idle.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c | 99 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_lcd.c | 2 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_lowputc.c | 8 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_mcpwm.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_pwm.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_sdcard.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_serial.c | 24 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_start.c | 8 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_timer.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_timerisr.c | 4 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c | 14 +-
arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c | 10 +-
arch/arm/src/lpc214x/Make.defs | 22 +-
arch/arm/src/lpc214x/lpc214x_decodeirq.c | 80 +-
arch/arm/src/lpc214x/lpc214x_head.S | 32 +-
arch/arm/src/lpc214x/lpc214x_irq.c | 6 +-
arch/arm/src/lpc214x/lpc214x_lowputc.S | 14 +-
arch/arm/src/lpc214x/lpc214x_serial.c | 20 +-
arch/arm/src/lpc214x/lpc214x_timerisr.c | 4 +-
arch/arm/src/lpc214x/lpc214x_usbdev.c | 14 +-
arch/arm/src/lpc2378/Make.defs | 22 +-
arch/arm/src/lpc2378/lpc2378.h | 2 +-
arch/arm/src/lpc2378/lpc23xx_decodeirq.c | 46 +-
arch/arm/src/lpc2378/lpc23xx_head.S | 30 +-
arch/arm/src/lpc2378/lpc23xx_i2c.c | 6 +-
arch/arm/src/lpc2378/lpc23xx_io.c | 2 +-
arch/arm/src/lpc2378/lpc23xx_irq.c | 8 +-
arch/arm/src/lpc2378/lpc23xx_lowputc.S | 14 +-
arch/arm/src/lpc2378/lpc23xx_pllsetup.c | 2 +-
arch/arm/src/lpc2378/lpc23xx_serial.c | 18 +-
arch/arm/src/lpc2378/lpc23xx_spi.c | 4 +-
arch/arm/src/lpc2378/lpc23xx_timerisr.c | 2 +-
arch/arm/src/lpc31xx/Make.defs | 30 +-
arch/arm/src/lpc31xx/lpc31.h | 4 +-
arch/arm/src/lpc31xx/lpc31_allocateheap.c | 8 +-
arch/arm/src/lpc31xx/lpc31_bcrndx.c | 2 +-
arch/arm/src/lpc31xx/lpc31_boot.c | 24 +-
arch/arm/src/lpc31xx/lpc31_cgudrvr.h | 2 +-
arch/arm/src/lpc31xx/lpc31_clkdomain.c | 2 +-
arch/arm/src/lpc31xx/lpc31_clkfreq.c | 2 +-
arch/arm/src/lpc31xx/lpc31_decodeirq.c | 52 +-
arch/arm/src/lpc31xx/lpc31_ehci.c | 8 +-
arch/arm/src/lpc31xx/lpc31_esrndx.c | 2 +-
arch/arm/src/lpc31xx/lpc31_fdcndx.c | 2 +-
arch/arm/src/lpc31xx/lpc31_i2c.c | 6 +-
arch/arm/src/lpc31xx/lpc31_irq.c | 8 +-
arch/arm/src/lpc31xx/lpc31_lowputc.c | 10 +-
arch/arm/src/lpc31xx/lpc31_serial.c | 24 +-
arch/arm/src/lpc31xx/lpc31_softreset.c | 2 +-
arch/arm/src/lpc31xx/lpc31_timerisr.c | 4 +-
arch/arm/src/lpc31xx/lpc31_usbdev.c | 14 +-
arch/arm/src/lpc43xx/Make.defs | 49 +-
arch/arm/src/lpc43xx/chip.h | 51 +-
arch/arm/src/lpc43xx/lpc43_adc.c | 4 +-
arch/arm/src/lpc43xx/lpc43_aes.c | 4 +-
arch/arm/src/lpc43xx/lpc43_allocateheap.c | 8 +-
arch/arm/src/lpc43xx/lpc43_can.c | 4 +-
arch/arm/src/lpc43xx/lpc43_cgu.c | 2 +-
arch/arm/src/lpc43xx/lpc43_clrpend.c | 2 +-
arch/arm/src/lpc43xx/lpc43_dac.c | 4 +-
arch/arm/src/lpc43xx/lpc43_debug.c | 2 +-
arch/arm/src/lpc43xx/lpc43_ehci.c | 8 +-
arch/arm/src/lpc43xx/lpc43_emc.c | 4 +-
arch/arm/src/lpc43xx/lpc43_ethernet.c | 10 +-
arch/arm/src/lpc43xx/lpc43_gpdma.c | 10 +-
arch/arm/src/lpc43xx/lpc43_gpio.c | 2 +-
arch/arm/src/lpc43xx/lpc43_gpioint.c | 2 +-
arch/arm/src/lpc43xx/lpc43_i2c.c | 6 +-
arch/arm/src/lpc43xx/lpc43_idle.c | 2 +-
arch/arm/src/lpc43xx/lpc43_irq.c | 93 +-
arch/arm/src/lpc43xx/lpc43_pinconfig.c | 2 +-
arch/arm/src/lpc43xx/lpc43_rgu.c | 2 +-
arch/arm/src/lpc43xx/lpc43_rit.c | 2 +-
arch/arm/src/lpc43xx/lpc43_rtc.c | 4 +-
arch/arm/src/lpc43xx/lpc43_sdmmc.c | 12 +-
arch/arm/src/lpc43xx/lpc43_serial.c | 24 +-
arch/arm/src/lpc43xx/lpc43_spi.c | 4 +-
arch/arm/src/lpc43xx/lpc43_spifi.c | 2 +-
arch/arm/src/lpc43xx/lpc43_ssp.c | 4 +-
arch/arm/src/lpc43xx/lpc43_start.c | 8 +-
arch/arm/src/lpc43xx/lpc43_tickless_rit.c | 2 +-
arch/arm/src/lpc43xx/lpc43_timer.c | 2 +-
arch/arm/src/lpc43xx/lpc43_timerisr.c | 4 +-
arch/arm/src/lpc43xx/lpc43_uart.c | 8 +-
arch/arm/src/lpc43xx/lpc43_usb0dev.c | 12 +-
arch/arm/src/lpc43xx/lpc43_wwdt.c | 2 +-
arch/arm/src/lpc54xx/Make.defs | 47 +-
arch/arm/src/lpc54xx/lpc546x_enableclk.h | 2 +-
arch/arm/src/lpc54xx/lpc546x_power.h | 2 +-
arch/arm/src/lpc54xx/lpc54_allocateheap.c | 8 +-
arch/arm/src/lpc54xx/lpc54_clockconfig.c | 4 +-
arch/arm/src/lpc54xx/lpc54_clrpend.c | 2 +-
arch/arm/src/lpc54xx/lpc54_dma.c | 10 +-
arch/arm/src/lpc54xx/lpc54_emc.c | 2 +-
arch/arm/src/lpc54xx/lpc54_ethernet.c | 8 +-
arch/arm/src/lpc54xx/lpc54_gpio.c | 2 +-
arch/arm/src/lpc54xx/lpc54_gpioirq.c | 2 +-
arch/arm/src/lpc54xx/lpc54_i2c_master.c | 6 +-
arch/arm/src/lpc54xx/lpc54_idle.c | 2 +-
arch/arm/src/lpc54xx/lpc54_irq.c | 93 +-
arch/arm/src/lpc54xx/lpc54_lcd.c | 2 +-
arch/arm/src/lpc54xx/lpc54_lowputc.c | 8 +-
arch/arm/src/lpc54xx/lpc54_reset.c | 2 +-
arch/arm/src/lpc54xx/lpc54_rtc.c | 2 +-
arch/arm/src/lpc54xx/lpc54_rtc_lowerhalf.c | 2 +-
arch/arm/src/lpc54xx/lpc54_sdmmc.c | 12 +-
arch/arm/src/lpc54xx/lpc54_serial.c | 16 +-
arch/arm/src/lpc54xx/lpc54_spi_master.c | 4 +-
arch/arm/src/lpc54xx/lpc54_start.c | 6 +-
arch/arm/src/lpc54xx/lpc54_start.h | 2 +-
arch/arm/src/lpc54xx/lpc54_tickless.c | 2 +-
arch/arm/src/lpc54xx/lpc54_timerisr.c | 4 +-
arch/arm/src/lpc54xx/lpc54_usb0_ohci.c | 10 +-
arch/arm/src/lpc54xx/lpc54_wwdt.c | 2 +-
arch/arm/src/max326xx/Make.defs | 45 +-
arch/arm/src/max326xx/common/max326_clrpend.c | 2 +-
arch/arm/src/max326xx/common/max326_icc.c | 2 +-
arch/arm/src/max326xx/common/max326_idle.c | 2 +-
arch/arm/src/max326xx/common/max326_irq.c | 96 +-
.../arm/src/max326xx/common/max326_rtc_lowerhalf.c | 2 +-
arch/arm/src/max326xx/common/max326_start.c | 6 +-
arch/arm/src/max326xx/common/max326_timerisr.c | 4 +-
.../src/max326xx/max32660/max32660_clockconfig.c | 2 +-
arch/arm/src/max326xx/max32660/max32660_dma.c | 6 +-
arch/arm/src/max326xx/max32660/max32660_gpio.c | 2 +-
arch/arm/src/max326xx/max32660/max32660_gpioirq.c | 2 +-
arch/arm/src/max326xx/max32660/max32660_lowputc.c | 8 +-
.../src/max326xx/max32660/max32660_periphclks.h | 2 +-
arch/arm/src/max326xx/max32660/max32660_rtc.c | 2 +-
arch/arm/src/max326xx/max32660/max32660_serial.c | 16 +-
arch/arm/src/max326xx/max32660/max32660_spim.c | 4 +-
arch/arm/src/max326xx/max32660/max32660_wdt.c | 76 +-
arch/arm/src/max326xx/max326_start.h | 2 +-
arch/arm/src/moxart/Make.defs | 18 +-
arch/arm/src/moxart/moxart_16550.c | 2 +-
arch/arm/src/moxart/moxart_head.S | 12 +-
arch/arm/src/moxart/moxart_idle.c | 2 +-
arch/arm/src/moxart/moxart_irq.c | 16 +-
arch/arm/src/moxart/moxart_lowputc.S | 12 +-
arch/arm/src/moxart/moxart_systemreset.c | 2 +-
arch/arm/src/moxart/moxart_timer.c | 2 +-
arch/arm/src/nrf52/Kconfig | 8 +
arch/arm/src/nrf52/Make.defs | 45 +-
arch/arm/src/nrf52/hardware/nrf52_ppi.h | 63 +
arch/arm/src/nrf52/nrf52832_errdata.c | 4 +-
arch/arm/src/nrf52/nrf52_allocateheap.c | 8 +-
arch/arm/src/nrf52/nrf52_clockconfig.c | 4 +-
arch/arm/src/nrf52/nrf52_flash.c | 2 +-
arch/arm/src/nrf52/nrf52_gpio.c | 2 +-
arch/arm/src/nrf52/nrf52_gpiote.c | 2 +-
arch/arm/src/nrf52/nrf52_i2c.c | 4 +-
arch/arm/src/nrf52/nrf52_idle.c | 2 +-
arch/arm/src/nrf52/nrf52_irq.c | 18 +-
arch/arm/src/nrf52/nrf52_lowputc.c | 8 +-
arch/arm/src/nrf52/nrf52_nvmc.c | 2 +-
arch/arm/src/nrf52/nrf52_radio.c | 4 +-
arch/arm/src/nrf52/nrf52_rng.c | 8 +-
arch/arm/src/nrf52/nrf52_serial.c | 16 +-
arch/arm/src/nrf52/nrf52_spi.c | 95 +-
arch/arm/src/nrf52/nrf52_start.c | 6 +-
arch/arm/src/nrf52/nrf52_start.h | 2 +-
arch/arm/src/nrf52/nrf52_timerisr.c | 4 +-
arch/arm/src/nrf52/nrf52_utils.c | 2 +-
arch/arm/src/nrf52/nrf52_wdt.c | 22 +-
arch/arm/src/nuc1xx/Make.defs | 33 +-
arch/arm/src/nuc1xx/nuc_clockconfig.c | 2 +-
arch/arm/src/nuc1xx/nuc_dumpgpio.c | 2 +-
arch/arm/src/nuc1xx/nuc_gpio.c | 2 +-
arch/arm/src/nuc1xx/nuc_idle.c | 2 +-
arch/arm/src/nuc1xx/nuc_irq.c | 12 +-
arch/arm/src/nuc1xx/nuc_lowputc.c | 2 +-
arch/arm/src/nuc1xx/nuc_serial.c | 16 +-
arch/arm/src/nuc1xx/nuc_start.c | 8 +-
arch/arm/src/nuc1xx/nuc_timerisr.c | 4 +-
arch/arm/src/s32k1xx/Make.defs | 19 +-
arch/arm/src/s32k1xx/s32k11x/Make.defs | 20 +-
arch/arm/src/s32k1xx/s32k11x/s32k11x_irq.c | 12 +-
arch/arm/src/s32k1xx/s32k11x/s32k11x_timerisr.c | 4 +-
arch/arm/src/s32k1xx/s32k14x/Make.defs | 32 +-
arch/arm/src/s32k1xx/s32k14x/s32k14x_clrpend.c | 2 +-
arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c | 135 +-
arch/arm/src/s32k1xx/s32k14x/s32k14x_timerisr.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_clockconfig.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_edma.c | 10 +-
arch/arm/src/s32k1xx/s32k1xx_enet.c | 6 +-
arch/arm/src/s32k1xx/s32k1xx_enet.h | 6 +-
arch/arm/src/s32k1xx/s32k1xx_lowputc.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_lowputc.h | 2 +-
arch/arm/src/s32k1xx/s32k1xx_lpi2c.c | 20 +-
arch/arm/src/s32k1xx/s32k1xx_lpspi.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_periphclocks.c | 2 +-
arch/arm/src/s32k1xx/s32k1xx_periphclocks.h | 4 +-
arch/arm/src/s32k1xx/s32k1xx_pin.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_pin.h | 2 +-
arch/arm/src/s32k1xx/s32k1xx_pindma.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_pindump.c | 2 +-
arch/arm/src/s32k1xx/s32k1xx_pingpio.c | 2 +-
arch/arm/src/s32k1xx/s32k1xx_pinirq.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_rtc.c | 2 +-
arch/arm/src/s32k1xx/s32k1xx_serial.c | 14 +-
arch/arm/src/s32k1xx/s32k1xx_serial.h | 4 +-
arch/arm/src/s32k1xx/s32k1xx_start.c | 4 +-
arch/arm/src/s32k1xx/s32k1xx_start.h | 2 +-
arch/arm/src/s32k1xx/s32k1xx_wdog.h | 4 +-
arch/arm/src/sam34/Make.defs | 52 +-
arch/arm/src/sam34/sam4cm_cpuidlestack.c | 2 +-
arch/arm/src/sam34/sam4cm_cpupause.c | 12 +-
arch/arm/src/sam34/sam4cm_cpustart.c | 4 +-
arch/arm/src/sam34/sam4cm_idle.c | 2 +-
arch/arm/src/sam34/sam4cm_supc.c | 4 +-
arch/arm/src/sam34/sam4cm_tc.c | 2 +-
arch/arm/src/sam34/sam4l_clockconfig.c | 4 +-
arch/arm/src/sam34/sam4l_gpio.c | 4 +-
arch/arm/src/sam34/sam4l_periphclks.c | 4 +-
arch/arm/src/sam34/sam_aes.c | 4 +-
arch/arm/src/sam34/sam_allocateheap.c | 8 +-
arch/arm/src/sam34/sam_clockconfig.c | 4 +-
arch/arm/src/sam34/sam_cmcc.c | 2 +-
arch/arm/src/sam34/sam_dmac.c | 8 +-
arch/arm/src/sam34/sam_emac.c | 8 +-
arch/arm/src/sam34/sam_emac.h | 6 +-
arch/arm/src/sam34/sam_gpio.c | 4 +-
arch/arm/src/sam34/sam_gpioirq.c | 4 +-
arch/arm/src/sam34/sam_hsmci.c | 4 +-
arch/arm/src/sam34/sam_irq.c | 102 +-
arch/arm/src/sam34/sam_lowputc.c | 12 +-
arch/arm/src/sam34/sam_lowputc.h | 2 +-
arch/arm/src/sam34/sam_rtc.c | 2 +-
arch/arm/src/sam34/sam_rtt.c | 2 +-
arch/arm/src/sam34/sam_serial.c | 16 +-
arch/arm/src/sam34/sam_spi.c | 6 +-
arch/arm/src/sam34/sam_start.c | 8 +-
arch/arm/src/sam34/sam_tc.c | 2 +-
arch/arm/src/sam34/sam_timerisr.c | 4 +-
arch/arm/src/sam34/sam_twi.c | 4 +-
arch/arm/src/sam34/sam_udp.c | 16 +-
arch/arm/src/sam34/sam_userspace.h | 2 +-
arch/arm/src/sam34/sam_wdt.c | 2 +-
arch/arm/src/sama5/Make.defs | 60 +-
arch/arm/src/sama5/sam_adc.c | 15 +-
arch/arm/src/sama5/sam_allocateheap.c | 8 +-
arch/arm/src/sama5/sam_boot.c | 4 +-
arch/arm/src/sama5/sam_can.c | 4 +-
arch/arm/src/sama5/sam_clockconfig.c | 4 +-
arch/arm/src/sama5/sam_clockconfig.h | 2 +-
arch/arm/src/sama5/sam_dbgu.c | 4 +-
arch/arm/src/sama5/sam_dbgu.h | 2 +-
arch/arm/src/sama5/sam_dmac.c | 8 +-
arch/arm/src/sama5/sam_ehci.c | 8 +-
arch/arm/src/sama5/sam_emaca.c | 4 +-
arch/arm/src/sama5/sam_emacb.c | 4 +-
arch/arm/src/sama5/sam_ethernet.c | 6 +-
arch/arm/src/sama5/sam_flexcom_serial.c | 4 +-
arch/arm/src/sama5/sam_gmac.c | 4 +-
arch/arm/src/sama5/sam_hsmci.c | 4 +-
arch/arm/src/sama5/sam_irq.c | 4 +-
arch/arm/src/sama5/sam_lcd.c | 2 +-
arch/arm/src/sama5/sam_lowputc.c | 12 +-
arch/arm/src/sama5/sam_lowputc.h | 2 +-
arch/arm/src/sama5/sam_nand.c | 6 +-
arch/arm/src/sama5/sam_nand.h | 2 +-
arch/arm/src/sama5/sam_ohci.c | 8 +-
arch/arm/src/sama5/sam_pck.c | 2 +-
arch/arm/src/sama5/sam_pioirq.c | 4 +-
arch/arm/src/sama5/sam_pmc.c | 2 +-
arch/arm/src/sama5/sam_pwm.c | 4 +-
arch/arm/src/sama5/sam_rtc.c | 2 +-
arch/arm/src/sama5/sam_sckc.c | 2 +-
arch/arm/src/sama5/sam_serial.c | 6 +-
arch/arm/src/sama5/sam_serial.h | 6 +-
arch/arm/src/sama5/sam_serialinit.c | 8 +-
arch/arm/src/sama5/sam_spi.c | 6 +-
arch/arm/src/sama5/sam_ssc.c | 4 +-
arch/arm/src/sama5/sam_tc.c | 2 +-
arch/arm/src/sama5/sam_timerisr.c | 2 +-
arch/arm/src/sama5/sam_trng.c | 6 +-
arch/arm/src/sama5/sam_tsd.c | 53 +-
arch/arm/src/sama5/sam_twi.c | 4 +-
arch/arm/src/sama5/sam_udphs.c | 16 +-
arch/arm/src/sama5/sam_wdt.c | 2 +-
arch/arm/src/sama5/sam_xdmac.c | 8 +-
arch/arm/src/sama5/sama5d2x_pio.c | 4 +-
arch/arm/src/sama5/sama5d3x4x_pio.c | 4 +-
arch/arm/src/samd2l2/Make.defs | 35 +-
arch/arm/src/samd2l2/sam_ac.c | 2 +-
arch/arm/src/samd2l2/sam_adc.c | 2 +-
arch/arm/src/samd2l2/sam_dmac.c | 8 +-
arch/arm/src/samd2l2/sam_eic.c | 2 +-
arch/arm/src/samd2l2/sam_i2c_master.c | 4 +-
arch/arm/src/samd2l2/sam_idle.c | 2 +-
arch/arm/src/samd2l2/sam_irq.c | 12 +-
arch/arm/src/samd2l2/sam_irqprio.c | 2 +-
arch/arm/src/samd2l2/sam_lowputc.c | 2 +-
arch/arm/src/samd2l2/sam_port.c | 4 +-
arch/arm/src/samd2l2/sam_sercom.c | 2 +-
arch/arm/src/samd2l2/sam_sercom.h | 2 +-
arch/arm/src/samd2l2/sam_serial.c | 14 +-
arch/arm/src/samd2l2/sam_spi.c | 6 +-
arch/arm/src/samd2l2/sam_start.c | 8 +-
arch/arm/src/samd2l2/sam_timerisr.c | 4 +-
arch/arm/src/samd2l2/sam_usart.h | 2 +-
arch/arm/src/samd2l2/sam_usb.c | 14 +-
arch/arm/src/samd2l2/samd_clockconfig.c | 2 +-
arch/arm/src/samd2l2/samd_gclk.c | 2 +-
arch/arm/src/samd2l2/saml_clockconfig.c | 2 +-
arch/arm/src/samd2l2/saml_gclk.c | 2 +-
arch/arm/src/samd5e5/Make.defs | 48 +-
arch/arm/src/samd5e5/sam_clockconfig.c | 2 +-
arch/arm/src/samd5e5/sam_cmcc.c | 2 +-
arch/arm/src/samd5e5/sam_dmac.c | 8 +-
arch/arm/src/samd5e5/sam_eic.c | 2 +-
arch/arm/src/samd5e5/sam_ethernet.c | 6 +-
arch/arm/src/samd5e5/sam_gclk.c | 2 +-
arch/arm/src/samd5e5/sam_gclk.h | 2 +-
arch/arm/src/samd5e5/sam_gmac.c | 4 +-
arch/arm/src/samd5e5/sam_i2c_master.c | 4 +-
arch/arm/src/samd5e5/sam_idle.c | 2 +-
arch/arm/src/samd5e5/sam_irq.c | 129 +-
arch/arm/src/samd5e5/sam_lowputc.c | 2 +-
arch/arm/src/samd5e5/sam_port.c | 4 +-
arch/arm/src/samd5e5/sam_sercom.c | 2 +-
arch/arm/src/samd5e5/sam_sercom.h | 2 +-
arch/arm/src/samd5e5/sam_serial.c | 14 +-
arch/arm/src/samd5e5/sam_spi.c | 6 +-
arch/arm/src/samd5e5/sam_start.c | 6 +-
arch/arm/src/samd5e5/sam_timerisr.c | 4 +-
arch/arm/src/samd5e5/sam_usart.h | 2 +-
arch/arm/src/samd5e5/sam_usb.c | 14 +-
arch/arm/src/samd5e5/sam_userspace.h | 2 +-
arch/arm/src/samv7/Make.defs | 56 +-
arch/arm/src/samv7/sam_allocateheap.c | 8 +-
arch/arm/src/samv7/sam_clockconfig.c | 4 +-
arch/arm/src/samv7/sam_dac.c | 4 +-
arch/arm/src/samv7/sam_eefc.c | 0
arch/arm/src/samv7/sam_eefc.h | 4 +-
arch/arm/src/samv7/sam_emac.c | 4 +-
arch/arm/src/samv7/sam_ethernet.c | 6 +-
arch/arm/src/samv7/sam_gpio.c | 4 +-
arch/arm/src/samv7/sam_gpioirq.c | 4 +-
arch/arm/src/samv7/sam_hsmci.c | 4 +-
arch/arm/src/samv7/sam_irq.c | 102 +-
arch/arm/src/samv7/sam_lowputc.c | 12 +-
arch/arm/src/samv7/sam_lowputc.h | 2 +-
arch/arm/src/samv7/sam_mcan.c | 12 +-
arch/arm/src/samv7/sam_pck.c | 2 +-
arch/arm/src/samv7/sam_progmem.c | 4 +-
arch/arm/src/samv7/sam_progmem.h | 2 +-
arch/arm/src/samv7/sam_qspi.c | 6 +-
arch/arm/src/samv7/sam_rswdt.c | 2 +-
arch/arm/src/samv7/sam_serial.c | 16 +-
arch/arm/src/samv7/sam_spi.c | 6 +-
arch/arm/src/samv7/sam_spi_slave.c | 25 +-
arch/arm/src/samv7/sam_ssc.c | 4 +-
arch/arm/src/samv7/sam_start.c | 6 +-
arch/arm/src/samv7/sam_start.h | 2 +-
arch/arm/src/samv7/sam_systemreset.c | 2 +-
arch/arm/src/samv7/sam_tc.c | 2 +-
arch/arm/src/samv7/sam_timerisr.c | 4 +-
arch/arm/src/samv7/sam_trng.c | 6 +-
arch/arm/src/samv7/sam_twihs.c | 4 +-
arch/arm/src/samv7/sam_uid.c | 0
arch/arm/src/samv7/sam_uid.h | 0
arch/arm/src/samv7/sam_usbdevhs.c | 16 +-
arch/arm/src/samv7/sam_userspace.h | 2 +-
arch/arm/src/samv7/sam_wdt.c | 2 +-
arch/arm/src/samv7/sam_xdmac.c | 10 +-
arch/arm/src/stm32/Kconfig | 432 +-
arch/arm/src/stm32/Make.defs | 57 +-
arch/arm/src/stm32/hardware/stm32_adc.h | 2 +-
arch/arm/src/stm32/hardware/stm32_adc_v2.h | 1018 +-
arch/arm/src/stm32/hardware/stm32_dma.h | 2 +-
arch/arm/src/stm32/hardware/stm32_dma_v1.h | 129 +-
arch/arm/src/stm32/hardware/stm32_flash.h | 281 +-
arch/arm/src/stm32/hardware/stm32_i2c.h | 6 +-
arch/arm/src/stm32/hardware/stm32_i2c_v2.h | 51 +-
arch/arm/src/stm32/hardware/stm32_memorymap.h | 2 +
arch/arm/src/stm32/hardware/stm32_pinmap.h | 19 +-
arch/arm/src/stm32/hardware/stm32_tim.h | 322 +-
arch/arm/src/stm32/hardware/stm32f20xxx_syscfg.h | 32 +-
arch/arm/src/stm32/hardware/stm32f30xxx_syscfg.h | 32 +-
arch/arm/src/stm32/hardware/stm32f33xxx_syscfg.h | 32 +-
arch/arm/src/stm32/hardware/stm32f37xxx_syscfg.h | 32 +-
arch/arm/src/stm32/hardware/stm32g474cxx_pinmap.h | 723 +
arch/arm/src/stm32/hardware/stm32g474mxx_pinmap.h | 935 +
arch/arm/src/stm32/hardware/stm32g474qxx_pinmap.h | 1231 +
arch/arm/src/stm32/hardware/stm32g474rxx_pinmap.h | 829 +
arch/arm/src/stm32/hardware/stm32g474vxx_pinmap.h | 1113 +
arch/arm/src/stm32/hardware/stm32g47xxx_gpio.h | 340 +
.../arm/src/stm32/hardware/stm32g47xxx_memorymap.h | 188 +
arch/arm/src/stm32/hardware/stm32g47xxx_pinmap.h | 46 +
arch/arm/src/stm32/hardware/stm32g47xxx_pwr.h | 453 +
arch/arm/src/stm32/hardware/stm32g47xxx_rcc.h | 677 +
arch/arm/src/stm32/hardware/stm32g47xxx_syscfg.h | 171 +
arch/arm/src/stm32/hardware/stm32g47xxx_uart.h | 420 +
arch/arm/src/stm32/hardware/stm32l15xxx_syscfg.h | 32 +-
arch/arm/src/stm32/stm32.h | 2 +-
arch/arm/src/stm32/stm32_1wire.c | 4 +-
arch/arm/src/stm32/stm32_adc.c | 429 +-
arch/arm/src/stm32/stm32_adc.h | 212 +-
arch/arm/src/stm32/stm32_aes.c | 4 +-
arch/arm/src/stm32/stm32_allocateheap.c | 274 +-
arch/arm/src/stm32/stm32_can.c | 4 +-
arch/arm/src/stm32/stm32_capture.c | 4 +-
arch/arm/src/stm32/stm32_dac.c | 4 +-
arch/arm/src/stm32/stm32_dma.c | 14 +-
arch/arm/src/stm32/stm32_dma2d.c | 6 +-
arch/arm/src/stm32/stm32_dma_v1.c | 145 +-
arch/arm/src/stm32/stm32_dma_v2.c | 6 +-
arch/arm/src/stm32/stm32_dumpgpio.c | 33 +-
arch/arm/src/stm32/stm32_eth.c | 12 +-
arch/arm/src/stm32/stm32_eth.h | 2 +-
arch/arm/src/stm32/stm32_exti_alarm.c | 2 +-
arch/arm/src/stm32/stm32_exti_gpio.c | 2 +-
arch/arm/src/stm32/stm32_exti_pwr.c | 2 +-
arch/arm/src/stm32/stm32_exti_wakeup.c | 2 +-
arch/arm/src/stm32/stm32_gpio.c | 89 +-
arch/arm/src/stm32/stm32_gpio.h | 46 +-
arch/arm/src/stm32/stm32_hciuart.c | 8 +-
arch/arm/src/stm32/stm32_i2c.c | 18 +-
arch/arm/src/stm32/stm32_i2c_alt.c | 18 +-
arch/arm/src/stm32/stm32_i2c_v2.c | 24 +-
arch/arm/src/stm32/stm32_i2s.c | 4 +-
arch/arm/src/stm32/stm32_idle.c | 2 +-
arch/arm/src/stm32/stm32_irq.c | 113 +-
arch/arm/src/stm32/stm32_iwdg.c | 74 +-
arch/arm/src/stm32/stm32_lowputc.c | 139 +-
arch/arm/src/stm32/stm32_lse.c | 6 +-
arch/arm/src/stm32/stm32_lsi.c | 2 +-
arch/arm/src/stm32/stm32_ltdc.c | 6 +-
arch/arm/src/stm32/stm32_otgfsdev.c | 16 +-
arch/arm/src/stm32/stm32_otgfshost.c | 84 +-
arch/arm/src/stm32/stm32_otghsdev.c | 14 +-
arch/arm/src/stm32/stm32_otghshost.c | 80 +-
arch/arm/src/stm32/stm32_pm.h | 2 +-
arch/arm/src/stm32/stm32_pminitialize.c | 6 +-
arch/arm/src/stm32/stm32_pmsleep.c | 2 +-
arch/arm/src/stm32/stm32_pmstandby.c | 2 +-
arch/arm/src/stm32/stm32_pmstop.c | 2 +-
arch/arm/src/stm32/stm32_pwm.c | 4 +-
arch/arm/src/stm32/stm32_pwr.c | 2 +-
arch/arm/src/stm32/stm32_qencoder.c | 4 +-
arch/arm/src/stm32/stm32_rcc.c | 52 +-
arch/arm/src/stm32/stm32_rcc.h | 26 +-
arch/arm/src/stm32/stm32_rng.c | 6 +-
arch/arm/src/stm32/stm32_rtc_lowerhalf.c | 2 +-
arch/arm/src/stm32/stm32_rtcc.c | 2 +-
arch/arm/src/stm32/stm32_rtcounter.c | 22 +-
arch/arm/src/stm32/stm32_sdadc.c | 4 +-
arch/arm/src/stm32/stm32_sdio.c | 4 +-
arch/arm/src/stm32/stm32_serial.c | 227 +-
arch/arm/src/stm32/stm32_spi.c | 8 +-
arch/arm/src/stm32/stm32_start.c | 10 +-
arch/arm/src/stm32/stm32_syscfg.h | 2 +
arch/arm/src/stm32/stm32_tickless.c | 2 +-
arch/arm/src/stm32/stm32_tim.c | 4 +-
arch/arm/src/stm32/stm32_timerisr.c | 4 +-
arch/arm/src/stm32/stm32_uart.h | 2 +
arch/arm/src/stm32/stm32_usbdev.c | 12 +-
arch/arm/src/stm32/stm32_waste.c | 8 +-
arch/arm/src/stm32/stm32_waste.h | 6 +-
arch/arm/src/stm32/stm32_wwdg.c | 2 +-
arch/arm/src/stm32/stm32f10xxf30xx_flash.c | 8 +-
arch/arm/src/stm32/stm32f20xxf40xx_flash.c | 16 +-
arch/arm/src/stm32/stm32f40xxx_i2c.c | 18 +-
arch/arm/src/stm32/stm32f40xxx_rtcc.c | 2 +-
arch/arm/src/stm32/stm32g47xxx_rcc.c | 972 +
arch/arm/src/stm32/stm32l15xx_flash.c | 10 +-
arch/arm/src/stm32/stm32l15xxx_rtcc.c | 2 +-
arch/arm/src/stm32f0l0g0/Make.defs | 35 +-
arch/arm/src/stm32f0l0g0/hardware/stm32f0_syscfg.h | 32 +-
arch/arm/src/stm32f0l0g0/stm32.h | 2 +-
arch/arm/src/stm32f0l0g0/stm32_adc.c | 4 +-
arch/arm/src/stm32f0l0g0/stm32_aes.c | 4 +-
arch/arm/src/stm32f0l0g0/stm32_dma_v1.c | 6 +-
arch/arm/src/stm32f0l0g0/stm32_exti_gpio.c | 2 +-
arch/arm/src/stm32f0l0g0/stm32_gpio.c | 2 +-
arch/arm/src/stm32f0l0g0/stm32_hsi48.c | 2 +-
arch/arm/src/stm32f0l0g0/stm32_i2c.c | 24 +-
arch/arm/src/stm32f0l0g0/stm32_idle.c | 2 +-
arch/arm/src/stm32f0l0g0/stm32_irq.c | 12 +-
arch/arm/src/stm32f0l0g0/stm32_lowputc_v1.c | 8 +-
arch/arm/src/stm32f0l0g0/stm32_lowputc_v2.c | 8 +-
arch/arm/src/stm32f0l0g0/stm32_lse.c | 2 +-
arch/arm/src/stm32f0l0g0/stm32_pwm.c | 4 +-
arch/arm/src/stm32f0l0g0/stm32_rcc.c | 4 +-
arch/arm/src/stm32f0l0g0/stm32_rcc.h | 2 +-
arch/arm/src/stm32f0l0g0/stm32_rng.c | 6 +-
arch/arm/src/stm32f0l0g0/stm32_serial_v1.c | 20 +-
arch/arm/src/stm32f0l0g0/stm32_serial_v2.c | 24 +-
arch/arm/src/stm32f0l0g0/stm32_spi.c | 10 +-
arch/arm/src/stm32f0l0g0/stm32_start.c | 8 +-
arch/arm/src/stm32f0l0g0/stm32_tim.c | 4 +-
arch/arm/src/stm32f0l0g0/stm32_timerisr.c | 4 +-
arch/arm/src/stm32f0l0g0/stm32_usbdev.c | 14 +-
arch/arm/src/stm32f0l0g0/stm32f0_rcc.c | 4 +-
arch/arm/src/stm32f0l0g0/stm32f0l0_pwr.c | 2 +-
arch/arm/src/stm32f0l0g0/stm32g0_pwr.c | 2 +-
arch/arm/src/stm32f7/Kconfig | 2 +-
arch/arm/src/stm32f7/Make.defs | 58 +-
.../src/stm32f7/hardware/stm32f72xx73xx_syscfg.h | 32 +-
.../src/stm32f7/hardware/stm32f74xx75xx_syscfg.h | 32 +-
.../src/stm32f7/hardware/stm32f76xx77xx_syscfg.h | 32 +-
arch/arm/src/stm32f7/stm32_adc.c | 4 +-
arch/arm/src/stm32f7/stm32_allocateheap.c | 8 +-
arch/arm/src/stm32f7/stm32_can.c | 4 +-
arch/arm/src/stm32f7/stm32_capture.c | 4 +-
arch/arm/src/stm32f7/stm32_dma.c | 6 +-
arch/arm/src/stm32f7/stm32_dma2d.c | 6 +-
arch/arm/src/stm32f7/stm32_dumpgpio.c | 2 +-
arch/arm/src/stm32f7/stm32_ethernet.c | 12 +-
arch/arm/src/stm32f7/stm32_ethernet.h | 2 +-
arch/arm/src/stm32f7/stm32_exti_alarm.c | 2 +-
arch/arm/src/stm32f7/stm32_exti_gpio.c | 2 +-
arch/arm/src/stm32f7/stm32_exti_pwr.c | 2 +-
arch/arm/src/stm32f7/stm32_exti_wakeup.c | 2 +-
arch/arm/src/stm32f7/stm32_flash.c | 18 +-
arch/arm/src/stm32f7/stm32_gpio.c | 2 +-
arch/arm/src/stm32f7/stm32_i2c.c | 24 +-
arch/arm/src/stm32f7/stm32_irq.c | 118 +-
arch/arm/src/stm32f7/stm32_lowputc.c | 8 +-
arch/arm/src/stm32f7/stm32_lse.c | 2 +-
arch/arm/src/stm32f7/stm32_lsi.c | 2 +-
arch/arm/src/stm32f7/stm32_ltdc.c | 6 +-
arch/arm/src/stm32f7/stm32_otgdev.c | 16 +-
arch/arm/src/stm32f7/stm32_otghost.c | 80 +-
arch/arm/src/stm32f7/stm32_pm.h | 2 +-
arch/arm/src/stm32f7/stm32_pminitialize.c | 6 +-
arch/arm/src/stm32f7/stm32_pmsleep.c | 2 +-
arch/arm/src/stm32f7/stm32_pmstandby.c | 2 +-
arch/arm/src/stm32f7/stm32_pmstop.c | 2 +-
arch/arm/src/stm32f7/stm32_pwm.c | 4 +-
arch/arm/src/stm32f7/stm32_pwr.c | 2 +-
arch/arm/src/stm32f7/stm32_qencoder.c | 4 +-
arch/arm/src/stm32f7/stm32_qspi.c | 8 +-
arch/arm/src/stm32f7/stm32_rcc.c | 4 +-
arch/arm/src/stm32f7/stm32_rcc.h | 2 +-
arch/arm/src/stm32f7/stm32_rng.c | 6 +-
arch/arm/src/stm32f7/stm32_rtc.c | 2 +-
arch/arm/src/stm32f7/stm32_rtc_lowerhalf.c | 2 +-
arch/arm/src/stm32f7/stm32_sai.c | 2 +-
arch/arm/src/stm32f7/stm32_sdmmc.c | 4 +-
arch/arm/src/stm32f7/stm32_serial.c | 24 +-
arch/arm/src/stm32f7/stm32_spi.c | 10 +-
arch/arm/src/stm32f7/stm32_start.c | 6 +-
arch/arm/src/stm32f7/stm32_start.h | 2 +-
arch/arm/src/stm32f7/stm32_tickless.c | 2 +-
arch/arm/src/stm32f7/stm32_tim.c | 4 +-
arch/arm/src/stm32f7/stm32_timerisr.c | 4 +-
arch/arm/src/stm32f7/stm32_userspace.h | 2 +-
arch/arm/src/stm32h7/Kconfig | 76 +-
arch/arm/src/stm32h7/Make.defs | 69 +-
arch/arm/src/stm32h7/hardware/stm32_exti.h | 130 +-
arch/arm/src/stm32h7/hardware/stm32_i2c.h | 2 +
arch/arm/src/stm32h7/hardware/stm32_sdmmc.h | 2 +
arch/arm/src/stm32h7/hardware/stm32h7x3xx_pinmap.h | 2 +-
arch/arm/src/stm32h7/hardware/stm32h7x3xx_syscfg.h | 32 +-
arch/arm/src/stm32h7/stm32.h | 2 +-
arch/arm/src/stm32h7/stm32_allocateheap.c | 16 +-
arch/arm/src/stm32h7/stm32_dma.c | 185 +-
arch/arm/src/stm32h7/stm32_ethernet.c | 157 +-
arch/arm/src/stm32h7/stm32_ethernet.h | 2 +-
arch/arm/src/stm32h7/stm32_exti_alarm.c | 2 +-
arch/arm/src/stm32h7/stm32_exti_gpio.c | 6 +-
arch/arm/src/stm32h7/stm32_exti_wakeup.c | 2 +-
arch/arm/src/stm32h7/stm32_flash.c | 366 +-
arch/arm/src/stm32h7/stm32_fmc.c | 2 +-
arch/arm/src/stm32h7/stm32_fmc.h | 2 +-
arch/arm/src/stm32h7/stm32_gpio.c | 2 +-
arch/arm/src/stm32h7/stm32_i2c.c | 24 +-
arch/arm/src/stm32h7/stm32_irq.c | 172 +-
arch/arm/src/stm32h7/stm32_iwdg.c | 22 +-
arch/arm/src/stm32h7/stm32_lowputc.c | 8 +-
arch/arm/src/stm32h7/stm32_lse.c | 2 +-
arch/arm/src/stm32h7/stm32_lsi.c | 2 +-
arch/arm/src/stm32h7/stm32_oneshot.c | 404 +
arch/arm/src/stm32h7/stm32_oneshot.h | 195 +
arch/arm/src/stm32h7/stm32_oneshot_lowerhalf.c | 331 +
arch/arm/src/stm32h7/stm32_otgdev.c | 16 +-
arch/arm/src/stm32h7/stm32_otghost.c | 78 +-
arch/arm/src/stm32h7/stm32_pm.h | 2 +-
arch/arm/src/stm32h7/stm32_pminitialize.c | 6 +-
arch/arm/src/stm32h7/stm32_pmsleep.c | 2 +-
arch/arm/src/stm32h7/stm32_pmstandby.c | 2 +-
arch/arm/src/stm32h7/stm32_pmstop.c | 2 +-
arch/arm/src/stm32h7/stm32_pwm.c | 4 +-
arch/arm/src/stm32h7/stm32_pwr.c | 2 +-
arch/arm/src/stm32h7/stm32_qencoder.c | 4 +-
arch/arm/src/stm32h7/stm32_qspi.c | 8 +-
arch/arm/src/stm32h7/stm32_rcc.c | 4 +-
arch/arm/src/stm32h7/stm32_rcc.h | 47 +-
arch/arm/src/stm32h7/stm32_rtc.c | 2 +-
arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c | 2 +-
arch/arm/src/stm32h7/stm32_sdmmc.c | 372 +-
arch/arm/src/stm32h7/stm32_serial.c | 24 +-
arch/arm/src/stm32h7/stm32_spi.c | 364 +-
arch/arm/src/stm32h7/stm32_spi.h | 104 +-
arch/arm/src/stm32h7/stm32_spi_slave.c | 1806 ++
arch/arm/src/stm32h7/stm32_start.c | 8 +-
arch/arm/src/stm32h7/stm32_start.h | 2 +-
arch/arm/src/stm32h7/stm32_tim.c | 4 +-
arch/arm/src/stm32h7/stm32_timerisr.c | 4 +-
arch/arm/src/stm32h7/stm32_userspace.h | 2 +-
arch/arm/src/stm32h7/stm32_wwdg.c | 2 +-
arch/arm/src/stm32h7/stm32h7x3xx_rcc.c | 21 +-
arch/arm/src/stm32l4/Make.defs | 52 +-
arch/arm/src/stm32l4/hardware/stm32l4_lptim.h | 14 +-
arch/arm/src/stm32l4/stm32l4.h | 2 +-
arch/arm/src/stm32l4/stm32l4_1wire.c | 6 +-
arch/arm/src/stm32l4/stm32l4_allocateheap.c | 8 +-
arch/arm/src/stm32l4/stm32l4_can.c | 4 +-
arch/arm/src/stm32l4/stm32l4_comp.c | 2 +-
arch/arm/src/stm32l4/stm32l4_dac.c | 4 +-
arch/arm/src/stm32l4/stm32l4_dumpgpio.c | 2 +-
arch/arm/src/stm32l4/stm32l4_exti_alarm.c | 2 +-
arch/arm/src/stm32l4/stm32l4_exti_comp.c | 2 +-
arch/arm/src/stm32l4/stm32l4_exti_gpio.c | 2 +-
arch/arm/src/stm32l4/stm32l4_exti_pwr.c | 2 +-
arch/arm/src/stm32l4/stm32l4_exti_wakeup.c | 2 +-
arch/arm/src/stm32l4/stm32l4_firewall.c | 2 +-
arch/arm/src/stm32l4/stm32l4_flash.c | 10 +-
arch/arm/src/stm32l4/stm32l4_gpio.c | 2 +-
arch/arm/src/stm32l4/stm32l4_hsi48.c | 2 +-
arch/arm/src/stm32l4/stm32l4_i2c.c | 24 +-
arch/arm/src/stm32l4/stm32l4_idle.c | 2 +-
arch/arm/src/stm32l4/stm32l4_irq.c | 107 +-
arch/arm/src/stm32l4/stm32l4_iwdg.c | 87 +-
arch/arm/src/stm32l4/stm32l4_lowputc.c | 8 +-
arch/arm/src/stm32l4/stm32l4_lptim.c | 239 +-
arch/arm/src/stm32l4/stm32l4_lptim.h | 54 +-
arch/arm/src/stm32l4/stm32l4_lse.c | 16 +-
arch/arm/src/stm32l4/stm32l4_lsi.c | 2 +-
arch/arm/src/stm32l4/stm32l4_otgfsdev.c | 16 +-
arch/arm/src/stm32l4/stm32l4_otgfshost.c | 80 +-
arch/arm/src/stm32l4/stm32l4_pm.h | 2 +-
arch/arm/src/stm32l4/stm32l4_pminitialize.c | 6 +-
arch/arm/src/stm32l4/stm32l4_pmlpr.c | 2 +-
arch/arm/src/stm32l4/stm32l4_pmsleep.c | 2 +-
arch/arm/src/stm32l4/stm32l4_pmstandby.c | 2 +-
arch/arm/src/stm32l4/stm32l4_pmstop.c | 2 +-
arch/arm/src/stm32l4/stm32l4_pwm.c | 24 +-
arch/arm/src/stm32l4/stm32l4_pwr.c | 98 +-
arch/arm/src/stm32l4/stm32l4_pwr.h | 70 +-
arch/arm/src/stm32l4/stm32l4_qencoder.c | 4 +-
arch/arm/src/stm32l4/stm32l4_qspi.c | 8 +-
arch/arm/src/stm32l4/stm32l4_rcc.c | 4 +-
arch/arm/src/stm32l4/stm32l4_rcc.h | 2 +-
arch/arm/src/stm32l4/stm32l4_rng.c | 6 +-
arch/arm/src/stm32l4/stm32l4_rtc.c | 2 +-
arch/arm/src/stm32l4/stm32l4_sdmmc.c | 4 +-
arch/arm/src/stm32l4/stm32l4_serial.c | 24 +-
arch/arm/src/stm32l4/stm32l4_spi.c | 10 +-
arch/arm/src/stm32l4/stm32l4_start.c | 10 +-
arch/arm/src/stm32l4/stm32l4_tim.c | 4 +-
arch/arm/src/stm32l4/stm32l4_timerisr.c | 4 +-
arch/arm/src/stm32l4/stm32l4_usbdev.c | 12 +-
arch/arm/src/stm32l4/stm32l4_waste.c | 8 +-
arch/arm/src/stm32l4/stm32l4_waste.h | 14 +-
arch/arm/src/stm32l4/stm32l4x6xx_dma.c | 6 +-
arch/arm/src/stm32l4/stm32l4x6xx_rcc.c | 65 +-
arch/arm/src/stm32l4/stm32l4xrxx_dma.c | 8 +-
arch/arm/src/str71x/Make.defs | 23 +-
arch/arm/src/str71x/str71x_decodeirq.c | 74 +-
arch/arm/src/str71x/str71x_head.S | 36 +-
arch/arm/src/str71x/str71x_irq.c | 8 +-
arch/arm/src/str71x/str71x_lowputc.c | 8 +-
arch/arm/src/str71x/str71x_prccu.c | 2 +-
arch/arm/src/str71x/str71x_serial.c | 20 +-
arch/arm/src/str71x/str71x_timerisr.c | 4 +-
arch/arm/src/str71x/str71x_xti.c | 4 +-
arch/arm/src/tiva/Make.defs | 53 +-
arch/arm/src/tiva/cc13xx/cc13x0_rom.c | 2 +-
arch/arm/src/tiva/cc13xx/cc13x2_aux_sysif.c | 2 +-
arch/arm/src/tiva/cc13xx/cc13x2_cc26x2_v1_rom.c | 2 +-
arch/arm/src/tiva/cc13xx/cc13xx_gpio.c | 2 +-
arch/arm/src/tiva/cc13xx/cc13xx_gpioirq.c | 4 +-
arch/arm/src/tiva/cc13xx/cc13xx_prcm.c | 2 +-
arch/arm/src/tiva/cc13xx/cc13xx_prcm.h | 2 +-
arch/arm/src/tiva/cc13xx/cc13xx_start.c | 8 +-
arch/arm/src/tiva/common/lm4xx_tm3c_sysctrl.c | 4 +-
arch/arm/src/tiva/common/lmxx_tm4c_enableclks.h | 2 +-
arch/arm/src/tiva/common/lmxx_tm4c_enablepwr.h | 2 +-
arch/arm/src/tiva/common/lmxx_tm4c_gpioirq.c | 4 +-
arch/arm/src/tiva/common/lmxx_tm4c_start.c | 8 +-
arch/arm/src/tiva/common/tiva_adclib.c | 4 +-
arch/arm/src/tiva/common/tiva_adclow.c | 4 +-
arch/arm/src/tiva/common/tiva_allocateheap.c | 4 +-
arch/arm/src/tiva/common/tiva_dumpgpio.c | 2 +-
arch/arm/src/tiva/common/tiva_eeprom.c | 2 +-
arch/arm/src/tiva/common/tiva_flash.c | 2 +-
arch/arm/src/tiva/common/tiva_hciuart.c | 8 +-
arch/arm/src/tiva/common/tiva_i2c.c | 18 +-
arch/arm/src/tiva/common/tiva_idle.c | 62 +
arch/arm/src/tiva/common/tiva_irq.c | 148 +-
arch/arm/src/tiva/common/tiva_lowputc.c | 8 +-
arch/arm/src/tiva/common/tiva_pwm.c | 2 +-
arch/arm/src/tiva/common/tiva_qencoder.c | 2 +-
arch/arm/src/tiva/common/tiva_serial.c | 20 +-
arch/arm/src/tiva/common/tiva_ssi.c | 6 +-
arch/arm/src/tiva/common/tiva_timerisr.c | 4 +-
arch/arm/src/tiva/common/tiva_timerlib.c | 2 +-
arch/arm/src/tiva/hardware/cc13x0/cc13x0_gpio.h | 1 +
arch/arm/src/tiva/lm/lm3s_ethernet.c | 6 +-
arch/arm/src/tiva/lm/lm3s_gpio.c | 2 +-
arch/arm/src/tiva/lm/lm4f_gpio.c | 2 +-
arch/arm/src/tiva/tiva_chipinfo.h | 2 +-
arch/arm/src/tiva/tiva_ethernet.h | 2 +-
arch/arm/src/tiva/tiva_periphrdy.h | 2 +-
arch/arm/src/tiva/tiva_timer.h | 2 +-
arch/arm/src/tiva/tm4c/tm4c129_sysctrl.c | 4 +-
arch/arm/src/tiva/tm4c/tm4c_ethernet.c | 56 +-
arch/arm/src/tiva/tm4c/tm4c_gpio.c | 2 +-
arch/arm/src/tms570/Make.defs | 60 +-
arch/arm/src/tms570/tms570_boot.c | 4 +-
arch/arm/src/tms570/tms570_boot.h | 2 +-
arch/arm/src/tms570/tms570_clockconfig.c | 2 +-
arch/arm/src/tms570/tms570_esm.c | 4 +-
arch/arm/src/tms570/tms570_gio.c | 4 +-
arch/arm/src/tms570/tms570_gioirq.c | 4 +-
arch/arm/src/tms570/tms570_irq.c | 8 +-
arch/arm/src/tms570/tms570_lowputc.c | 12 +-
arch/arm/src/tms570/tms570_lowputc.h | 2 +-
arch/arm/src/tms570/tms570_selftest.c | 2 +-
arch/arm/src/tms570/tms570_serial.c | 8 +-
arch/arm/src/tms570/tms570_timerisr.c | 4 +-
arch/arm/src/xmc4/Make.defs | 61 +-
arch/arm/src/xmc4/xmc4_allocateheap.c | 4 +-
arch/arm/src/xmc4/xmc4_clockconfig.c | 2 +-
arch/arm/src/xmc4/xmc4_clockutils.c | 2 +-
arch/arm/src/xmc4/xmc4_clrpend.c | 2 +-
arch/arm/src/xmc4/xmc4_gpio.c | 4 +-
arch/arm/src/xmc4/xmc4_idle.c | 2 +-
arch/arm/src/xmc4/xmc4_irq.c | 126 +-
arch/arm/src/xmc4/xmc4_lowputc.c | 8 +-
arch/arm/src/xmc4/xmc4_lowputc.h | 2 +-
arch/arm/src/xmc4/xmc4_serial.c | 16 +-
arch/arm/src/xmc4/xmc4_spi.c | 6 +-
arch/arm/src/xmc4/xmc4_start.c | 6 +-
arch/arm/src/xmc4/xmc4_timerisr.c | 4 +-
arch/arm/src/xmc4/xmc4_usic.c | 2 +-
arch/avr/include/arch.h | 6 +
arch/avr/include/avr/arch.h | 88 +
arch/avr/include/avr32/arch.h | 85 +
arch/avr/include/tls.h | 75 +
arch/avr/src/.gitignore | 2 -
arch/avr/src/Makefile | 64 +-
arch/avr/src/at32uc3/Make.defs | 1 -
arch/avr/src/atmega/Make.defs | 6 -
arch/avr/src/avr/Kconfig | 4 +-
arch/avr/src/avr/Toolchain.defs | 17 +-
arch/avr/src/avr/up_blocktask.c | 12 +-
arch/avr/src/avr/up_createstack.c | 57 +-
arch/avr/src/avr/up_dumpstate.c | 23 +-
arch/avr/src/avr/up_releasepending.c | 48 +-
arch/avr/src/avr/up_reprioritizertr.c | 60 +-
arch/avr/src/avr/up_sigdeliver.c | 63 +-
arch/avr/src/avr/up_unblocktask.c | 10 +-
arch/avr/src/avr/up_usestack.c | 19 +-
arch/avr/src/avr32/Kconfig | 1 +
arch/avr/src/avr32/Toolchain.defs | 18 +-
arch/avr/src/avr32/up_blocktask.c | 12 +-
arch/avr/src/avr32/up_createstack.c | 44 +-
arch/avr/src/avr32/up_dumpstate.c | 19 +-
arch/avr/src/avr32/up_releasepending.c | 48 +-
arch/avr/src/avr32/up_reprioritizertr.c | 60 +-
arch/avr/src/avr32/up_sigdeliver.c | 65 +-
arch/avr/src/avr32/up_unblocktask.c | 10 +-
arch/avr/src/avr32/up_usestack.c | 15 +-
arch/avr/src/common/up_assert.c | 10 +-
arch/avr/src/common/up_exit.c | 6 +-
arch/avr/src/common/up_releasestack.c | 2 +-
arch/hc/include/tls.h | 90 +
arch/hc/src/.gitignore | 2 -
arch/hc/src/Makefile | 73 +-
arch/hc/src/common/up_blocktask.c | 63 +-
arch/hc/src/common/up_createstack.c | 48 +-
arch/hc/src/common/up_exit.c | 48 +-
arch/hc/src/common/up_releasepending.c | 48 +-
arch/hc/src/common/up_releasestack.c | 2 +-
arch/hc/src/common/up_reprioritizertr.c | 58 +-
arch/hc/src/common/up_unblocktask.c | 61 +-
arch/hc/src/common/up_usestack.c | 16 +-
arch/hc/src/m9s12/Make.defs | 1 -
arch/hc/src/m9s12/m9s12_assert.c | 44 +-
arch/mips/include/tls.h | 90 +
arch/mips/src/.gitignore | 2 -
arch/mips/src/Makefile | 73 +-
arch/mips/src/common/mips_allocateheap.c | 88 +
arch/mips/src/common/mips_arch.h | 90 +
arch/mips/src/common/mips_createstack.c | 262 +
arch/mips/src/common/mips_etherstub.c | 86 +
arch/mips/src/common/mips_exit.c | 200 +
arch/mips/src/common/mips_idle.c | 77 +
arch/mips/src/common/mips_initialize.c | 205 +
arch/mips/src/common/mips_internal.h | 277 +
arch/mips/src/common/mips_interruptcontext.c | 70 +
arch/mips/src/common/mips_lowputs.c | 74 +
arch/mips/src/common/mips_mdelay.c | 90 +
arch/mips/src/common/mips_modifyreg16.c | 85 +
arch/mips/src/common/mips_modifyreg32.c | 85 +
arch/mips/src/common/mips_modifyreg8.c | 85 +
arch/mips/src/common/mips_puts.c | 75 +
arch/mips/src/common/mips_releasestack.c | 128 +
arch/mips/src/common/mips_stackframe.c | 143 +
arch/mips/src/common/mips_udelay.c | 133 +
arch/mips/src/common/mips_usestack.c | 170 +
arch/mips/src/common/up_allocateheap.c | 88 -
arch/mips/src/common/up_arch.h | 90 -
arch/mips/src/common/up_createstack.c | 214 -
arch/mips/src/common/up_etherstub.c | 86 -
arch/mips/src/common/up_exit.c | 200 -
arch/mips/src/common/up_idle.c | 77 -
arch/mips/src/common/up_initialize.c | 205 -
arch/mips/src/common/up_internal.h | 277 -
arch/mips/src/common/up_interruptcontext.c | 70 -
arch/mips/src/common/up_lowputs.c | 74 -
arch/mips/src/common/up_mdelay.c | 90 -
arch/mips/src/common/up_modifyreg16.c | 85 -
arch/mips/src/common/up_modifyreg32.c | 85 -
arch/mips/src/common/up_modifyreg8.c | 85 -
arch/mips/src/common/up_puts.c | 75 -
arch/mips/src/common/up_releasestack.c | 128 -
arch/mips/src/common/up_stackframe.c | 142 -
arch/mips/src/common/up_udelay.c | 133 -
arch/mips/src/common/up_usestack.c | 152 -
arch/mips/src/mips32/Kconfig | 6 +-
arch/mips/src/mips32/Toolchain.defs | 14 +-
arch/mips/src/mips32/mips_assert.c | 184 +
arch/mips/src/mips32/mips_blocktask.c | 177 +
arch/mips/src/mips32/mips_cache.S | 1307 +
arch/mips/src/mips32/mips_copystate.c | 85 +
arch/mips/src/mips32/mips_doirq.c | 148 +
arch/mips/src/mips32/mips_dumpstate.c | 237 +
arch/mips/src/mips32/mips_initialstate.c | 136 +
arch/mips/src/mips32/mips_irq.c | 136 +
arch/mips/src/mips32/mips_releasepending.c | 149 +
arch/mips/src/mips32/mips_reprioritizertr.c | 203 +
arch/mips/src/mips32/mips_schedulesigaction.c | 205 +
arch/mips/src/mips32/mips_sigdeliver.c | 126 +
arch/mips/src/mips32/mips_swint0.c | 325 +
arch/mips/src/mips32/mips_syscall0.S | 118 +
arch/mips/src/mips32/mips_unblocktask.c | 163 +
arch/mips/src/mips32/mips_vfork.c | 248 +
arch/mips/src/mips32/mips_vfork.h | 133 +
arch/mips/src/mips32/up_assert.c | 185 -
arch/mips/src/mips32/up_blocktask.c | 177 -
arch/mips/src/mips32/up_cache.S | 1307 -
arch/mips/src/mips32/up_copystate.c | 85 -
arch/mips/src/mips32/up_doirq.c | 148 -
arch/mips/src/mips32/up_dumpstate.c | 237 -
arch/mips/src/mips32/up_initialstate.c | 136 -
arch/mips/src/mips32/up_irq.c | 136 -
arch/mips/src/mips32/up_releasepending.c | 149 -
arch/mips/src/mips32/up_reprioritizertr.c | 203 -
arch/mips/src/mips32/up_schedulesigaction.c | 205 -
arch/mips/src/mips32/up_sigdeliver.c | 140 -
arch/mips/src/mips32/up_swint0.c | 313 -
arch/mips/src/mips32/up_syscall0.S | 118 -
arch/mips/src/mips32/up_unblocktask.c | 163 -
arch/mips/src/mips32/up_vfork.c | 262 -
arch/mips/src/mips32/up_vfork.h | 132 -
arch/mips/src/mips32/vfork.S | 10 +-
arch/mips/src/pic32mx/Make.defs | 41 +-
arch/mips/src/pic32mx/pic32mx-adc.h | 244 -
arch/mips/src/pic32mx/pic32mx-bmx.h | 167 -
arch/mips/src/pic32mx/pic32mx-can.h | 90 -
arch/mips/src/pic32mx/pic32mx-che.h | 186 -
arch/mips/src/pic32mx/pic32mx-cm.h | 141 -
arch/mips/src/pic32mx/pic32mx-config.h | 922 -
arch/mips/src/pic32mx/pic32mx-cvr.h | 114 -
arch/mips/src/pic32mx/pic32mx-ddp.h | 95 -
arch/mips/src/pic32mx/pic32mx-decodeirq.c | 200 -
arch/mips/src/pic32mx/pic32mx-devcfg.h | 283 -
arch/mips/src/pic32mx/pic32mx-dma.h | 697 -
arch/mips/src/pic32mx/pic32mx-ethernet.c | 3450 ---
arch/mips/src/pic32mx/pic32mx-ethernet.h | 931 -
arch/mips/src/pic32mx/pic32mx-exception.c | 183 -
arch/mips/src/pic32mx/pic32mx-flash.h | 131 -
arch/mips/src/pic32mx/pic32mx-gpio.c | 333 -
arch/mips/src/pic32mx/pic32mx-gpioirq.c | 290 -
arch/mips/src/pic32mx/pic32mx-head.S | 709 -
arch/mips/src/pic32mx/pic32mx-i2c.h | 306 -
arch/mips/src/pic32mx/pic32mx-ic.h | 167 -
arch/mips/src/pic32mx/pic32mx-int.h | 1085 -
arch/mips/src/pic32mx/pic32mx-ioport.h | 481 -
arch/mips/src/pic32mx/pic32mx-irq.c | 490 -
arch/mips/src/pic32mx/pic32mx-lowconsole.c | 365 -
arch/mips/src/pic32mx/pic32mx-lowinit.c | 213 -
arch/mips/src/pic32mx/pic32mx-memorymap.h | 535 -
arch/mips/src/pic32mx/pic32mx-oc.h | 212 -
arch/mips/src/pic32mx/pic32mx-osc.h | 166 -
arch/mips/src/pic32mx/pic32mx-pmp.h | 240 -
arch/mips/src/pic32mx/pic32mx-pps.h | 276 -
arch/mips/src/pic32mx/pic32mx-reset.h | 118 -
arch/mips/src/pic32mx/pic32mx-rtcc.h | 220 -
arch/mips/src/pic32mx/pic32mx-serial.c | 967 -
arch/mips/src/pic32mx/pic32mx-spi.c | 1007 -
arch/mips/src/pic32mx/pic32mx-spi.h | 291 -
arch/mips/src/pic32mx/pic32mx-timer.h | 223 -
arch/mips/src/pic32mx/pic32mx-timerisr.c | 191 -
arch/mips/src/pic32mx/pic32mx-uart.h | 278 -
arch/mips/src/pic32mx/pic32mx-usbdev.c | 4605 ----
arch/mips/src/pic32mx/pic32mx-usbotg.h | 362 -
arch/mips/src/pic32mx/pic32mx-wdt.h | 118 -
arch/mips/src/pic32mx/pic32mx.h | 31 +-
arch/mips/src/pic32mx/pic32mx_adc.h | 245 +
arch/mips/src/pic32mx/pic32mx_bmx.h | 168 +
arch/mips/src/pic32mx/pic32mx_can.h | 91 +
arch/mips/src/pic32mx/pic32mx_che.h | 185 +
arch/mips/src/pic32mx/pic32mx_cm.h | 142 +
arch/mips/src/pic32mx/pic32mx_config.h | 926 +
arch/mips/src/pic32mx/pic32mx_cvr.h | 115 +
arch/mips/src/pic32mx/pic32mx_ddp.h | 95 +
arch/mips/src/pic32mx/pic32mx_decodeirq.c | 202 +
arch/mips/src/pic32mx/pic32mx_devcfg.h | 283 +
arch/mips/src/pic32mx/pic32mx_dma.h | 697 +
arch/mips/src/pic32mx/pic32mx_ethernet.c | 3467 +++
arch/mips/src/pic32mx/pic32mx_ethernet.h | 931 +
arch/mips/src/pic32mx/pic32mx_exception.c | 185 +
arch/mips/src/pic32mx/pic32mx_flash.h | 131 +
arch/mips/src/pic32mx/pic32mx_gpio.c | 333 +
arch/mips/src/pic32mx/pic32mx_gpioirq.c | 290 +
arch/mips/src/pic32mx/pic32mx_head.S | 709 +
arch/mips/src/pic32mx/pic32mx_i2c.h | 306 +
arch/mips/src/pic32mx/pic32mx_ic.h | 167 +
arch/mips/src/pic32mx/pic32mx_int.h | 1085 +
arch/mips/src/pic32mx/pic32mx_ioport.h | 481 +
arch/mips/src/pic32mx/pic32mx_irq.c | 494 +
arch/mips/src/pic32mx/pic32mx_lowconsole.c | 365 +
arch/mips/src/pic32mx/pic32mx_lowinit.c | 214 +
arch/mips/src/pic32mx/pic32mx_memorymap.h | 535 +
arch/mips/src/pic32mx/pic32mx_oc.h | 212 +
arch/mips/src/pic32mx/pic32mx_osc.h | 166 +
arch/mips/src/pic32mx/pic32mx_pmp.h | 240 +
arch/mips/src/pic32mx/pic32mx_pps.h | 276 +
arch/mips/src/pic32mx/pic32mx_reset.h | 118 +
arch/mips/src/pic32mx/pic32mx_rtcc.h | 220 +
arch/mips/src/pic32mx/pic32mx_serial.c | 967 +
arch/mips/src/pic32mx/pic32mx_spi.c | 1013 +
arch/mips/src/pic32mx/pic32mx_spi.h | 291 +
arch/mips/src/pic32mx/pic32mx_timer.h | 223 +
arch/mips/src/pic32mx/pic32mx_timerisr.c | 193 +
arch/mips/src/pic32mx/pic32mx_uart.h | 278 +
arch/mips/src/pic32mx/pic32mx_usbdev.c | 4605 ++++
arch/mips/src/pic32mx/pic32mx_usbotg.h | 362 +
arch/mips/src/pic32mx/pic32mx_wdt.h | 118 +
arch/mips/src/pic32mz/Make.defs | 55 +-
arch/mips/src/pic32mz/hardware/pic32mz-dma.h | 805 -
arch/mips/src/pic32mz/hardware/pic32mz-ethernet.h | 1001 -
arch/mips/src/pic32mz/hardware/pic32mz-features.h | 53 -
arch/mips/src/pic32mz/hardware/pic32mz-i2c.h | 374 -
arch/mips/src/pic32mz/hardware/pic32mz-int.h | 1263 -
arch/mips/src/pic32mz/hardware/pic32mz-ioport.h | 909 -
arch/mips/src/pic32mz/hardware/pic32mz-memorymap.h | 53 -
arch/mips/src/pic32mz/hardware/pic32mz-osc.h | 234 -
arch/mips/src/pic32mz/hardware/pic32mz-pps.h | 117 -
arch/mips/src/pic32mz/hardware/pic32mz-prefetch.h | 82 -
arch/mips/src/pic32mz/hardware/pic32mz-spi.h | 333 -
arch/mips/src/pic32mz/hardware/pic32mz-timer.h | 311 -
arch/mips/src/pic32mz/hardware/pic32mz-uart.h | 293 -
arch/mips/src/pic32mz/hardware/pic32mz_dma.h | 805 +
arch/mips/src/pic32mz/hardware/pic32mz_ethernet.h | 1001 +
arch/mips/src/pic32mz/hardware/pic32mz_features.h | 53 +
arch/mips/src/pic32mz/hardware/pic32mz_i2c.h | 374 +
arch/mips/src/pic32mz/hardware/pic32mz_int.h | 1263 +
arch/mips/src/pic32mz/hardware/pic32mz_ioport.h | 909 +
arch/mips/src/pic32mz/hardware/pic32mz_memorymap.h | 53 +
arch/mips/src/pic32mz/hardware/pic32mz_osc.h | 234 +
arch/mips/src/pic32mz/hardware/pic32mz_pps.h | 117 +
arch/mips/src/pic32mz/hardware/pic32mz_prefetch.h | 82 +
arch/mips/src/pic32mz/hardware/pic32mz_spi.h | 333 +
arch/mips/src/pic32mz/hardware/pic32mz_timer.h | 311 +
arch/mips/src/pic32mz/hardware/pic32mz_uart.h | 293 +
arch/mips/src/pic32mz/hardware/pic32mzec-pps.h | 1718 --
.../{pic32mzec-features.h => pic32mzec_features.h} | 0
...pic32mzec-memorymap.h => pic32mzec_memorymap.h} | 0
arch/mips/src/pic32mz/hardware/pic32mzec_pps.h | 1718 ++
arch/mips/src/pic32mz/hardware/pic32mzef-pps.h | 1719 --
.../{pic32mzef-features.h => pic32mzef_features.h} | 0
...pic32mzef-memorymap.h => pic32mzef_memorymap.h} | 0
arch/mips/src/pic32mz/hardware/pic32mzef_pps.h | 1719 ++
arch/mips/src/pic32mz/pic32mz-config.h | 619 -
arch/mips/src/pic32mz/pic32mz-decodeirq.c | 200 -
arch/mips/src/pic32mz/pic32mz-dma.c | 1011 -
arch/mips/src/pic32mz/pic32mz-dma.h | 335 -
arch/mips/src/pic32mz/pic32mz-ethernet.c | 3624 ---
arch/mips/src/pic32mz/pic32mz-exception.c | 183 -
arch/mips/src/pic32mz/pic32mz-excptmacros.h | 449 -
arch/mips/src/pic32mz/pic32mz-freerun.c | 335 -
arch/mips/src/pic32mz/pic32mz-freerun.h | 179 -
arch/mips/src/pic32mz/pic32mz-gpio.c | 372 -
arch/mips/src/pic32mz/pic32mz-gpio.h | 333 -
arch/mips/src/pic32mz/pic32mz-gpioirq.c | 688 -
arch/mips/src/pic32mz/pic32mz-head.S | 966 -
arch/mips/src/pic32mz/pic32mz-i2c.c | 1948 --
arch/mips/src/pic32mz/pic32mz-i2c.h | 90 -
arch/mips/src/pic32mz/pic32mz-irq.c | 474 -
arch/mips/src/pic32mz/pic32mz-lowconsole.c | 500 -
arch/mips/src/pic32mz/pic32mz-lowconsole.h | 123 -
arch/mips/src/pic32mz/pic32mz-lowinit.c | 448 -
arch/mips/src/pic32mz/pic32mz-lowinit.h | 102 -
arch/mips/src/pic32mz/pic32mz-oneshot-lowerhalf.c | 353 -
arch/mips/src/pic32mz/pic32mz-oneshot.c | 464 -
arch/mips/src/pic32mz/pic32mz-oneshot.h | 208 -
arch/mips/src/pic32mz/pic32mz-serial.c | 1248 -
arch/mips/src/pic32mz/pic32mz-spi.c | 2136 --
arch/mips/src/pic32mz/pic32mz-spi.h | 231 -
arch/mips/src/pic32mz/pic32mz-timer-lowerhalf.c | 714 -
arch/mips/src/pic32mz/pic32mz-timer.c | 1253 -
arch/mips/src/pic32mz/pic32mz-timer.h | 167 -
arch/mips/src/pic32mz/pic32mz-timerisr.c | 187 -
arch/mips/src/pic32mz/pic32mz-usbdev.h | 128 -
arch/mips/src/pic32mz/pic32mz_config.h | 619 +
arch/mips/src/pic32mz/pic32mz_decodeirq.c | 202 +
arch/mips/src/pic32mz/pic32mz_dma.c | 1011 +
arch/mips/src/pic32mz/pic32mz_dma.h | 335 +
arch/mips/src/pic32mz/pic32mz_ethernet.c | 3643 +++
arch/mips/src/pic32mz/pic32mz_exception.c | 185 +
arch/mips/src/pic32mz/pic32mz_excptmacros.h | 449 +
arch/mips/src/pic32mz/pic32mz_freerun.c | 335 +
arch/mips/src/pic32mz/pic32mz_freerun.h | 179 +
arch/mips/src/pic32mz/pic32mz_gpio.c | 372 +
arch/mips/src/pic32mz/pic32mz_gpio.h | 333 +
arch/mips/src/pic32mz/pic32mz_gpioirq.c | 688 +
arch/mips/src/pic32mz/pic32mz_head.S | 966 +
arch/mips/src/pic32mz/pic32mz_i2c.c | 1948 ++
arch/mips/src/pic32mz/pic32mz_i2c.h | 90 +
arch/mips/src/pic32mz/pic32mz_irq.c | 478 +
arch/mips/src/pic32mz/pic32mz_lowconsole.c | 500 +
arch/mips/src/pic32mz/pic32mz_lowconsole.h | 123 +
arch/mips/src/pic32mz/pic32mz_lowinit.c | 448 +
arch/mips/src/pic32mz/pic32mz_lowinit.h | 102 +
arch/mips/src/pic32mz/pic32mz_oneshot.c | 465 +
arch/mips/src/pic32mz/pic32mz_oneshot.h | 208 +
arch/mips/src/pic32mz/pic32mz_oneshot_lowerhalf.c | 353 +
arch/mips/src/pic32mz/pic32mz_serial.c | 1251 +
arch/mips/src/pic32mz/pic32mz_spi.c | 2136 ++
arch/mips/src/pic32mz/pic32mz_spi.h | 231 +
arch/mips/src/pic32mz/pic32mz_timer.c | 1253 +
arch/mips/src/pic32mz/pic32mz_timer.h | 167 +
arch/mips/src/pic32mz/pic32mz_timer_lowerhalf.c | 714 +
arch/mips/src/pic32mz/pic32mz_timerisr.c | 189 +
arch/mips/src/pic32mz/pic32mz_usbdev.h | 128 +
arch/misoc/include/tls.h | 88 +
arch/misoc/src/.gitignore | 2 -
arch/misoc/src/Makefile | 64 +-
arch/misoc/src/lm32/Kconfig | 1 +
arch/misoc/src/lm32/Make.defs | 1 -
arch/misoc/src/lm32/Toolchain.defs | 17 +-
arch/misoc/src/lm32/lm32_assert.c | 25 +-
arch/misoc/src/lm32/lm32_blocktask.c | 12 +-
arch/misoc/src/lm32/lm32_createstack.c | 45 +-
arch/misoc/src/lm32/lm32_exit.c | 6 +-
arch/misoc/src/lm32/lm32_releasepending.c | 9 +-
arch/misoc/src/lm32/lm32_releasestack.c | 2 +-
arch/misoc/src/lm32/lm32_reprioritizertr.c | 62 +-
arch/misoc/src/lm32/lm32_sigdeliver.c | 46 +-
arch/misoc/src/lm32/lm32_swint.c | 67 +-
arch/misoc/src/lm32/lm32_unblocktask.c | 10 +-
arch/misoc/src/minerva/Kconfig | 1 +
arch/misoc/src/minerva/Make.defs | 1 -
arch/misoc/src/minerva/minerva_assert.c | 17 +-
arch/misoc/src/minerva/minerva_blocktask.c | 24 +-
arch/misoc/src/minerva/minerva_createstack.c | 54 +-
arch/misoc/src/minerva/minerva_exit.c | 10 +-
arch/misoc/src/minerva/minerva_releasepending.c | 16 +-
arch/misoc/src/minerva/minerva_releasestack.c | 2 +-
arch/misoc/src/minerva/minerva_reprioritizertr.c | 75 +-
arch/misoc/src/minerva/minerva_sigdeliver.c | 54 +-
arch/misoc/src/minerva/minerva_swint.c | 43 +-
arch/misoc/src/minerva/minerva_unblocktask.c | 26 +-
arch/or1k/include/tls.h | 92 +
arch/or1k/src/.gitignore | 2 -
arch/or1k/src/Makefile | 81 +-
arch/or1k/src/common/up_assert.c | 2 +-
arch/or1k/src/common/up_blocktask.c | 12 +-
arch/or1k/src/common/up_checkstack.c | 8 +-
arch/or1k/src/common/up_createstack.c | 58 +-
arch/or1k/src/common/up_exit.c | 6 +-
arch/or1k/src/common/up_pthread_start.c | 6 +-
arch/or1k/src/common/up_releasepending.c | 48 +-
arch/or1k/src/common/up_releasestack.c | 10 +-
arch/or1k/src/common/up_reprioritizertr.c | 58 +-
arch/or1k/src/common/up_task_start.c | 4 +-
arch/or1k/src/common/up_unblocktask.c | 54 +-
arch/or1k/src/mor1kx/Make.defs | 5 -
arch/or1k/src/mor1kx/Toolchain.defs | 2 +-
arch/renesas/Kconfig | 4 +
arch/renesas/include/arch.h | 6 +
arch/renesas/include/m16c/arch.h | 86 +
arch/renesas/include/rx65n/arch.h | 87 +
arch/renesas/include/rx65n/irq.h | 43 +-
arch/renesas/include/rx65n/limits.h | 41 +-
arch/renesas/include/rx65n/types.h | 41 +-
arch/renesas/include/sh1/arch.h | 86 +
arch/renesas/include/tls.h | 75 +
arch/renesas/src/.gitignore | 2 -
arch/renesas/src/Makefile | 88 +-
arch/renesas/src/common/up_assert.c | 26 +-
arch/renesas/src/common/up_blocktask.c | 66 +-
arch/renesas/src/common/up_createstack.c | 48 +-
arch/renesas/src/common/up_exit.c | 50 +-
arch/renesas/src/common/up_releasepending.c | 48 +-
arch/renesas/src/common/up_releasestack.c | 2 +-
arch/renesas/src/common/up_reprioritizertr.c | 64 +-
arch/renesas/src/common/up_unblocktask.c | 61 +-
arch/renesas/src/common/up_usestack.c | 13 +-
arch/renesas/src/m16c/Make.defs | 1 -
arch/renesas/src/m16c/m16c_dumpstate.c | 66 +-
arch/renesas/src/m16c/m16c_sigdeliver.c | 44 +-
arch/renesas/src/rx65n/Make.defs | 3 +-
arch/renesas/src/rx65n/rx65n_cmtw.h | 41 +-
arch/renesas/src/rx65n/rx65n_cmtw0.h | 49 +-
arch/renesas/src/rx65n/rx65n_definitions.h | 126 +-
arch/renesas/src/rx65n/rx65n_dumpstate.c | 15 +-
arch/renesas/src/rx65n/rx65n_eth.c | 698 +-
arch/renesas/src/rx65n/rx65n_eth.h | 60 +-
arch/renesas/src/rx65n/rx65n_hardware_setup.c | 44 +-
arch/renesas/src/rx65n/rx65n_initialstate.c | 41 +-
arch/renesas/src/rx65n/rx65n_lowputc.c | 43 +-
arch/renesas/src/rx65n/rx65n_macrodriver.h | 41 +-
arch/renesas/src/rx65n/rx65n_port.c | 267 +-
arch/renesas/src/rx65n/rx65n_port.h | 59 +-
arch/renesas/src/rx65n/rx65n_rtc.c | 150 +-
arch/renesas/src/rx65n/rx65n_rtc_lowerhalf.c | 12 +-
arch/renesas/src/rx65n/rx65n_schedulesigaction.c | 6 +-
arch/renesas/src/rx65n/rx65n_sci.c | 368 +-
arch/renesas/src/rx65n/rx65n_sci.h | 49 +-
arch/renesas/src/rx65n/rx65n_serial.c | 35 +-
arch/renesas/src/rx65n/rx65n_sigdeliver.c | 4 +-
arch/renesas/src/rx65n/rx65n_timerisr.c | 41 +-
arch/renesas/src/rx65n/rx65n_vector_table.c | 2 +-
arch/renesas/src/sh1/Make.defs | 5 -
arch/renesas/src/sh1/sh1_dumpstate.c | 24 +-
arch/renesas/src/sh1/sh1_sigdeliver.c | 44 +-
arch/risc-v/Kconfig | 1 +
arch/risc-v/include/arch.h | 9 +-
arch/risc-v/include/rv32im/arch.h | 83 +
arch/risc-v/include/rv64gc/arch.h | 83 +
arch/risc-v/include/tls.h | 75 +
arch/risc-v/src/.gitignore | 2 -
arch/risc-v/src/Makefile | 80 +-
arch/risc-v/src/common/riscv_allocateheap.c | 88 +
arch/risc-v/src/common/riscv_arch.h | 88 +
arch/risc-v/src/common/riscv_checkstack.c | 223 +
arch/risc-v/src/common/riscv_createstack.c | 290 +
arch/risc-v/src/common/riscv_exit.c | 198 +
arch/risc-v/src/common/riscv_idle.c | 91 +
arch/risc-v/src/common/riscv_initialize.c | 172 +
arch/risc-v/src/common/riscv_internal.h | 246 +
arch/risc-v/src/common/riscv_interruptcontext.c | 74 +
arch/risc-v/src/common/riscv_mdelay.c | 70 +
arch/risc-v/src/common/riscv_modifyreg32.c | 73 +
arch/risc-v/src/common/riscv_pthread_start.c | 72 +
arch/risc-v/src/common/riscv_puts.c | 63 +
arch/risc-v/src/common/riscv_releasestack.c | 128 +
arch/risc-v/src/common/riscv_stackframe.c | 143 +
arch/risc-v/src/common/riscv_task_start.c | 72 +
arch/risc-v/src/common/riscv_udelay.c | 117 +
arch/risc-v/src/common/riscv_usestack.c | 174 +
arch/risc-v/src/common/up_allocateheap.c | 88 -
arch/risc-v/src/common/up_arch.h | 88 -
arch/risc-v/src/common/up_checkstack.c | 225 -
arch/risc-v/src/common/up_createstack.c | 240 -
arch/risc-v/src/common/up_exit.c | 198 -
arch/risc-v/src/common/up_idle.c | 95 -
arch/risc-v/src/common/up_initialize.c | 172 -
arch/risc-v/src/common/up_internal.h | 246 -
arch/risc-v/src/common/up_interruptcontext.c | 74 -
arch/risc-v/src/common/up_mdelay.c | 70 -
arch/risc-v/src/common/up_modifyreg32.c | 73 -
arch/risc-v/src/common/up_pthread_start.c | 72 -
arch/risc-v/src/common/up_puts.c | 63 -
arch/risc-v/src/common/up_releasestack.c | 128 -
arch/risc-v/src/common/up_stackframe.c | 143 -
arch/risc-v/src/common/up_task_start.c | 72 -
arch/risc-v/src/common/up_udelay.c | 117 -
arch/risc-v/src/common/up_usestack.c | 152 -
arch/risc-v/src/fe310/Make.defs | 20 +-
arch/risc-v/src/fe310/fe310.h | 2 +-
arch/risc-v/src/fe310/fe310_clockconfig.c | 2 +-
arch/risc-v/src/fe310/fe310_gpio.c | 2 +-
arch/risc-v/src/fe310/fe310_gpio.h | 4 +-
arch/risc-v/src/fe310/fe310_idle.c | 2 +-
arch/risc-v/src/fe310/fe310_irq.c | 6 +-
arch/risc-v/src/fe310/fe310_irq_dispatch.c | 4 +-
arch/risc-v/src/fe310/fe310_lowputc.c | 4 +-
arch/risc-v/src/fe310/fe310_schedulesigaction.c | 209 +
arch/risc-v/src/fe310/fe310_serial.c | 8 +-
arch/risc-v/src/fe310/fe310_timerisr.c | 2 +-
arch/risc-v/src/fe310/up_schedulesigaction.c | 209 -
arch/risc-v/src/gap8/Make.defs | 18 +-
arch/risc-v/src/gap8/gap8_allocateheap.c | 13 +-
arch/risc-v/src/gap8/gap8_head.S | 373 +
arch/risc-v/src/gap8/gap8_idle.c | 2 +-
arch/risc-v/src/gap8/gap8_schedulesigaction.c | 4 +-
arch/risc-v/src/gap8/startup_gap8.S | 373 -
arch/risc-v/src/k210/Make.defs | 26 +-
arch/risc-v/src/k210/hardware/k210_memorymap.h | 40 +-
arch/risc-v/src/k210/hardware/k210_sysctl.h | 48 +
arch/risc-v/src/k210/k210.h | 2 +-
arch/risc-v/src/k210/k210_clockconfig.c | 95 +-
arch/risc-v/src/k210/k210_clockconfig.h | 3 +-
arch/risc-v/src/k210/k210_cpuidlestack.c | 2 +-
arch/risc-v/src/k210/k210_cpuindex.c | 2 +-
arch/risc-v/src/k210/k210_cpupause.c | 8 +-
arch/risc-v/src/k210/k210_cpustart.c | 4 +-
arch/risc-v/src/k210/k210_idle.c | 2 +-
arch/risc-v/src/k210/k210_irq.c | 4 +-
arch/risc-v/src/k210/k210_irq_dispatch.c | 4 +-
arch/risc-v/src/k210/k210_lowputc.c | 4 +-
arch/risc-v/src/k210/k210_memorymap.h | 1 +
arch/risc-v/src/k210/k210_schedulesigaction.c | 411 +
arch/risc-v/src/k210/k210_serial.c | 8 +-
arch/risc-v/src/k210/k210_start.c | 4 +-
arch/risc-v/src/k210/k210_timerisr.c | 2 +-
arch/risc-v/src/k210/up_schedulesigaction.c | 411 -
arch/risc-v/src/litex/Make.defs | 20 +-
arch/risc-v/src/litex/litex.h | 2 +-
arch/risc-v/src/litex/litex_clockconfig.c | 2 +-
arch/risc-v/src/litex/litex_idle.c | 2 +-
arch/risc-v/src/litex/litex_irq.c | 4 +-
arch/risc-v/src/litex/litex_irq_dispatch.c | 4 +-
arch/risc-v/src/litex/litex_lowputc.c | 4 +-
arch/risc-v/src/litex/litex_schedulesigaction.c | 192 +
arch/risc-v/src/litex/litex_serial.c | 4 +-
arch/risc-v/src/litex/litex_timerisr.c | 2 +-
arch/risc-v/src/litex/up_schedulesigaction.c | 192 -
arch/risc-v/src/nr5m100/Make.defs | 16 +-
arch/risc-v/src/nr5m100/chip.h | 12 -
arch/risc-v/src/nr5m100/nr5.h | 10 +-
arch/risc-v/src/nr5m100/nr5_irq_dispatch.c | 62 +-
arch/risc-v/src/nr5m100/nr5_lowputc.c | 20 +-
arch/risc-v/src/nr5m100/nr5_schedulesigaction.c | 209 +
arch/risc-v/src/nr5m100/nr5_serial.c | 67 +-
arch/risc-v/src/nr5m100/nr5_timer.c | 15 +-
arch/risc-v/src/nr5m100/nr5_timerisr.c | 2 +-
arch/risc-v/src/nr5m100/up_schedulesigaction.c | 209 -
arch/risc-v/src/rv32im/Kconfig | 3 +-
arch/risc-v/src/rv32im/Toolchain.defs | 26 +-
arch/risc-v/src/rv32im/riscv_assert.c | 388 +
arch/risc-v/src/rv32im/riscv_blocktask.c | 177 +
arch/risc-v/src/rv32im/riscv_copystate.c | 85 +
arch/risc-v/src/rv32im/riscv_doirq.c | 148 +
arch/risc-v/src/rv32im/{up_fpu.S => riscv_fpu.S} | 0
arch/risc-v/src/rv32im/riscv_initialstate.c | 120 +
arch/risc-v/src/rv32im/riscv_releasepending.c | 149 +
arch/risc-v/src/rv32im/riscv_reprioritizertr.c | 203 +
arch/risc-v/src/rv32im/riscv_sigdeliver.c | 146 +
arch/risc-v/src/rv32im/riscv_swint.c | 306 +
.../src/rv32im/{up_syscall.S => riscv_syscall.S} | 0
arch/risc-v/src/rv32im/riscv_unblocktask.c | 163 +
arch/risc-v/src/rv32im/riscv_vfork.c | 269 +
arch/risc-v/src/rv32im/riscv_vfork.h | 134 +
arch/risc-v/src/rv32im/up_assert.c | 401 -
arch/risc-v/src/rv32im/up_blocktask.c | 177 -
arch/risc-v/src/rv32im/up_copystate.c | 85 -
arch/risc-v/src/rv32im/up_doirq.c | 148 -
arch/risc-v/src/rv32im/up_initialstate.c | 120 -
arch/risc-v/src/rv32im/up_releasepending.c | 148 -
arch/risc-v/src/rv32im/up_reprioritizertr.c | 203 -
arch/risc-v/src/rv32im/up_sigdeliver.c | 145 -
arch/risc-v/src/rv32im/up_swint.c | 297 -
arch/risc-v/src/rv32im/up_unblocktask.c | 163 -
arch/risc-v/src/rv32im/up_vfork.c | 268 -
arch/risc-v/src/rv32im/up_vfork.h | 132 -
arch/risc-v/src/rv64gc/Kconfig | 3 +-
arch/risc-v/src/rv64gc/Toolchain.defs | 16 +-
arch/risc-v/src/rv64gc/riscv_assert.c | 419 +
arch/risc-v/src/rv64gc/riscv_blocktask.c | 177 +
arch/risc-v/src/rv64gc/riscv_copystate.c | 85 +
arch/risc-v/src/rv64gc/riscv_fault.c | 123 +
arch/risc-v/src/rv64gc/riscv_initialstate.c | 101 +
arch/risc-v/src/rv64gc/riscv_releasepending.c | 149 +
arch/risc-v/src/rv64gc/riscv_reprioritizertr.c | 203 +
arch/risc-v/src/rv64gc/riscv_sigdeliver.c | 203 +
arch/risc-v/src/rv64gc/riscv_signal_dispatch.c | 75 +
...{up_signal_handler.S => riscv_signal_handler.S} | 0
arch/risc-v/src/rv64gc/riscv_swint.c | 465 +
.../src/rv64gc/{up_testset.S => riscv_testset.S} | 0
arch/risc-v/src/rv64gc/riscv_unblocktask.c | 163 +
arch/risc-v/src/rv64gc/up_assert.c | 435 -
arch/risc-v/src/rv64gc/up_blocktask.c | 177 -
arch/risc-v/src/rv64gc/up_copystate.c | 85 -
arch/risc-v/src/rv64gc/up_fault.c | 123 -
arch/risc-v/src/rv64gc/up_initialstate.c | 101 -
arch/risc-v/src/rv64gc/up_releasepending.c | 149 -
arch/risc-v/src/rv64gc/up_reprioritizertr.c | 203 -
arch/risc-v/src/rv64gc/up_sigdeliver.c | 203 -
arch/risc-v/src/rv64gc/up_signal_dispatch.c | 76 -
arch/risc-v/src/rv64gc/up_swint.c | 461 -
arch/risc-v/src/rv64gc/up_unblocktask.c | 163 -
arch/sim/Kconfig | 3 +-
arch/sim/include/tls.h | 46 +-
arch/sim/src/.gitignore | 3 -
arch/sim/src/Makefile | 28 +-
arch/sim/src/nuttx-names.dat | 3 +
arch/sim/src/sim/up_blocktask.c | 10 +-
arch/sim/src/sim/up_checkstack.c | 8 +-
arch/sim/src/sim/up_createstack.c | 22 +-
arch/sim/src/sim/up_exit.c | 4 +-
arch/sim/src/sim/up_hostfs.c | 36 +-
arch/sim/src/sim/up_internal.h | 5 +-
arch/sim/src/sim/up_netdriver.c | 37 +-
arch/sim/src/sim/up_releasepending.c | 6 +-
arch/sim/src/sim/up_reprioritizertr.c | 14 +-
arch/sim/src/sim/up_rptun.c | 5 +-
arch/sim/src/sim/up_setjmp64.S | 2 +-
arch/sim/src/sim/up_smpsignal.c | 4 +-
arch/sim/src/sim/up_tapdev.c | 28 +-
arch/sim/src/sim/up_touchscreen.c | 2 +-
arch/sim/src/sim/up_unblocktask.c | 8 +-
arch/sim/src/sim/up_usestack.c | 15 +-
arch/x86/include/tls.h | 75 +
arch/x86/src/.gitignore | 2 -
arch/x86/src/Makefile | 69 +-
arch/x86/src/common/up_assert.c | 30 +-
arch/x86/src/common/up_blocktask.c | 70 +-
arch/x86/src/common/up_exit.c | 48 +-
arch/x86/src/common/up_releasepending.c | 50 +-
arch/x86/src/common/up_reprioritizertr.c | 60 +-
arch/x86/src/common/up_unblocktask.c | 61 +-
arch/x86/src/i486/up_createstack.c | 48 +-
arch/x86/src/i486/up_releasestack.c | 2 +-
arch/x86/src/i486/up_sigdeliver.c | 43 +-
arch/x86/src/i486/up_usestack.c | 19 +-
arch/x86/src/qemu/qemu_idle.c | 2 +
arch/x86_64/include/intel64/arch.h | 33 +-
arch/x86_64/include/tls.h | 75 +
arch/x86_64/src/.gitignore | 2 -
arch/x86_64/src/Makefile | 83 +-
arch/x86_64/src/common/up_assert.c | 7 +-
arch/x86_64/src/common/up_blocktask.c | 12 +-
arch/x86_64/src/common/up_exit.c | 2 +-
arch/x86_64/src/common/up_initialize.c | 11 +-
arch/x86_64/src/common/up_releasepending.c | 8 +-
arch/x86_64/src/common/up_reprioritizertr.c | 19 +-
arch/x86_64/src/common/up_unblocktask.c | 10 +-
arch/x86_64/src/intel64/Kconfig | 15 +-
arch/x86_64/src/intel64/intel64_check_capability.c | 7 +-
arch/x86_64/src/intel64/intel64_handlers.c | 21 +-
arch/x86_64/src/intel64/intel64_head.S | 92 +-
arch/x86_64/src/intel64/intel64_lowsetup.c | 35 +-
arch/x86_64/src/intel64/intel64_rng.c | 16 +-
arch/x86_64/src/intel64/up_createstack.c | 44 +-
arch/x86_64/src/intel64/up_initialstate.c | 1 +
arch/x86_64/src/intel64/up_irq.c | 35 +-
arch/x86_64/src/intel64/up_regdump.c | 10 +-
arch/x86_64/src/intel64/up_releasestack.c | 5 +-
arch/x86_64/src/intel64/up_sigdeliver.c | 6 +-
arch/x86_64/src/intel64/up_usestack.c | 13 +-
arch/xtensa/include/tls.h | 92 +
arch/xtensa/src/.gitignore | 2 -
arch/xtensa/src/Makefile | 73 +-
arch/xtensa/src/common/xtensa.h | 6 +
arch/xtensa/src/common/xtensa_assert.c | 7 +-
arch/xtensa/src/common/xtensa_blocktask.c | 12 +-
arch/xtensa/src/common/xtensa_checkstack.c | 12 +-
arch/xtensa/src/common/xtensa_cpupause.c | 4 +-
arch/xtensa/src/common/xtensa_createstack.c | 84 +-
arch/xtensa/src/common/xtensa_dumpstate.c | 2 +-
arch/xtensa/src/common/xtensa_exit.c | 6 +-
arch/xtensa/src/common/xtensa_releasepending.c | 8 +-
arch/xtensa/src/common/xtensa_releasestack.c | 2 +-
arch/xtensa/src/common/xtensa_reprioritizertr.c | 59 +-
arch/xtensa/src/common/xtensa_sigdeliver.c | 43 +-
arch/xtensa/src/common/xtensa_unblocktask.c | 10 +-
arch/xtensa/src/common/xtensa_usestack.c | 24 +-
arch/xtensa/src/esp32/Make.defs | 1 -
arch/xtensa/src/esp32/esp32_cpustart.c | 43 +-
arch/xtensa/src/esp32/esp32_user.c | 2 +-
arch/z16/Kconfig | 1 +
arch/z16/include/tls.h | 71 +
arch/z16/src/.gitignore | 7 -
arch/z16/src/Makefile | 62 +-
arch/z16/src/common/up_allocateheap.c | 112 -
arch/z16/src/common/up_arch.h | 52 -
arch/z16/src/common/up_assert.c | 198 -
arch/z16/src/common/up_blocktask.c | 165 -
arch/z16/src/common/up_copystate.c | 63 -
arch/z16/src/common/up_createstack.c | 174 -
arch/z16/src/common/up_doirq.c | 115 -
arch/z16/src/common/up_exit.c | 181 -
arch/z16/src/common/up_idle.c | 99 -
arch/z16/src/common/up_initialize.c | 202 -
arch/z16/src/common/up_initialstate.c | 79 -
arch/z16/src/common/up_internal.h | 187 -
arch/z16/src/common/up_interruptcontext.c | 63 -
arch/z16/src/common/up_mdelay.c | 73 -
arch/z16/src/common/up_registerdump.c | 89 -
arch/z16/src/common/up_releasepending.c | 136 -
arch/z16/src/common/up_releasestack.c | 106 -
arch/z16/src/common/up_reprioritizertr.c | 190 -
arch/z16/src/common/up_schedulesigaction.c | 184 -
arch/z16/src/common/up_sigdeliver.c | 131 -
arch/z16/src/common/up_stackdump.c | 94 -
arch/z16/src/common/up_stackframe.c | 139 -
arch/z16/src/common/up_udelay.c | 132 -
arch/z16/src/common/up_unblocktask.c | 153 -
arch/z16/src/common/up_usestack.c | 131 -
arch/z16/src/common/z16_allocateheap.c | 89 +
arch/z16/src/common/z16_arch.h | 37 +
arch/z16/src/common/z16_assert.c | 181 +
arch/z16/src/common/z16_blocktask.c | 150 +
arch/z16/src/common/z16_copystate.c | 48 +
arch/z16/src/common/z16_createstack.c | 214 +
arch/z16/src/common/z16_doirq.c | 100 +
arch/z16/src/common/z16_exit.c | 165 +
arch/z16/src/common/z16_idle.c | 84 +
arch/z16/src/common/z16_initialize.c | 187 +
arch/z16/src/common/z16_initialstate.c | 64 +
arch/z16/src/common/z16_internal.h | 171 +
arch/z16/src/common/z16_interruptcontext.c | 48 +
arch/z16/src/common/z16_mdelay.c | 58 +
arch/z16/src/common/z16_registerdump.c | 75 +
arch/z16/src/common/z16_releasepending.c | 120 +
arch/z16/src/common/z16_releasestack.c | 91 +
arch/z16/src/common/z16_reprioritizertr.c | 176 +
arch/z16/src/common/z16_schedulesigaction.c | 170 +
arch/z16/src/common/z16_sigdeliver.c | 115 +
arch/z16/src/common/z16_stackdump.c | 82 +
arch/z16/src/common/z16_stackframe.c | 117 +
arch/z16/src/common/z16_udelay.c | 105 +
arch/z16/src/common/z16_unblocktask.c | 138 +
arch/z16/src/common/z16_usestack.c | 127 +
arch/z16/src/z16f/Kconfig | 5 +-
arch/z16/src/z16f/Make.defs | 54 +-
arch/z16/src/z16f/Toolchain.defs | 17 +-
arch/z16/src/z16f/chip.h | 79 +-
arch/z16/src/z16f/z16f_espi.c | 53 +-
arch/z16/src/z16f/z16f_head.S | 51 +-
arch/z16/src/z16f/z16f_irq.c | 64 +-
arch/z16/src/z16f/z16f_lowuart.S | 49 +-
arch/z16/src/z16f/z16f_restoreusercontext.S | 45 +-
arch/z16/src/z16f/z16f_saveusercontext.S | 42 +-
arch/z16/src/z16f/z16f_serial.c | 217 +-
arch/z16/src/z16f/z16f_sysexec.c | 18 +-
arch/z16/src/z16f/z16f_timerisr.c | 42 +-
arch/z80/Kconfig | 2 +
arch/z80/include/tls.h | 71 +
arch/z80/src/.gitignore | 15 +-
arch/z80/src/Makefile | 6 +-
arch/z80/src/Makefile.sdccl | 5 +-
arch/z80/src/Makefile.sdccw | 5 +-
arch/z80/src/Makefile.zdsiil | 6 +-
arch/z80/src/Makefile.zdsiiw | 6 +-
arch/z80/src/common/up_allocateheap.c | 95 -
arch/z80/src/common/up_arch.h | 37 -
arch/z80/src/common/up_assert.c | 183 -
arch/z80/src/common/up_blocktask.c | 162 -
arch/z80/src/common/up_createstack.c | 177 -
arch/z80/src/common/up_exit.c | 177 -
arch/z80/src/common/up_idle.c | 92 -
arch/z80/src/common/up_initialize.c | 186 -
arch/z80/src/common/up_interruptcontext.c | 57 -
arch/z80/src/common/up_mdelay.c | 78 -
arch/z80/src/common/up_puts.c | 60 -
arch/z80/src/common/up_releasepending.c | 132 -
arch/z80/src/common/up_releasestack.c | 113 -
arch/z80/src/common/up_reprioritizertr.c | 188 -
arch/z80/src/common/up_stackdump.c | 80 -
arch/z80/src/common/up_stackframe.c | 116 -
arch/z80/src/common/up_udelay.c | 121 -
arch/z80/src/common/up_unblocktask.c | 150 -
arch/z80/src/common/up_usestack.c | 115 -
arch/z80/src/common/z80_allocateheap.c | 95 +
arch/z80/src/common/z80_arch.h | 37 +
arch/z80/src/common/z80_assert.c | 182 +
arch/z80/src/common/z80_blocktask.c | 162 +
arch/z80/src/common/z80_createstack.c | 219 +
arch/z80/src/common/z80_doirq.c | 2 +-
arch/z80/src/common/z80_exit.c | 177 +
arch/z80/src/common/z80_idle.c | 92 +
arch/z80/src/common/z80_initialize.c | 186 +
arch/z80/src/common/z80_interruptcontext.c | 57 +
arch/z80/src/common/z80_mdelay.c | 78 +
arch/z80/src/common/z80_puts.c | 60 +
arch/z80/src/common/z80_releasepending.c | 132 +
arch/z80/src/common/z80_releasestack.c | 113 +
arch/z80/src/common/z80_reprioritizertr.c | 188 +
arch/z80/src/common/z80_stackdump.c | 80 +
arch/z80/src/common/z80_stackframe.c | 116 +
arch/z80/src/common/z80_udelay.c | 121 +
arch/z80/src/common/z80_unblocktask.c | 150 +
arch/z80/src/common/z80_usestack.c | 126 +
arch/z80/src/ez80/Make.defs | 19 +-
arch/z80/src/ez80/Toolchain.defs | 14 -
arch/z80/src/ez80/ez80_initialstate.c | 2 +-
arch/z80/src/ez80/ez80_rtc.c | 2 +-
arch/z80/src/ez80/ez80_rtc_lowerhalf.c | 2 +-
arch/z80/src/ez80/ez80_serial.c.SAVE | 850 +
arch/z80/src/ez80/ez80_sigdeliver.c | 4 +-
arch/z80/src/ez80/ez80_spi.c | 2 +-
arch/z80/src/ez80/up_mem.h | 73 -
arch/z80/src/ez80/z80_mem.h | 73 +
arch/z80/src/z180/Kconfig | 1 +
arch/z80/src/z180/Make.defs | 11 +-
arch/z80/src/z180/Toolchain.defs | 24 -
arch/z80/src/z180/up_mem.h | 75 -
arch/z80/src/z180/z180_initialstate.c | 41 +-
arch/z80/src/z180/z180_sigdeliver.c | 43 +-
arch/z80/src/z180/z80_mem.h | 75 +
arch/z80/src/z8/Make.defs | 11 +-
arch/z80/src/z8/Toolchain.defs | 14 -
arch/z80/src/z8/up_mem.h | 89 -
arch/z80/src/z8/z80_mem.h | 74 +
arch/z80/src/z8/z8_initialstate.c | 41 +-
arch/z80/src/z8/z8_sigdeliver.c | 44 +-
arch/z80/src/z80/.gitignore | 2 -
arch/z80/src/z80/Kconfig | 1 +
arch/z80/src/z80/Make.defs | 11 +-
arch/z80/src/z80/Toolchain.defs | 24 -
arch/z80/src/z80/up_mem.h | 75 -
arch/z80/src/z80/z80_initialstate.c | 41 +-
arch/z80/src/z80/z80_mem.h | 75 +
arch/z80/src/z80/z80_sigdeliver.c | 44 +-
audio/.gitignore | 10 -
audio/Makefile | 10 +-
binfmt/.gitignore | 10 -
binfmt/Kconfig | 7 -
binfmt/Makefile | 16 +-
binfmt/binfmt.h | 4 +-
binfmt/binfmt_exec.c | 30 +-
binfmt/binfmt_execmodule.c | 14 +-
binfmt/binfmt_initialize.c | 2 +-
binfmt/binfmt_loadmodule.c | 4 +-
binfmt/builtin.c | 4 +-
binfmt/nxflat.c | 2 +-
boards/.gitignore | 25 +-
boards/Board.mk | 38 +-
boards/Kconfig | 14 +
boards/Makefile | 16 +-
boards/arm/a1x/drivers/Kconfig | 4 -
boards/arm/a1x/pcduino-a10/README.txt | 2 +-
boards/arm/a1x/pcduino-a10/configs/nsh/defconfig | 1 -
.../pcduino-a10/configs/nsh/pcduino-140107.patch | 4 +-
boards/arm/a1x/pcduino-a10/scripts/Make.defs | 47 +-
boards/arm/a1x/pcduino-a10/src/Makefile | 3 +-
boards/arm/a1x/pcduino-a10/src/a1x_appinit.c | 2 +-
boards/arm/a1x/pcduino-a10/src/a1x_leds.c | 4 +-
boards/arm/am335x/beaglebone-black/README.txt | 4 +-
.../arm/am335x/beaglebone-black/scripts/Make.defs | 36 +-
boards/arm/am335x/beaglebone-black/src/Makefile | 3 +-
.../am335x/beaglebone-black/src/am335x_appinit.c | 2 +-
.../arm/am335x/beaglebone-black/src/am335x_leds.c | 4 +-
boards/arm/am335x/drivers/Kconfig | 4 -
boards/arm/c5471/c5471evm/scripts/Make.defs | 38 +-
boards/arm/c5471/c5471evm/src/.gitignore | 2 -
boards/arm/c5471/c5471evm/src/Makefile | 3 +-
boards/arm/c5471/c5471evm/src/c5471_leds.c | 2 +-
boards/arm/c5471/drivers/Kconfig | 4 -
boards/arm/cxd56xx/common/.gitignore | 1 -
boards/arm/cxd56xx/common/Makefile | 6 +-
boards/arm/cxd56xx/common/src/Make.defs | 2 +-
boards/arm/cxd56xx/common/src/cxd56_audio.c | 33 +-
boards/arm/cxd56xx/common/src/cxd56_boot.c | 4 +-
boards/arm/cxd56xx/common/src/cxd56_crashdump.c | 4 +-
boards/arm/cxd56xx/common/src/cxd56_gs2200m.c | 30 +-
boards/arm/cxd56xx/common/src/cxd56_imageproc.c | 4 +-
boards/arm/cxd56xx/common/src/cxd56_netinit.c | 4 +-
boards/arm/cxd56xx/drivers/Make.defs | 6 +-
boards/arm/cxd56xx/drivers/audio/Make.defs | 2 +-
boards/arm/cxd56xx/drivers/camera/Make.defs | 2 +-
boards/arm/cxd56xx/drivers/sensors/Make.defs | 2 +-
boards/arm/cxd56xx/spresense/README.txt | 10 +-
.../arm/cxd56xx/spresense/configs/rndis/defconfig | 17 +
.../arm/cxd56xx/spresense/configs/wifi/defconfig | 24 +-
boards/arm/cxd56xx/spresense/scripts/Make.defs | 48 +-
boards/arm/cxd56xx/spresense/src/.gitignore | 2 -
boards/arm/cxd56xx/spresense/src/Make.defs | 2 +-
boards/arm/cxd56xx/spresense/src/cxd56_appinit.c | 2 +-
boards/arm/cxd56xx/spresense/src/cxd56_ostest.c | 8 +-
boards/arm/cxd56xx/spresense/src/cxd56_power.c | 2 +-
boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c | 2 +-
boards/arm/cxd56xx/spresense/src/cxd56_spi.c | 2 +-
boards/arm/dm320/drivers/Kconfig | 4 -
boards/arm/dm320/ntosd-dm320/README.txt | 66 +-
.../dm320/ntosd-dm320/configs/nettest/defconfig | 1 -
boards/arm/dm320/ntosd-dm320/configs/nsh/defconfig | 1 -
.../arm/dm320/ntosd-dm320/configs/poll/defconfig | 1 -
.../dm320/ntosd-dm320/configs/webserver/defconfig | 1 -
boards/arm/dm320/ntosd-dm320/scripts/Make.defs | 36 +-
boards/arm/dm320/ntosd-dm320/src/.gitignore | 2 -
boards/arm/dm320/ntosd-dm320/src/Makefile | 3 +-
boards/arm/dm320/ntosd-dm320/src/dm320_appinit.c | 2 +-
boards/arm/dm320/ntosd-dm320/src/dm320_leds.c | 2 +-
boards/arm/dm320/ntosd-dm320/src/dm320_network.c | 8 +-
boards/arm/efm32/drivers/Kconfig | 4 -
boards/arm/efm32/efm32-g8xx-stk/README.txt | 4 +-
.../arm/efm32/efm32-g8xx-stk/configs/nsh/defconfig | 1 -
boards/arm/efm32/efm32-g8xx-stk/scripts/Make.defs | 36 +-
boards/arm/efm32/efm32-g8xx-stk/src/.gitignore | 2 -
boards/arm/efm32/efm32-g8xx-stk/src/Makefile | 3 +-
.../arm/efm32/efm32-g8xx-stk/src/efm32_autoleds.c | 4 +-
.../arm/efm32/efm32-g8xx-stk/src/efm32_userleds.c | 4 +-
boards/arm/efm32/efm32gg-stk3700/README.txt | 4 +-
.../efm32/efm32gg-stk3700/configs/nsh/defconfig | 1 -
boards/arm/efm32/efm32gg-stk3700/scripts/Make.defs | 36 +-
boards/arm/efm32/efm32gg-stk3700/src/.gitignore | 2 -
boards/arm/efm32/efm32gg-stk3700/src/Makefile | 3 +-
.../arm/efm32/olimex-efm32g880f128-stk/README.txt | 5 +-
.../olimex-efm32g880f128-stk/configs/nsh/defconfig | 1 -
.../olimex-efm32g880f128-stk/scripts/Make.defs | 36 +-
.../efm32/olimex-efm32g880f128-stk/src/.gitignore | 2 -
.../efm32/olimex-efm32g880f128-stk/src/Makefile | 3 +-
boards/arm/imx6/drivers/Kconfig | 4 -
boards/arm/imx6/sabre-6quad/README.txt | 2 +-
boards/arm/imx6/sabre-6quad/scripts/Make.defs | 53 +-
boards/arm/imx6/sabre-6quad/src/Makefile | 3 +-
boards/arm/imx6/sabre-6quad/src/imx_appinit.c | 2 +-
boards/arm/imx6/sabre-6quad/src/imx_autoleds.c | 2 +-
boards/arm/imx6/sabre-6quad/src/imx_boardinit.c | 2 +-
boards/arm/imxrt/drivers/Kconfig | 4 -
boards/arm/imxrt/imxrt1020-evk/.gitignore | 3 -
boards/arm/imxrt/imxrt1020-evk/scripts/Make.defs | 38 +-
boards/arm/imxrt/imxrt1020-evk/src/Makefile | 3 +-
boards/arm/imxrt/imxrt1020-evk/src/imxrt_appinit.c | 2 +-
boards/arm/imxrt/imxrt1020-evk/src/imxrt_bringup.c | 2 +-
boards/arm/imxrt/imxrt1020-evk/src/imxrt_buttons.c | 2 +-
boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c | 2 +-
.../arm/imxrt/imxrt1050-evk/configs/knsh/Make.defs | 42 +-
.../imxrt1050-evk/configs/libcxxtest/Make.defs | 38 +-
boards/arm/imxrt/imxrt1050-evk/kernel/.gitignore | 1 -
boards/arm/imxrt/imxrt1050-evk/kernel/Makefile | 16 +-
boards/arm/imxrt/imxrt1050-evk/scripts/Make.defs | 38 +-
boards/arm/imxrt/imxrt1050-evk/src/Makefile | 3 +-
boards/arm/imxrt/imxrt1050-evk/src/imxrt_appinit.c | 2 +-
boards/arm/imxrt/imxrt1050-evk/src/imxrt_buttons.c | 2 +-
.../arm/imxrt/imxrt1050-evk/src/imxrt_mmcsd_spi.c | 2 +-
boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c | 2 +-
.../arm/imxrt/imxrt1060-evk/configs/knsh/Make.defs | 42 +-
.../imxrt1060-evk/configs/libcxxtest/Make.defs | 38 +-
.../arm/imxrt/imxrt1060-evk/configs/lvgl/defconfig | 16 +-
.../imxrt/imxrt1060-evk/configs/netnsh/defconfig | 5 +-
boards/arm/imxrt/imxrt1060-evk/kernel/.gitignore | 1 -
boards/arm/imxrt/imxrt1060-evk/kernel/Makefile | 16 +-
boards/arm/imxrt/imxrt1060-evk/scripts/Make.defs | 40 +-
boards/arm/imxrt/imxrt1060-evk/src/Makefile | 3 +-
boards/arm/imxrt/imxrt1060-evk/src/imxrt_appinit.c | 2 +-
boards/arm/imxrt/imxrt1060-evk/src/imxrt_boot.c | 2 +-
boards/arm/imxrt/imxrt1060-evk/src/imxrt_buttons.c | 2 +-
.../arm/imxrt/imxrt1060-evk/src/imxrt_mmcsd_spi.c | 2 +-
boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c | 2 +-
boards/arm/kinetis/drivers/Kconfig | 4 -
boards/arm/kinetis/freedom-k28f/scripts/Make.defs | 36 +-
boards/arm/kinetis/freedom-k28f/src/.gitignore | 2 -
boards/arm/kinetis/freedom-k28f/src/Makefile | 3 +-
boards/arm/kinetis/freedom-k28f/src/k28_appinit.c | 2 +-
boards/arm/kinetis/freedom-k28f/src/k28_i2c.c | 2 +-
boards/arm/kinetis/freedom-k28f/src/k28_pwm.c | 2 +-
boards/arm/kinetis/freedom-k28f/src/k28_spi.c | 2 +-
boards/arm/kinetis/freedom-k28f/src/k28_usbdev.c | 2 +-
boards/arm/kinetis/freedom-k64f/README.txt | 21 -
boards/arm/kinetis/freedom-k64f/scripts/Make.defs | 36 +-
boards/arm/kinetis/freedom-k64f/src/Makefile | 3 +-
boards/arm/kinetis/freedom-k64f/src/k64_appinit.c | 2 +-
boards/arm/kinetis/freedom-k64f/src/k64_boot.c | 2 +-
boards/arm/kinetis/freedom-k64f/src/k64_pwm.c | 2 +-
boards/arm/kinetis/freedom-k64f/src/k64_spi.c | 2 +-
boards/arm/kinetis/freedom-k64f/src/k64_usbdev.c | 2 +-
boards/arm/kinetis/freedom-k66f/README.txt | 24 -
boards/arm/kinetis/freedom-k66f/scripts/Make.defs | 36 +-
boards/arm/kinetis/freedom-k66f/src/Makefile | 3 +-
boards/arm/kinetis/freedom-k66f/src/k66_appinit.c | 2 +-
boards/arm/kinetis/freedom-k66f/src/k66_boot.c | 2 +-
boards/arm/kinetis/freedom-k66f/src/k66_pwm.c | 2 +-
boards/arm/kinetis/freedom-k66f/src/k66_spi.c | 2 +-
boards/arm/kinetis/freedom-k66f/src/k66_usbdev.c | 2 +-
boards/arm/kinetis/kwikstik-k40/scripts/Make.defs | 36 +-
boards/arm/kinetis/kwikstik-k40/src/.gitignore | 2 -
boards/arm/kinetis/kwikstik-k40/src/Makefile | 3 +-
boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c | 2 +-
boards/arm/kinetis/kwikstik-k40/src/k40_boot.c | 2 +-
boards/arm/kinetis/kwikstik-k40/src/k40_lcd.c | 2 +-
boards/arm/kinetis/kwikstik-k40/src/k40_spi.c | 2 +-
boards/arm/kinetis/kwikstik-k40/src/k40_usbdev.c | 2 +-
boards/arm/kinetis/teensy-3.x/README.txt | 4 +-
boards/arm/kinetis/teensy-3.x/scripts/Make.defs | 36 +-
boards/arm/kinetis/teensy-3.x/src/.gitignore | 2 -
boards/arm/kinetis/teensy-3.x/src/Makefile | 3 +-
boards/arm/kinetis/teensy-3.x/src/k20_appinit.c | 2 +-
boards/arm/kinetis/teensy-3.x/src/k20_boot.c | 2 +-
boards/arm/kinetis/teensy-3.x/src/k20_i2c.c | 2 +-
boards/arm/kinetis/teensy-3.x/src/k20_pwm.c | 2 +-
boards/arm/kinetis/teensy-3.x/src/k20_spi.c | 2 +-
boards/arm/kinetis/teensy-3.x/src/k20_usbdev.c | 2 +-
boards/arm/kinetis/twr-k60n512/scripts/Make.defs | 36 +-
boards/arm/kinetis/twr-k60n512/src/.gitignore | 2 -
boards/arm/kinetis/twr-k60n512/src/Makefile | 3 +-
boards/arm/kinetis/twr-k60n512/src/k60_appinit.c | 2 +-
boards/arm/kinetis/twr-k60n512/src/k60_boot.c | 2 +-
boards/arm/kinetis/twr-k60n512/src/k60_spi.c | 2 +-
boards/arm/kinetis/twr-k60n512/src/k60_usbdev.c | 2 +-
boards/arm/kinetis/twr-k64f120m/scripts/Make.defs | 36 +-
boards/arm/kinetis/twr-k64f120m/src/Makefile | 3 +-
boards/arm/kinetis/twr-k64f120m/src/k64_appinit.c | 2 +-
boards/arm/kinetis/twr-k64f120m/src/k64_boot.c | 2 +-
boards/arm/kl/drivers/Kconfig | 4 -
boards/arm/kl/freedom-kl25z/README.txt | 4 +-
boards/arm/kl/freedom-kl25z/configs/nsh/defconfig | 2 +-
boards/arm/kl/freedom-kl25z/scripts/Make.defs | 48 +-
boards/arm/kl/freedom-kl25z/src/.gitignore | 2 -
boards/arm/kl/freedom-kl25z/src/Makefile | 3 +-
boards/arm/kl/freedom-kl25z/src/kl_appinit.c | 2 +-
.../arm/kl/freedom-kl25z/src/kl_boardinitialize.c | 2 +-
boards/arm/kl/freedom-kl25z/src/kl_pwm.c | 2 +-
boards/arm/kl/freedom-kl25z/src/kl_tsi.c | 2 +-
boards/arm/kl/freedom-kl26z/README.txt | 4 +-
boards/arm/kl/freedom-kl26z/configs/nsh/defconfig | 2 +-
boards/arm/kl/freedom-kl26z/scripts/Make.defs | 48 +-
boards/arm/kl/freedom-kl26z/src/.gitignore | 2 -
boards/arm/kl/freedom-kl26z/src/Makefile | 3 +-
boards/arm/kl/freedom-kl26z/src/kl_appinit.c | 2 +-
.../arm/kl/freedom-kl26z/src/kl_boardinitialize.c | 2 +-
boards/arm/kl/freedom-kl26z/src/kl_pwm.c | 2 +-
boards/arm/kl/freedom-kl26z/src/kl_tsi.c | 2 +-
boards/arm/kl/teensy-lc/configs/nsh/defconfig | 2 +-
boards/arm/kl/teensy-lc/scripts/Make.defs | 48 +-
boards/arm/kl/teensy-lc/src/.gitignore | 2 -
boards/arm/kl/teensy-lc/src/Makefile | 3 +-
boards/arm/kl/teensy-lc/src/kl_appinit.c | 2 +-
boards/arm/kl/teensy-lc/src/kl_boardinitialize.c | 2 +-
boards/arm/kl/teensy-lc/src/kl_pwm.c | 2 +-
boards/arm/lc823450/drivers/Kconfig | 4 -
.../arm/lc823450/lc823450-xgevk/kernel/.gitignore | 1 -
boards/arm/lc823450/lc823450-xgevk/kernel/Makefile | 16 +-
.../arm/lc823450/lc823450-xgevk/scripts/Make.defs | 44 +-
boards/arm/lc823450/lc823450-xgevk/src/Makefile | 3 +-
.../arm/lc823450/lc823450-xgevk/src/lc823450_adc.c | 2 +-
.../lc823450/lc823450-xgevk/src/lc823450_appinit.c | 2 +-
.../lc823450-xgevk/src/lc823450_autoleds.c | 4 +-
.../arm/lc823450/lc823450-xgevk/src/lc823450_bt.c | 4 +-
.../arm/lc823450/lc823450-xgevk/src/lc823450_mux.c | 4 +-
.../lc823450/lc823450-xgevk/src/lc823450_netinit.c | 4 +-
.../lc823450/lc823450-xgevk/src/lc823450_st7565.c | 2 +-
.../lc823450/lc823450-xgevk/src/lc823450_wm8776.c | 2 +-
boards/arm/lpc17xx_40xx/drivers/Kconfig | 4 -
boards/arm/lpc17xx_40xx/lincoln60/README.txt | 6 +-
.../lincoln60/configs/netnsh/defconfig | 1 -
.../lpc17xx_40xx/lincoln60/configs/nsh/defconfig | 1 -
.../lincoln60/configs/thttpd-binfs/defconfig | 1 -
.../arm/lpc17xx_40xx/lincoln60/scripts/Make.defs | 36 +-
boards/arm/lpc17xx_40xx/lincoln60/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/lincoln60/src/Makefile | 3 +-
.../lpc17xx_40xx/lincoln60/src/lpc17_40_appinit.c | 2 +-
.../arm/lpc17xx_40xx/lincoln60/src/lpc17_40_boot.c | 4 +-
.../arm/lpc17xx_40xx/lincoln60/src/lpc17_40_leds.c | 4 +-
.../lpc4088-devkit/configs/knsh/Make.defs | 40 +-
.../lpc17xx_40xx/lpc4088-devkit/kernel/.gitignore | 1 -
.../lpc17xx_40xx/lpc4088-devkit/kernel/Makefile | 16 +-
.../lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs | 36 +-
.../arm/lpc17xx_40xx/lpc4088-devkit/src/.gitignore | 2 -
.../arm/lpc17xx_40xx/lpc4088-devkit/src/Makefile | 3 +-
.../lpc4088-devkit/src/lpc17_40_appinit.c | 2 +-
.../lpc4088-devkit/src/lpc17_40_autoleds.c | 4 +-
.../lpc4088-devkit/src/lpc17_40_boardinitialize.c | 4 +-
.../lpc4088-devkit/src/lpc17_40_nandinitialize.c | 4 +-
.../lpc4088-devkit/src/lpc17_40_norinitialize.c | 4 +-
.../lpc4088-devkit/src/lpc17_40_sdraminitialize.c | 4 +-
.../lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_ssp.c | 2 +-
.../lpc4088-devkit/src/lpc17_40_userleds.c | 4 +-
.../lpc4088-quickstart/configs/knsh/Make.defs | 40 +-
.../lpc4088-quickstart/kernel/.gitignore | 1 -
.../lpc4088-quickstart/kernel/Makefile | 16 +-
.../lpc4088-quickstart/scripts/Make.defs | 36 +-
.../lpc17xx_40xx/lpc4088-quickstart/src/.gitignore | 2 -
.../lpc17xx_40xx/lpc4088-quickstart/src/Makefile | 3 +-
.../lpc4088-quickstart/src/lpc17_40_appinit.c | 2 +-
.../lpc4088-quickstart/src/lpc17_40_autoleds.c | 4 +-
.../src/lpc17_40_boardinitialize.c | 4 +-
.../src/lpc17_40_nandinitialize.c | 4 +-
.../src/lpc17_40_sdraminitialize.c | 4 +-
.../lpc4088-quickstart/src/lpc17_40_ssp.c | 2 +-
.../lpc4088-quickstart/src/lpc17_40_userleds.c | 4 +-
.../arm/lpc17xx_40xx/lpcxpresso-lpc1768/README.txt | 4 +-
.../lpcxpresso-lpc1768/configs/dhcpd/defconfig | 2 -
.../lpcxpresso-lpc1768/configs/nsh/defconfig | 1 -
.../lpcxpresso-lpc1768/configs/nx/defconfig | 1 -
.../lpcxpresso-lpc1768/configs/thttpd/Make.defs | 40 +-
.../lpcxpresso-lpc1768/configs/thttpd/defconfig | 1 -
.../lpcxpresso-lpc1768/configs/usbmsc/defconfig | 1 -
.../lpcxpresso-lpc1768/scripts/Make.defs | 36 +-
.../lpc17xx_40xx/lpcxpresso-lpc1768/src/.gitignore | 2 -
.../lpc17xx_40xx/lpcxpresso-lpc1768/src/Makefile | 3 +-
.../lpcxpresso-lpc1768/src/lpc17_40_adc.c | 2 +-
.../lpcxpresso-lpc1768/src/lpc17_40_appinit.c | 2 +-
.../lpcxpresso-lpc1768/src/lpc17_40_boot.c | 4 +-
.../lpcxpresso-lpc1768/src/lpc17_40_dac.c | 4 +-
.../lpcxpresso-lpc1768/src/lpc17_40_leds.c | 4 +-
.../lpcxpresso-lpc1768/src/lpc17_40_pwm.c | 2 +-
.../lpcxpresso-lpc1768/src/lpc17_40_ssp.c | 2 +-
boards/arm/lpc17xx_40xx/lx_cpu/scripts/Make.defs | 44 +-
boards/arm/lpc17xx_40xx/lx_cpu/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/lx_cpu/src/Makefile | 3 +-
.../arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_appinit.c | 2 +-
.../lpc17xx_40xx/lx_cpu/src/lpc17_40_autoleds.c | 4 +-
.../lx_cpu/src/lpc17_40_boardinitialize.c | 4 +-
boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_can.c | 2 +-
.../lx_cpu/src/lpc17_40_fpgainitialize.c | 4 +-
.../lx_cpu/src/lpc17_40_sdraminitialize.c | 4 +-
boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_ssp.c | 2 +-
boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_ulan.c | 4 +-
.../lpc17xx_40xx/lx_cpu/src/lpc17_40_userleds.c | 4 +-
boards/arm/lpc17xx_40xx/mbed/scripts/Make.defs | 36 +-
boards/arm/lpc17xx_40xx/mbed/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/mbed/src/Makefile | 3 +-
boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_adc.c | 2 +-
.../arm/lpc17xx_40xx/mbed/src/lpc17_40_appinit.c | 2 +-
boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_boot.c | 4 +-
boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_dac.c | 4 +-
boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_leds.c | 4 +-
boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_pwm.c | 2 +-
boards/arm/lpc17xx_40xx/mcb1700/scripts/Make.defs | 36 +-
boards/arm/lpc17xx_40xx/mcb1700/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/mcb1700/src/Makefile | 3 +-
boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_adc.c | 2 +-
.../lpc17xx_40xx/mcb1700/src/lpc17_40_appinit.c | 2 +-
.../arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c | 4 +-
boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_dac.c | 4 +-
.../arm/lpc17xx_40xx/mcb1700/src/lpc17_40_leds.c | 4 +-
boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_pwm.c | 2 +-
.../arm/lpc17xx_40xx/olimex-lpc1766stk/README.txt | 8 +-
.../olimex-lpc1766stk/configs/hidmouse/defconfig | 1 -
.../configs/thttpd-binfs/Make.defs | 36 +-
.../configs/thttpd-binfs/defconfig | 1 -
.../configs/thttpd-nxflat/Make.defs | 36 +-
.../olimex-lpc1766stk/scripts/Make.defs | 36 +-
.../lpc17xx_40xx/olimex-lpc1766stk/src/.gitignore | 2 -
.../lpc17xx_40xx/olimex-lpc1766stk/src/Makefile | 3 +-
.../olimex-lpc1766stk/src/lpc17_40_appinit.c | 2 +-
.../olimex-lpc1766stk/src/lpc17_40_boot.c | 4 +-
.../olimex-lpc1766stk/src/lpc17_40_can.c | 2 +-
.../olimex-lpc1766stk/src/lpc17_40_leds.c | 4 +-
.../olimex-lpc1766stk/src/lpc17_40_ssp.c | 2 +-
.../lpc17xx_40xx/open1788/configs/knsh/Make.defs | 40 +-
.../open1788/configs/knxterm/Make.defs | 40 +-
boards/arm/lpc17xx_40xx/open1788/kernel/.gitignore | 1 -
boards/arm/lpc17xx_40xx/open1788/kernel/Makefile | 16 +-
boards/arm/lpc17xx_40xx/open1788/scripts/Make.defs | 36 +-
boards/arm/lpc17xx_40xx/open1788/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/open1788/src/Makefile | 3 +-
.../lpc17xx_40xx/open1788/src/lpc17_40_appinit.c | 2 +-
.../lpc17xx_40xx/open1788/src/lpc17_40_autoleds.c | 4 +-
.../open1788/src/lpc17_40_boardinitialize.c | 4 +-
.../open1788/src/lpc17_40_nandinitialize.c | 4 +-
.../open1788/src/lpc17_40_norinitialize.c | 4 +-
.../open1788/src/lpc17_40_sdraminitialize.c | 4 +-
.../arm/lpc17xx_40xx/open1788/src/lpc17_40_ssp.c | 2 +-
.../lpc17xx_40xx/open1788/src/lpc17_40_userleds.c | 4 +-
.../lpc17xx_40xx/pnev5180b/configs/knsh/Make.defs | 40 +-
.../arm/lpc17xx_40xx/pnev5180b/kernel/.gitignore | 1 -
boards/arm/lpc17xx_40xx/pnev5180b/kernel/Makefile | 16 +-
.../arm/lpc17xx_40xx/pnev5180b/scripts/Make.defs | 36 +-
boards/arm/lpc17xx_40xx/pnev5180b/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/pnev5180b/src/Makefile | 3 +-
.../lpc17xx_40xx/pnev5180b/src/lpc17_40_appinit.c | 2 +-
.../arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c | 4 +-
.../arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_leds.c | 4 +-
.../arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_spi.c | 2 +-
.../lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.c | 13 +-
.../arm/lpc17xx_40xx/u-blox-c027/scripts/Make.defs | 36 +-
boards/arm/lpc17xx_40xx/u-blox-c027/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/u-blox-c027/src/Makefile | 3 +-
.../lpc17xx_40xx/u-blox-c027/src/lpc17_40_adc.c | 2 +-
.../u-blox-c027/src/lpc17_40_appinit.c | 2 +-
.../lpc17xx_40xx/u-blox-c027/src/lpc17_40_boot.c | 4 +-
.../lpc17xx_40xx/u-blox-c027/src/lpc17_40_dac.c | 4 +-
.../lpc17xx_40xx/u-blox-c027/src/lpc17_40_leds.c | 4 +-
.../lpc17xx_40xx/u-blox-c027/src/lpc17_40_pwm.c | 2 +-
.../lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c | 2 +-
.../lpc17xx_40xx/zkit-arm-1769/scripts/Make.defs | 40 +-
.../arm/lpc17xx_40xx/zkit-arm-1769/src/.gitignore | 2 -
boards/arm/lpc17xx_40xx/zkit-arm-1769/src/Makefile | 3 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_adc.c | 2 +-
.../zkit-arm-1769/src/lpc17_40_appinit.c | 18 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_boot.c | 4 +-
.../zkit-arm-1769/src/lpc17_40_buttons.c | 4 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_can.c | 2 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_dac.c | 4 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c | 4 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_leds.c | 4 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c | 2 +-
.../lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c | 2 +-
boards/arm/lpc214x/drivers/Kconfig | 4 -
boards/arm/lpc214x/mcu123-lpc214x/README.txt | 36 +-
.../arm/lpc214x/mcu123-lpc214x/scripts/Make.defs | 38 +-
boards/arm/lpc214x/mcu123-lpc214x/src/.gitignore | 2 -
boards/arm/lpc214x/mcu123-lpc214x/src/Makefile | 3 +-
.../lpc214x/mcu123-lpc214x/src/lpc2148_appinit.c | 2 +-
.../arm/lpc214x/mcu123-lpc214x/src/lpc2148_leds.c | 4 +-
.../arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c | 4 +-
boards/arm/lpc214x/zp214xpa/scripts/Make.defs | 38 +-
boards/arm/lpc214x/zp214xpa/src/.gitignore | 2 -
boards/arm/lpc214x/zp214xpa/src/Makefile | 5 +-
boards/arm/lpc214x/zp214xpa/src/lpc2148_appinit.c | 2 +-
boards/arm/lpc214x/zp214xpa/src/lpc2148_spi1.c | 4 +-
.../lpc214x/zp214xpa/src/lpc2148_ug2864ambag01.c | 2 +-
boards/arm/lpc2378/drivers/Kconfig | 4 -
.../lpc2378/olimex-lpc2378/configs/nsh/defconfig | 1 -
.../arm/lpc2378/olimex-lpc2378/scripts/Make.defs | 38 +-
boards/arm/lpc2378/olimex-lpc2378/src/.gitignore | 2 -
boards/arm/lpc2378/olimex-lpc2378/src/Makefile | 3 +-
.../lpc2378/olimex-lpc2378/src/lpc2378_appinit.c | 2 +-
.../arm/lpc2378/olimex-lpc2378/src/lpc2378_leds.c | 4 +-
boards/arm/lpc31xx/drivers/Kconfig | 4 -
boards/arm/lpc31xx/ea3131/README.txt | 69 +-
boards/arm/lpc31xx/ea3131/configs/nsh/defconfig | 1 -
boards/arm/lpc31xx/ea3131/configs/pgnsh/Make.defs | 38 +-
boards/arm/lpc31xx/ea3131/configs/pgnsh/defconfig | 1 -
.../arm/lpc31xx/ea3131/configs/usbserial/defconfig | 1 -
boards/arm/lpc31xx/ea3131/locked/.gitignore | 1 -
boards/arm/lpc31xx/ea3131/locked/Makefile | 13 +-
boards/arm/lpc31xx/ea3131/locked/mklocked.sh | 18 +-
boards/arm/lpc31xx/ea3131/scripts/Make.defs | 36 +-
boards/arm/lpc31xx/ea3131/scripts/pg-ld.script | 20 +-
boards/arm/lpc31xx/ea3131/src/.gitignore | 2 -
boards/arm/lpc31xx/ea3131/src/Makefile | 3 +-
boards/arm/lpc31xx/ea3131/src/lpc31_appinit.c | 2 +-
boards/arm/lpc31xx/ea3131/src/lpc31_boot.c | 4 +-
boards/arm/lpc31xx/ea3131/src/lpc31_leds.c | 4 +-
boards/arm/lpc31xx/ea3131/src/lpc31_mem.c | 2 +-
boards/arm/lpc31xx/ea3131/src/lpc31_spi.c | 2 +-
boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c | 2 +-
boards/arm/lpc31xx/ea3131/tools/.gitignore | 1 -
boards/arm/lpc31xx/ea3152/README.txt | 65 +-
boards/arm/lpc31xx/ea3152/scripts/Make.defs | 38 +-
boards/arm/lpc31xx/ea3152/src/.gitignore | 2 -
boards/arm/lpc31xx/ea3152/src/Makefile | 3 +-
boards/arm/lpc31xx/ea3152/src/lpc31_appinit.c | 2 +-
boards/arm/lpc31xx/ea3152/src/lpc31_boot.c | 4 +-
boards/arm/lpc31xx/ea3152/src/lpc31_leds.c | 4 +-
boards/arm/lpc31xx/ea3152/src/lpc31_mem.c | 2 +-
boards/arm/lpc31xx/ea3152/src/lpc31_spi.c | 2 +-
boards/arm/lpc31xx/ea3152/tools/.gitignore | 1 -
boards/arm/lpc31xx/olimex-lpc-h3131/README.txt | 71 +-
.../lpc31xx/olimex-lpc-h3131/configs/nsh/defconfig | 1 -
.../arm/lpc31xx/olimex-lpc-h3131/scripts/Make.defs | 36 +-
boards/arm/lpc31xx/olimex-lpc-h3131/src/.gitignore | 2 -
boards/arm/lpc31xx/olimex-lpc-h3131/src/Makefile | 3 +-
.../lpc31xx/olimex-lpc-h3131/src/lpc31_appinit.c | 2 +-
.../arm/lpc31xx/olimex-lpc-h3131/src/lpc31_boot.c | 4 +-
.../arm/lpc31xx/olimex-lpc-h3131/src/lpc31_leds.c | 4 +-
.../arm/lpc31xx/olimex-lpc-h3131/src/lpc31_mem.c | 2 +-
.../arm/lpc31xx/olimex-lpc-h3131/src/lpc31_spi.c | 2 +-
.../lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c | 2 +-
.../arm/lpc31xx/olimex-lpc-h3131/tools/.gitignore | 1 -
boards/arm/lpc43xx/bambino-200e/README.txt | 30 +-
.../lpc43xx/bambino-200e/configs/netnsh/Make.defs | 38 +-
boards/arm/lpc43xx/bambino-200e/kernel/.gitignore | 1 -
boards/arm/lpc43xx/bambino-200e/kernel/Makefile | 16 +-
boards/arm/lpc43xx/bambino-200e/scripts/Make.defs | 35 +-
boards/arm/lpc43xx/bambino-200e/src/.gitignore | 2 -
boards/arm/lpc43xx/bambino-200e/src/Makefile | 3 +-
.../arm/lpc43xx/bambino-200e/src/lpc43_appinit.c | 2 +-
.../arm/lpc43xx/bambino-200e/src/lpc43_autoleds.c | 4 +-
boards/arm/lpc43xx/bambino-200e/src/lpc43_boot.c | 4 +-
boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c | 8 +-
.../arm/lpc43xx/bambino-200e/src/lpc43_userleds.c | 4 +-
boards/arm/lpc43xx/drivers/Kconfig | 4 -
boards/arm/lpc43xx/lpc4330-xplorer/README.txt | 41 +-
.../lpc43xx/lpc4330-xplorer/configs/nsh/defconfig | 1 -
.../arm/lpc43xx/lpc4330-xplorer/scripts/Make.defs | 36 +-
boards/arm/lpc43xx/lpc4330-xplorer/src/.gitignore | 2 -
boards/arm/lpc43xx/lpc4330-xplorer/src/Makefile | 3 +-
.../lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c | 2 +-
.../lpc43xx/lpc4330-xplorer/src/lpc43_autoleds.c | 4 +-
.../arm/lpc43xx/lpc4330-xplorer/src/lpc43_boot.c | 4 +-
.../arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c | 6 +-
.../lpc43xx/lpc4330-xplorer/src/lpc43_userleds.c | 4 +-
boards/arm/lpc43xx/lpc4337-ws/README.txt | 33 +-
boards/arm/lpc43xx/lpc4337-ws/scripts/Make.defs | 36 +-
boards/arm/lpc43xx/lpc4337-ws/src/.gitignore | 2 -
boards/arm/lpc43xx/lpc4337-ws/src/Makefile | 3 +-
boards/arm/lpc43xx/lpc4337-ws/src/lpc43_adc.c | 2 +-
boards/arm/lpc43xx/lpc4337-ws/src/lpc43_appinit.c | 2 +-
boards/arm/lpc43xx/lpc4337-ws/src/lpc43_boot.c | 4 +-
boards/arm/lpc43xx/lpc4357-evb/README.txt | 33 +-
boards/arm/lpc43xx/lpc4357-evb/scripts/Make.defs | 36 +-
boards/arm/lpc43xx/lpc4357-evb/src/.gitignore | 2 -
boards/arm/lpc43xx/lpc4357-evb/src/Makefile | 3 +-
boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c | 2 +-
.../arm/lpc43xx/lpc4357-evb/src/lpc43_autoleds.c | 4 +-
boards/arm/lpc43xx/lpc4357-evb/src/lpc43_boot.c | 4 +-
boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c | 6 +-
.../arm/lpc43xx/lpc4357-evb/src/lpc43_userleds.c | 4 +-
boards/arm/lpc43xx/lpc4370-link2/README.txt | 33 +-
boards/arm/lpc43xx/lpc4370-link2/scripts/Make.defs | 36 +-
boards/arm/lpc43xx/lpc4370-link2/src/.gitignore | 2 -
boards/arm/lpc43xx/lpc4370-link2/src/Makefile | 3 +-
boards/arm/lpc43xx/lpc4370-link2/src/lpc43_adc.c | 2 +-
.../arm/lpc43xx/lpc4370-link2/src/lpc43_appinit.c | 2 +-
.../arm/lpc43xx/lpc4370-link2/src/lpc43_autoleds.c | 4 +-
boards/arm/lpc43xx/lpc4370-link2/src/lpc43_boot.c | 4 +-
.../arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c | 6 +-
.../lpc4370-link2/src/lpc43_spifilib_init.c | 4 +-
.../arm/lpc43xx/lpc4370-link2/src/lpc43_userleds.c | 4 +-
boards/arm/lpc54xx/drivers/Kconfig | 4 -
.../lpc54xx/lpcxpresso-lpc54628/scripts/Make.defs | 36 +-
.../arm/lpc54xx/lpcxpresso-lpc54628/src/Makefile | 3 +-
.../lpcxpresso-lpc54628/src/lpc54_appinit.c | 2 +-
boards/arm/max326xx/drivers/Kconfig | 4 -
.../arm/max326xx/max32660-evsys/scripts/Make.defs | 38 +-
boards/arm/max326xx/max32660-evsys/src/Makefile | 3 +-
.../max326xx/max32660-evsys/src/max326_appinit.c | 2 +-
.../arm/max326xx/max32660-evsys/src/max326_boot.c | 2 +-
.../arm/max326xx/max32660-evsys/src/max326_spi.c | 2 +-
boards/arm/moxart/drivers/Kconfig | 4 -
boards/arm/moxart/moxa/scripts/Make.defs | 36 +-
boards/arm/moxart/moxa/src/Makefile | 3 +-
boards/arm/moxart/moxa/src/moxart_appinit.c | 2 +-
boards/arm/nrf52/drivers/Kconfig | 4 -
boards/arm/nrf52/nrf52-feather/scripts/Make.defs | 36 +-
boards/arm/nrf52/nrf52-feather/src/.gitignore | 2 -
boards/arm/nrf52/nrf52-feather/src/Makefile | 3 +-
boards/arm/nrf52/nrf52-feather/src/nrf52_appinit.c | 2 +-
.../arm/nrf52/nrf52-feather/src/nrf52_autoleds.c | 4 +-
boards/arm/nrf52/nrf52-feather/src/nrf52_boot.c | 4 +-
.../arm/nrf52/nrf52-feather/src/nrf52_userleds.c | 4 +-
boards/arm/nrf52/nrf52832-dk/scripts/Make.defs | 36 +-
boards/arm/nrf52/nrf52832-dk/src/.gitignore | 2 -
boards/arm/nrf52/nrf52832-dk/src/Makefile | 3 +-
boards/arm/nrf52/nrf52832-dk/src/nrf52_appinit.c | 2 +-
boards/arm/nrf52/nrf52832-dk/src/nrf52_autoleds.c | 4 +-
boards/arm/nrf52/nrf52832-dk/src/nrf52_boot.c | 4 +-
boards/arm/nrf52/nrf52832-dk/src/nrf52_userleds.c | 4 +-
boards/arm/nrf52/nrf52840-dk/scripts/Make.defs | 36 +-
boards/arm/nrf52/nrf52840-dk/src/.gitignore | 2 -
boards/arm/nrf52/nrf52840-dk/src/Makefile | 3 +-
boards/arm/nrf52/nrf52840-dk/src/nrf52_appinit.c | 2 +-
boards/arm/nrf52/nrf52840-dk/src/nrf52_autoleds.c | 4 +-
boards/arm/nrf52/nrf52840-dk/src/nrf52_boot.c | 4 +-
boards/arm/nrf52/nrf52840-dk/src/nrf52_spi.c | 2 +-
boards/arm/nrf52/nrf52840-dk/src/nrf52_userleds.c | 4 +-
boards/arm/nrf52/nrf52840-dongle/scripts/Make.defs | 36 +-
boards/arm/nrf52/nrf52840-dongle/src/.gitignore | 2 -
boards/arm/nrf52/nrf52840-dongle/src/Makefile | 3 +-
.../arm/nrf52/nrf52840-dongle/src/nrf52_appinit.c | 2 +-
.../arm/nrf52/nrf52840-dongle/src/nrf52_autoleds.c | 4 +-
boards/arm/nrf52/nrf52840-dongle/src/nrf52_boot.c | 4 +-
.../arm/nrf52/nrf52840-dongle/src/nrf52_userleds.c | 4 +-
boards/arm/nuc1xx/drivers/Kconfig | 4 -
boards/arm/nuc1xx/nutiny-nuc120/README.txt | 4 +-
.../arm/nuc1xx/nutiny-nuc120/configs/nsh/defconfig | 2 +-
boards/arm/nuc1xx/nutiny-nuc120/scripts/Make.defs | 47 +-
boards/arm/nuc1xx/nutiny-nuc120/src/.gitignore | 2 -
boards/arm/nuc1xx/nutiny-nuc120/src/Makefile | 3 +-
.../nuc1xx/nutiny-nuc120/src/nuc_boardinitialize.c | 2 +-
boards/arm/s32k1xx/drivers/Kconfig | 4 -
.../s32k1xx/rddrone-uavcan144/scripts/Make.defs | 47 +-
.../arm/s32k1xx/rddrone-uavcan144/src/.gitignore | 2 -
boards/arm/s32k1xx/rddrone-uavcan144/src/Makefile | 3 +-
.../rddrone-uavcan144/src/s32k1xx_appinit.c | 2 +-
.../rddrone-uavcan144/src/s32k1xx_autoleds.c | 4 +-
.../s32k1xx/rddrone-uavcan144/src/s32k1xx_spi.c | 2 +-
.../rddrone-uavcan144/src/s32k1xx_userleds.c | 4 +-
.../s32k1xx/rddrone-uavcan146/scripts/Make.defs | 47 +-
.../arm/s32k1xx/rddrone-uavcan146/src/.gitignore | 2 -
boards/arm/s32k1xx/rddrone-uavcan146/src/Makefile | 3 +-
.../rddrone-uavcan146/src/s32k1xx_appinit.c | 2 +-
.../rddrone-uavcan146/src/s32k1xx_autoleds.c | 4 +-
.../s32k1xx/rddrone-uavcan146/src/s32k1xx_spi.c | 2 +-
.../rddrone-uavcan146/src/s32k1xx_userleds.c | 4 +-
.../arm/s32k1xx/s32k118evb/configs/nsh/defconfig | 2 +-
boards/arm/s32k1xx/s32k118evb/scripts/Make.defs | 47 +-
boards/arm/s32k1xx/s32k118evb/src/.gitignore | 2 -
boards/arm/s32k1xx/s32k118evb/src/Makefile | 3 +-
.../arm/s32k1xx/s32k118evb/src/s32k1xx_appinit.c | 2 +-
.../arm/s32k1xx/s32k118evb/src/s32k1xx_autoleds.c | 4 +-
.../arm/s32k1xx/s32k118evb/src/s32k1xx_userleds.c | 4 +-
boards/arm/s32k1xx/s32k144evb/scripts/Make.defs | 47 +-
boards/arm/s32k1xx/s32k144evb/src/.gitignore | 2 -
boards/arm/s32k1xx/s32k144evb/src/Makefile | 3 +-
.../arm/s32k1xx/s32k144evb/src/s32k1xx_appinit.c | 2 +-
.../arm/s32k1xx/s32k144evb/src/s32k1xx_autoleds.c | 4 +-
boards/arm/s32k1xx/s32k144evb/src/s32k1xx_spi.c | 2 +-
.../arm/s32k1xx/s32k144evb/src/s32k1xx_userleds.c | 4 +-
boards/arm/s32k1xx/s32k146evb/scripts/Make.defs | 47 +-
boards/arm/s32k1xx/s32k146evb/src/.gitignore | 2 -
boards/arm/s32k1xx/s32k146evb/src/Makefile | 3 +-
.../arm/s32k1xx/s32k146evb/src/s32k1xx_appinit.c | 2 +-
.../arm/s32k1xx/s32k146evb/src/s32k1xx_autoleds.c | 4 +-
boards/arm/s32k1xx/s32k146evb/src/s32k1xx_spi.c | 2 +-
.../arm/s32k1xx/s32k146evb/src/s32k1xx_userleds.c | 4 +-
boards/arm/s32k1xx/s32k148evb/scripts/Make.defs | 47 +-
boards/arm/s32k1xx/s32k148evb/src/.gitignore | 2 -
boards/arm/s32k1xx/s32k148evb/src/Makefile | 3 +-
.../arm/s32k1xx/s32k148evb/src/s32k1xx_appinit.c | 2 +-
.../arm/s32k1xx/s32k148evb/src/s32k1xx_autoleds.c | 4 +-
.../arm/s32k1xx/s32k148evb/src/s32k1xx_userleds.c | 4 +-
boards/arm/sam34/arduino-due/scripts/Make.defs | 76 +-
boards/arm/sam34/arduino-due/src/.gitignore | 2 -
boards/arm/sam34/arduino-due/src/Makefile | 3 +-
boards/arm/sam34/arduino-due/src/sam_appinit.c | 2 +-
boards/arm/sam34/arduino-due/src/sam_mmcsd.c | 2 +-
boards/arm/sam34/arduino-due/src/sam_touchscreen.c | 2 +-
boards/arm/sam34/drivers/Kconfig | 4 -
.../arm/sam34/flipnclick-sam3x/scripts/Make.defs | 36 +-
boards/arm/sam34/flipnclick-sam3x/src/.gitignore | 2 -
boards/arm/sam34/flipnclick-sam3x/src/Makefile | 3 +-
.../arm/sam34/flipnclick-sam3x/src/sam_appinit.c | 2 +-
boards/arm/sam34/flipnclick-sam3x/src/sam_spi0.c | 2 +-
boards/arm/sam34/sam3u-ek/configs/knsh/Make.defs | 40 +-
boards/arm/sam34/sam3u-ek/kernel/.gitignore | 1 -
boards/arm/sam34/sam3u-ek/kernel/Makefile | 16 +-
boards/arm/sam34/sam3u-ek/scripts/Make.defs | 76 +-
boards/arm/sam34/sam3u-ek/src/.gitignore | 2 -
boards/arm/sam34/sam3u-ek/src/Makefile | 3 +-
boards/arm/sam34/sam3u-ek/src/sam_appinit.c | 2 +-
boards/arm/sam34/sam3u-ek/src/sam_boot.c | 2 +-
boards/arm/sam34/sam3u-ek/src/sam_lcd.c | 2 +-
boards/arm/sam34/sam3u-ek/src/sam_leds.c | 4 +-
boards/arm/sam34/sam3u-ek/src/sam_spi.c | 2 +-
boards/arm/sam34/sam3u-ek/src/sam_usbdev.c | 2 +-
boards/arm/sam34/sam4cmp-db/scripts/Make.defs | 36 +-
boards/arm/sam34/sam4cmp-db/src/Makefile | 3 +-
boards/arm/sam34/sam4cmp-db/src/sam_appinit.c | 2 +-
boards/arm/sam34/sam4e-ek/configs/nsh/defconfig | 1 -
boards/arm/sam34/sam4e-ek/configs/nxwm/defconfig | 1 -
boards/arm/sam34/sam4e-ek/scripts/Make.defs | 36 +-
boards/arm/sam34/sam4e-ek/src/.gitignore | 2 -
boards/arm/sam34/sam4e-ek/src/Makefile | 3 +-
boards/arm/sam34/sam4e-ek/src/sam_appinit.c | 2 +-
boards/arm/sam34/sam4e-ek/src/sam_boot.c | 2 +-
boards/arm/sam34/sam4e-ek/src/sam_ili9325.c | 2 +-
boards/arm/sam34/sam4e-ek/src/sam_ili9341.c | 2 +-
boards/arm/sam34/sam4e-ek/src/sam_leds.c | 4 +-
boards/arm/sam34/sam4e-ek/src/sam_spi.c | 2 +-
boards/arm/sam34/sam4e-ek/src/sam_udp.c | 2 +-
boards/arm/sam34/sam4l-xplained/scripts/Make.defs | 36 +-
boards/arm/sam34/sam4l-xplained/src/.gitignore | 2 -
boards/arm/sam34/sam4l-xplained/src/Makefile | 3 +-
boards/arm/sam34/sam4l-xplained/src/sam_appinit.c | 2 +-
boards/arm/sam34/sam4l-xplained/src/sam_slcd.c | 2 +-
.../arm/sam34/sam4s-xplained-pro/scripts/Make.defs | 36 +-
boards/arm/sam34/sam4s-xplained-pro/src/Makefile | 3 +-
.../arm/sam34/sam4s-xplained-pro/src/sam_appinit.c | 2 +-
boards/arm/sam34/sam4s-xplained-pro/src/sam_udp.c | 2 +-
boards/arm/sam34/sam4s-xplained/scripts/Make.defs | 36 +-
boards/arm/sam34/sam4s-xplained/src/Makefile | 3 +-
boards/arm/sam34/sam4s-xplained/src/sam_sram.c | 2 +-
boards/arm/sama5/drivers/Kconfig | 4 -
boards/arm/sama5/sama5d2-xult/README.txt | 17 -
boards/arm/sama5/sama5d2-xult/scripts/Make.defs | 53 +-
boards/arm/sama5/sama5d2-xult/src/Makefile | 3 +-
boards/arm/sama5/sama5d2-xult/src/sam_appinit.c | 2 +-
boards/arm/sama5/sama5d2-xult/src/sam_can.c | 2 +-
boards/arm/sama5/sama5d2-xult/src/sam_nandflash.c | 2 +-
boards/arm/sama5/sama5d2-xult/src/sam_ostest.c | 6 +-
boards/arm/sama5/sama5d2-xult/src/sam_sdram.c | 2 +-
boards/arm/sama5/sama5d2-xult/src/sam_spi.c | 2 +-
boards/arm/sama5/sama5d2-xult/src/sam_usb.c | 2 +-
boards/arm/sama5/sama5d3-xplained/README.txt | 47 +-
boards/arm/sama5/sama5d3-xplained/boot/uImage | Bin 212281 -> 0 bytes
.../sama5d3-xplained/configs/bridge/defconfig | 1 -
.../ethernet-over-usb-2-high-speed/defconfig | 1 -
.../sama5/sama5d3-xplained/configs/nsh/defconfig | 1 -
.../arm/sama5/sama5d3-xplained/scripts/Make.defs | 53 +-
boards/arm/sama5/sama5d3-xplained/src/Makefile | 3 +-
.../arm/sama5/sama5d3-xplained/src/sam_appinit.c | 2 +-
.../arm/sama5/sama5d3-xplained/src/sam_bringup.c | 0
boards/arm/sama5/sama5d3-xplained/src/sam_can.c | 2 +-
.../arm/sama5/sama5d3-xplained/src/sam_nandflash.c | 2 +-
boards/arm/sama5/sama5d3-xplained/src/sam_ostest.c | 6 +-
boards/arm/sama5/sama5d3-xplained/src/sam_sdram.c | 2 +-
boards/arm/sama5/sama5d3-xplained/src/sam_spi.c | 2 +-
boards/arm/sama5/sama5d3-xplained/src/sam_usb.c | 2 +-
boards/arm/sama5/sama5d3x-ek/README.txt | 72 +-
.../arm/sama5/sama5d3x-ek/configs/demo/defconfig | 1 -
.../arm/sama5/sama5d3x-ek/configs/hello/defconfig | 1 -
.../sama5/sama5d3x-ek/configs/norboot/defconfig | 1 -
boards/arm/sama5/sama5d3x-ek/configs/nsh/defconfig | 1 -
boards/arm/sama5/sama5d3x-ek/configs/nx/defconfig | 1 -
.../sama5/sama5d3x-ek/configs/nxplayer/defconfig | 1 -
.../arm/sama5/sama5d3x-ek/configs/nxwm/defconfig | 1 -
.../arm/sama5/sama5d3x-ek/configs/ov2640/defconfig | 1 -
boards/arm/sama5/sama5d3x-ek/scripts/Make.defs | 53 +-
boards/arm/sama5/sama5d3x-ek/src/Makefile | 3 +-
boards/arm/sama5/sama5d3x-ek/src/nor_main.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_appinit.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_can.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_nandflash.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_norflash.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_ostest.c | 46 +-
boards/arm/sama5/sama5d3x-ek/src/sam_ov2640.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_sdram.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_spi.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_touchscreen.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_usb.c | 2 +-
boards/arm/sama5/sama5d3x-ek/src/sam_wm8904.c | 2 +-
boards/arm/sama5/sama5d4-ek/README.txt | 90 +-
.../sama5/sama5d4-ek/configs/at25boot/defconfig | 1 -
.../arm/sama5/sama5d4-ek/configs/bridge/defconfig | 1 -
.../sama5/sama5d4-ek/configs/dramboot/defconfig | 1 -
boards/arm/sama5/sama5d4-ek/configs/elf/defconfig | 1 -
boards/arm/sama5/sama5d4-ek/configs/ipv6/defconfig | 1 -
boards/arm/sama5/sama5d4-ek/configs/knsh/Make.defs | 59 +-
boards/arm/sama5/sama5d4-ek/configs/knsh/defconfig | 1 -
boards/arm/sama5/sama5d4-ek/configs/nsh/defconfig | 1 -
boards/arm/sama5/sama5d4-ek/configs/nxwm/defconfig | 1 -
.../arm/sama5/sama5d4-ek/configs/ramtest/defconfig | 3 +-
boards/arm/sama5/sama5d4-ek/scripts/Make.defs | 53 +-
boards/arm/sama5/sama5d4-ek/src/Makefile | 3 +-
boards/arm/sama5/sama5d4-ek/src/dram_main.c | 2 +-
boards/arm/sama5/sama5d4-ek/src/sam_appinit.c | 2 +-
boards/arm/sama5/sama5d4-ek/src/sam_maxtouch.c | 2 +-
boards/arm/sama5/sama5d4-ek/src/sam_nandflash.c | 2 +-
boards/arm/sama5/sama5d4-ek/src/sam_ostest.c | 6 +-
boards/arm/sama5/sama5d4-ek/src/sam_sdram.c | 2 +-
boards/arm/sama5/sama5d4-ek/src/sam_spi.c | 2 +-
boards/arm/sama5/sama5d4-ek/src/sam_usb.c | 2 +-
boards/arm/sama5/sama5d4-ek/src/sam_wm8904.c | 2 +-
boards/arm/samd2l2/arduino-m0/README.txt | 2 +-
boards/arm/samd2l2/arduino-m0/scripts/Make.defs | 47 +-
boards/arm/samd2l2/arduino-m0/src/.gitignore | 2 -
boards/arm/samd2l2/arduino-m0/src/Makefile | 3 +-
boards/arm/samd2l2/arduino-m0/src/sam_appinit.c | 2 +-
boards/arm/samd2l2/drivers/Kconfig | 4 -
boards/arm/samd2l2/samd20-xplained/README.txt | 16 +-
.../samd2l2/samd20-xplained/configs/nsh/defconfig | 1 -
.../arm/samd2l2/samd20-xplained/scripts/Make.defs | 47 +-
boards/arm/samd2l2/samd20-xplained/src/.gitignore | 2 -
boards/arm/samd2l2/samd20-xplained/src/Makefile | 3 +-
.../arm/samd2l2/samd20-xplained/src/sam_appinit.c | 2 +-
boards/arm/samd2l2/samd21-xplained/README.txt | 6 +-
.../samd2l2/samd21-xplained/configs/nsh/defconfig | 1 -
.../arm/samd2l2/samd21-xplained/scripts/Make.defs | 47 +-
boards/arm/samd2l2/samd21-xplained/src/.gitignore | 2 -
boards/arm/samd2l2/samd21-xplained/src/Makefile | 3 +-
.../arm/samd2l2/samd21-xplained/src/sam_appinit.c | 2 +-
boards/arm/samd2l2/saml21-xplained/README.txt | 16 +-
.../samd2l2/saml21-xplained/configs/nsh/defconfig | 1 -
.../arm/samd2l2/saml21-xplained/scripts/Make.defs | 47 +-
boards/arm/samd2l2/saml21-xplained/src/.gitignore | 2 -
boards/arm/samd2l2/saml21-xplained/src/Makefile | 3 +-
.../arm/samd2l2/saml21-xplained/src/sam_appinit.c | 2 +-
boards/arm/samd5e5/drivers/Kconfig | 4 -
boards/arm/samd5e5/metro-m4/scripts/Make.defs | 38 +-
boards/arm/samd5e5/metro-m4/src/Makefile | 3 +-
boards/arm/samd5e5/metro-m4/src/sam_appinit.c | 2 +-
boards/arm/samd5e5/metro-m4/src/sam_autoleds.c | 4 +-
boards/arm/samd5e5/metro-m4/src/sam_userleds.c | 2 +-
.../samd5e5/same54-xplained-pro/scripts/Make.defs | 38 +-
.../arm/samd5e5/same54-xplained-pro/src/Makefile | 3 +-
.../samd5e5/same54-xplained-pro/src/sam_appinit.c | 2 +-
.../samd5e5/same54-xplained-pro/src/sam_autoleds.c | 4 +-
.../samd5e5/same54-xplained-pro/src/sam_userleds.c | 2 +-
boards/arm/samv7/drivers/Kconfig | 4 -
boards/arm/samv7/same70-xplained/README.txt | 2 +-
boards/arm/samv7/same70-xplained/kernel/.gitignore | 1 -
boards/arm/samv7/same70-xplained/kernel/Makefile | 16 +-
boards/arm/samv7/same70-xplained/scripts/Make.defs | 38 +-
boards/arm/samv7/same70-xplained/src/Makefile | 3 +-
boards/arm/samv7/same70-xplained/src/sam_appinit.c | 2 +-
boards/arm/samv7/same70-xplained/src/sam_boot.c | 2 +-
boards/arm/samv7/same70-xplained/src/sam_buttons.c | 2 +-
boards/arm/samv7/same70-xplained/src/sam_dac.c | 2 +-
boards/arm/samv7/same70-xplained/src/sam_sdram.c | 2 +-
boards/arm/samv7/same70-xplained/src/sam_spi.c | 2 +-
boards/arm/samv7/same70-xplained/src/sam_usbdev.c | 2 +-
.../arm/samv7/samv71-xult/configs/knsh/Make.defs | 42 +-
boards/arm/samv7/samv71-xult/kernel/.gitignore | 1 -
boards/arm/samv7/samv71-xult/kernel/Makefile | 16 +-
boards/arm/samv7/samv71-xult/scripts/Make.defs | 38 +-
boards/arm/samv7/samv71-xult/src/Makefile | 3 +-
boards/arm/samv7/samv71-xult/src/sam_appinit.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_boot.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_buttons.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_ili9488.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_maxtouch.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_sdram.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_spi.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_usbdev.c | 2 +-
boards/arm/samv7/samv71-xult/src/sam_wm8904.c | 2 +-
boards/arm/stm32/axoloti/scripts/Make.defs | 44 +-
boards/arm/stm32/axoloti/src/.gitignore | 2 -
boards/arm/stm32/axoloti/src/Make.defs | 72 +
boards/arm/stm32/axoloti/src/Makefile | 71 -
boards/arm/stm32/axoloti/src/stm32_appinit.c | 2 +-
boards/arm/stm32/axoloti/src/stm32_boot.c | 2 +-
boards/arm/stm32/axoloti/src/stm32_extmem.c | 2 +-
boards/arm/stm32/axoloti/src/stm32_usbhost.c | 2 +-
boards/arm/stm32/axoloti/src/stm32_userleds.c | 4 +-
boards/arm/stm32/b-g474e-dpow1/Kconfig | 21 +
boards/arm/stm32/b-g474e-dpow1/README.txt | 122 +
.../arm/stm32/b-g474e-dpow1/configs/nsh/defconfig | 47 +
boards/arm/stm32/b-g474e-dpow1/include/board.h | 191 +
boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs | 95 +
boards/arm/stm32/b-g474e-dpow1/scripts/ld.script | 124 +
.../stm32/b-g474e-dpow1}/src/.gitignore | 0
boards/arm/stm32/b-g474e-dpow1/src/Make.defs | 38 +
boards/arm/stm32/b-g474e-dpow1/src/b-g474e-dpow1.h | 77 +
boards/arm/stm32/b-g474e-dpow1/src/stm32_appinit.c | 91 +
.../arm/stm32/b-g474e-dpow1/src/stm32_autoleds.c | 109 +
boards/arm/stm32/b-g474e-dpow1/src/stm32_boot.c | 70 +
.../arm/stm32/b-g474e-dpow1/src/stm32_userleds.c | 121 +
boards/arm/stm32/clicker2-stm32/kernel/.gitignore | 1 -
boards/arm/stm32/clicker2-stm32/kernel/Makefile | 16 +-
boards/arm/stm32/clicker2-stm32/scripts/Make.defs | 38 +-
boards/arm/stm32/clicker2-stm32/src/.gitignore | 2 -
boards/arm/stm32/clicker2-stm32/src/Make.defs | 84 +
boards/arm/stm32/clicker2-stm32/src/Makefile | 83 -
.../arm/stm32/clicker2-stm32/src/stm32_appinit.c | 2 +-
boards/arm/stm32/clicker2-stm32/src/stm32_spi.c | 2 +-
boards/arm/stm32/cloudctrl/README.txt | 2 +-
boards/arm/stm32/cloudctrl/configs/nsh/defconfig | 1 -
boards/arm/stm32/cloudctrl/scripts/Make.defs | 36 +-
boards/arm/stm32/cloudctrl/src/.gitignore | 2 -
boards/arm/stm32/cloudctrl/src/Make.defs | 81 +
boards/arm/stm32/cloudctrl/src/Makefile | 80 -
boards/arm/stm32/cloudctrl/src/stm32_adc.c | 2 +-
boards/arm/stm32/cloudctrl/src/stm32_appinit.c | 2 +-
boards/arm/stm32/cloudctrl/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/cloudctrl/src/stm32_boot.c | 2 +-
boards/arm/stm32/cloudctrl/src/stm32_chipid.c | 2 +-
boards/arm/stm32/cloudctrl/src/stm32_spi.c | 2 +-
boards/arm/stm32/cloudctrl/src/stm32_usb.c | 2 +-
boards/arm/stm32/cloudctrl/src/stm32_userleds.c | 4 +-
boards/arm/stm32/common/Makefile | 34 +
boards/arm/stm32/common/include/board_qencoder.h | 73 +
boards/arm/stm32/common/include/stm32_apa102.h | 84 +
boards/arm/stm32/common/include/stm32_apds9960.h | 80 +
boards/arm/stm32/common/include/stm32_bh1750.h | 80 +
boards/arm/stm32/common/include/stm32_bmp180.h | 84 +
boards/arm/stm32/common/include/stm32_dhtxx.h | 81 +
boards/arm/stm32/common/include/stm32_hcsr04.h | 81 +
boards/arm/stm32/common/include/stm32_ina219.h | 80 +
boards/arm/stm32/common/include/stm32_l3gd20.h | 80 +
boards/arm/stm32/common/include/stm32_lis3dsh.h | 80 +
boards/arm/stm32/common/include/stm32_lm75.h | 80 +
boards/arm/stm32/common/include/stm32_max31855.h | 80 +
boards/arm/stm32/common/include/stm32_max6675.h | 84 +
boards/arm/stm32/common/include/stm32_mlx90614.h | 80 +
boards/arm/stm32/common/include/stm32_mpl115a.h | 80 +
boards/arm/stm32/common/include/stm32_nrf24l01.h | 79 +
boards/arm/stm32/common/include/stm32_nunchuck.h | 85 +
boards/arm/stm32/common/include/stm32_ssd1306.h | 96 +
boards/arm/stm32/common/include/stm32_tone.h | 76 +
boards/arm/stm32/common/include/stm32_veml6070.h | 85 +
boards/arm/stm32/common/include/stm32_xen1210.h | 81 +
boards/arm/stm32/common/include/stm32_zerocross.h | 73 +
boards/arm/stm32/common/src/Make.defs | 111 +
boards/arm/stm32/common/src/stm32_apa102.c | 108 +
boards/arm/stm32/common/src/stm32_apds9960.c | 180 +
boards/arm/stm32/common/src/stm32_bh1750.c | 102 +
boards/arm/stm32/common/src/stm32_bmp180.c | 103 +
boards/arm/stm32/common/src/stm32_dhtxx.c | 169 +
boards/arm/stm32/common/src/stm32_hcsr04.c | 262 +
boards/arm/stm32/common/src/stm32_ina219.c | 104 +
boards/arm/stm32/common/src/stm32_l3gd20.c | 143 +
boards/arm/stm32/common/src/stm32_lis3dsh.c | 130 +
boards/arm/stm32/common/src/stm32_lm75.c | 103 +
boards/arm/stm32/common/src/stm32_max31855.c | 95 +
boards/arm/stm32/common/src/stm32_max6675.c | 102 +
boards/arm/stm32/common/src/stm32_mlx90614.c | 104 +
boards/arm/stm32/common/src/stm32_mpl115a.c | 98 +
boards/arm/stm32/common/src/stm32_nrf24l01.c | 155 +
boards/arm/stm32/common/src/stm32_nunchuck.c | 111 +
boards/arm/stm32/common/src/stm32_qencoder.c | 81 +
boards/arm/stm32/common/src/stm32_ssd1306.c | 127 +
boards/arm/stm32/common/src/stm32_tone.c | 132 +
boards/arm/stm32/common/src/stm32_veml6070.c | 112 +
boards/arm/stm32/common/src/stm32_xen1210.c | 325 +
boards/arm/stm32/common/src/stm32_zerocross.c | 189 +
boards/arm/stm32/drivers/Kconfig | 4 -
.../arm/stm32/fire-stm32v2/configs/nsh/defconfig | 1 -
boards/arm/stm32/fire-stm32v2/scripts/Make.defs | 36 +-
boards/arm/stm32/fire-stm32v2/src/.gitignore | 2 -
boards/arm/stm32/fire-stm32v2/src/Make.defs | 72 +
boards/arm/stm32/fire-stm32v2/src/Makefile | 71 -
boards/arm/stm32/fire-stm32v2/src/stm32_appinit.c | 2 +-
boards/arm/stm32/fire-stm32v2/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/fire-stm32v2/src/stm32_boot.c | 2 +-
boards/arm/stm32/fire-stm32v2/src/stm32_enc28j60.c | 8 +-
.../arm/stm32/fire-stm32v2/src/stm32_selectlcd.c | 2 +-
boards/arm/stm32/fire-stm32v2/src/stm32_spi.c | 2 +-
boards/arm/stm32/fire-stm32v2/src/stm32_usbdev.c | 2 +-
boards/arm/stm32/fire-stm32v2/src/stm32_userleds.c | 4 +-
boards/arm/stm32/hymini-stm32v/README.txt | 2 +-
.../stm32/hymini-stm32v/configs/usbmsc/defconfig | 1 -
.../hymini-stm32v/configs/usbserial/defconfig | 1 -
boards/arm/stm32/hymini-stm32v/scripts/Make.defs | 36 +-
boards/arm/stm32/hymini-stm32v/src/.gitignore | 2 -
boards/arm/stm32/hymini-stm32v/src/Make.defs | 63 +
boards/arm/stm32/hymini-stm32v/src/Makefile | 62 -
boards/arm/stm32/hymini-stm32v/src/stm32_appinit.c | 2 +-
boards/arm/stm32/hymini-stm32v/src/stm32_boot.c | 2 +-
boards/arm/stm32/hymini-stm32v/src/stm32_leds.c | 4 +-
boards/arm/stm32/hymini-stm32v/src/stm32_r61505u.c | 2 +-
boards/arm/stm32/hymini-stm32v/src/stm32_spi.c | 2 +-
boards/arm/stm32/hymini-stm32v/src/stm32_ssd1289.c | 2 +-
boards/arm/stm32/hymini-stm32v/src/stm32_usbdev.c | 2 +-
boards/arm/stm32/maple/README.txt | 8 +-
boards/arm/stm32/maple/scripts/Make.defs | 36 +-
boards/arm/stm32/maple/src/Make.defs | 60 +
boards/arm/stm32/maple/src/Makefile | 59 -
boards/arm/stm32/maple/src/stm32_appinit.c | 2 +-
boards/arm/stm32/maple/src/stm32_boot.c | 2 +-
boards/arm/stm32/maple/src/stm32_lcd.c | 4 +-
boards/arm/stm32/maple/src/stm32_leds.c | 4 +-
boards/arm/stm32/maple/src/stm32_spi.c | 2 +-
boards/arm/stm32/maple/src/stm32_usbdev.c | 2 +-
boards/arm/stm32/mikroe-stm32f4/README.txt | 31 +-
.../mikroe-stm32f4/configs/fulldemo/defconfig | 1 +
.../stm32/mikroe-stm32f4/include/nsh_romfsimg.h | 110 +
boards/arm/stm32/mikroe-stm32f4/kernel/.gitignore | 1 -
boards/arm/stm32/mikroe-stm32f4/kernel/Makefile | 16 +-
boards/arm/stm32/mikroe-stm32f4/scripts/Make.defs | 36 +-
boards/arm/stm32/mikroe-stm32f4/src/.gitignore | 2 -
boards/arm/stm32/mikroe-stm32f4/src/Make.defs | 90 +
boards/arm/stm32/mikroe-stm32f4/src/Makefile | 93 -
.../arm/stm32/mikroe-stm32f4/src/mikroe-stm32f4.h | 50 +-
.../arm/stm32/mikroe-stm32f4/src/stm32_appinit.c | 150 +-
boards/arm/stm32/mikroe-stm32f4/src/stm32_boot.c | 2 +-
.../stm32/mikroe-stm32f4/src/stm32_clockconfig.c | 2 +-
boards/arm/stm32/mikroe-stm32f4/src/stm32_extmem.c | 2 +-
boards/arm/stm32/mikroe-stm32f4/src/stm32_idle.c | 2 +-
.../arm/stm32/mikroe-stm32f4/src/stm32_mio283qt2.c | 2 +-
.../stm32/mikroe-stm32f4/src/stm32_mio283qt9a.c | 2 +-
boards/arm/stm32/mikroe-stm32f4/src/stm32_pm.c | 6 +-
boards/arm/stm32/mikroe-stm32f4/src/stm32_pwm.c | 2 +-
.../arm/stm32/mikroe-stm32f4/src/stm32_qencoder.c | 82 -
boards/arm/stm32/mikroe-stm32f4/src/stm32_spi.c | 2 +-
.../stm32/mikroe-stm32f4/src/stm32_touchscreen.c | 166 +-
boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c | 2 +-
boards/arm/stm32/mikroe-stm32f4/src/stm32_vs1053.c | 2 +-
boards/arm/stm32/nucleo-f103rb/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f103rb/src/Make.defs | 64 +
boards/arm/stm32/nucleo-f103rb/src/Makefile | 63 -
.../stm32/nucleo-f103rb/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32/nucleo-f103rb/src/stm32_pwm.c | 2 +-
boards/arm/stm32/nucleo-f207zg/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f207zg/src/Make.defs | 68 +
boards/arm/stm32/nucleo-f207zg/src/Makefile | 67 -
.../stm32/nucleo-f207zg/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32/nucleo-f207zg/src/stm32_boot.c | 2 +-
boards/arm/stm32/nucleo-f207zg/src/stm32_pwm.c | 2 +-
boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c | 2 +-
.../stm32/nucleo-f302r8/configs/highpri/defconfig | 1 +
.../arm/stm32/nucleo-f302r8/configs/nsh/defconfig | 2 +-
boards/arm/stm32/nucleo-f302r8/include/board.h | 23 +-
boards/arm/stm32/nucleo-f302r8/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f302r8/src/Make.defs | 64 +
boards/arm/stm32/nucleo-f302r8/src/Makefile | 63 -
.../stm32/nucleo-f302r8/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32/nucleo-f302r8/src/stm32_highpri.c | 43 +-
boards/arm/stm32/nucleo-f302r8/src/stm32_pwm.c | 2 +-
boards/arm/stm32/nucleo-f303re/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f303re/src/Make.defs | 90 +
boards/arm/stm32/nucleo-f303re/src/Makefile | 89 -
.../stm32/nucleo-f303re/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32/nucleo-f303re/src/stm32_spi.c | 2 +-
boards/arm/stm32/nucleo-f303ze/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f303ze/src/Make.defs | 64 +
boards/arm/stm32/nucleo-f303ze/src/Makefile | 63 -
.../stm32/nucleo-f303ze/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32/nucleo-f303ze/src/stm32_boot.c | 2 +-
boards/arm/stm32/nucleo-f303ze/src/stm32_lcd.c | 102 +
boards/arm/stm32/nucleo-f303ze/src/stm32_ssd1306.c | 124 -
.../arm/stm32/nucleo-f334r8/configs/adc/defconfig | 2 +-
.../stm32/nucleo-f334r8/configs/highpri/defconfig | 1 +
.../arm/stm32/nucleo-f334r8/configs/nsh/defconfig | 2 +-
boards/arm/stm32/nucleo-f334r8/include/board.h | 16 +-
boards/arm/stm32/nucleo-f334r8/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f334r8/src/Make.defs | 100 +
boards/arm/stm32/nucleo-f334r8/src/Makefile | 99 -
boards/arm/stm32/nucleo-f334r8/src/stm32_appinit.c | 2 +-
boards/arm/stm32/nucleo-f334r8/src/stm32_highpri.c | 45 +-
boards/arm/stm32/nucleo-f334r8/src/stm32_spwm.c | 28 +-
boards/arm/stm32/nucleo-f410rb/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f410rb/src/Make.defs | 60 +
boards/arm/stm32/nucleo-f410rb/src/Makefile | 59 -
boards/arm/stm32/nucleo-f410rb/src/stm32_adc.c | 2 +-
boards/arm/stm32/nucleo-f410rb/src/stm32_appinit.c | 2 +-
.../arm/stm32/nucleo-f410rb/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/nucleo-f410rb/src/stm32_boot.c | 2 +-
.../arm/stm32/nucleo-f410rb/src/stm32_userleds.c | 4 +-
boards/arm/stm32/nucleo-f429zi/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f429zi/src/Make.defs | 77 +
boards/arm/stm32/nucleo-f429zi/src/Makefile | 76 -
.../stm32/nucleo-f429zi/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32/nucleo-f429zi/src/stm32_bbsram.c | 6 +-
boards/arm/stm32/nucleo-f429zi/src/stm32_boot.c | 2 +-
boards/arm/stm32/nucleo-f429zi/src/stm32_pwm.c | 2 +-
boards/arm/stm32/nucleo-f429zi/src/stm32_spi.c | 2 +-
boards/arm/stm32/nucleo-f429zi/src/stm32_usb.c | 2 +-
boards/arm/stm32/nucleo-f446re/README.txt | 92 +-
.../arm/stm32/nucleo-f446re/configs/nsh/defconfig | 1 -
boards/arm/stm32/nucleo-f446re/scripts/Make.defs | 44 +-
boards/arm/stm32/nucleo-f446re/src/.gitignore | 2 -
boards/arm/stm32/nucleo-f446re/src/Make.defs | 63 +
boards/arm/stm32/nucleo-f446re/src/Makefile | 66 -
boards/arm/stm32/nucleo-f446re/src/nucleo-f446re.h | 22 +-
boards/arm/stm32/nucleo-f446re/src/stm32_adc.c | 2 +-
boards/arm/stm32/nucleo-f446re/src/stm32_appinit.c | 8 +-
.../arm/stm32/nucleo-f446re/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/nucleo-f446re/src/stm32_boot.c | 2 +-
.../arm/stm32/nucleo-f446re/src/stm32_qencoder.c | 82 -
boards/arm/stm32/nucleo-f446re/src/stm32_spi.c | 2 +-
.../arm/stm32/nucleo-f446re/src/stm32_userleds.c | 4 +-
boards/arm/stm32/nucleo-f4x1re/README.txt | 92 +-
.../stm32/nucleo-f4x1re/configs/f401-nsh/defconfig | 1 -
.../stm32/nucleo-f4x1re/configs/f411-nsh/defconfig | 1 -
boards/arm/stm32/nucleo-f4x1re/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-f4x1re/src/Make.defs | 67 +
boards/arm/stm32/nucleo-f4x1re/src/Makefile | 70 -
boards/arm/stm32/nucleo-f4x1re/src/nucleo-f4x1re.h | 23 +-
boards/arm/stm32/nucleo-f4x1re/src/stm32_adc.c | 2 +-
boards/arm/stm32/nucleo-f4x1re/src/stm32_appinit.c | 2 +-
.../arm/stm32/nucleo-f4x1re/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/nucleo-f4x1re/src/stm32_boot.c | 2 +-
boards/arm/stm32/nucleo-f4x1re/src/stm32_bringup.c | 6 +-
.../arm/stm32/nucleo-f4x1re/src/stm32_qencoder.c | 83 -
boards/arm/stm32/nucleo-f4x1re/src/stm32_spi.c | 2 +-
.../arm/stm32/nucleo-f4x1re/src/stm32_userleds.c | 4 +-
.../arm/stm32/nucleo-l152re/configs/nsh/defconfig | 2 +-
boards/arm/stm32/nucleo-l152re/scripts/Make.defs | 36 +-
boards/arm/stm32/nucleo-l152re/src/Make.defs | 56 +
boards/arm/stm32/nucleo-l152re/src/Makefile | 55 -
.../stm32/nucleo-l152re/src/stm32_appinitialize.c | 2 +-
.../arm/stm32/olimex-stm32-e407/scripts/Make.defs | 36 +-
boards/arm/stm32/olimex-stm32-e407/src/Make.defs | 96 +
boards/arm/stm32/olimex-stm32-e407/src/Makefile | 103 -
.../olimex-stm32-e407/src/olimex-stm32-e407.h | 41 +-
.../stm32/olimex-stm32-e407/src/stm32_appinit.c | 2 +-
.../stm32/olimex-stm32-e407/src/stm32_autoleds.c | 4 +-
.../arm/stm32/olimex-stm32-e407/src/stm32_bmp180.c | 106 -
.../arm/stm32/olimex-stm32-e407/src/stm32_boot.c | 2 +-
.../stm32/olimex-stm32-e407/src/stm32_bringup.c | 23 +-
.../arm/stm32/olimex-stm32-e407/src/stm32_ina219.c | 106 -
boards/arm/stm32/olimex-stm32-e407/src/stm32_spi.c | 2 +-
boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c | 2 +-
.../stm32/olimex-stm32-e407/src/stm32_userleds.c | 4 +-
.../arm/stm32/olimex-stm32-h405/scripts/Make.defs | 36 +-
boards/arm/stm32/olimex-stm32-h405/src/Make.defs | 68 +
boards/arm/stm32/olimex-stm32-h405/src/Makefile | 67 -
.../stm32/olimex-stm32-h405/src/stm32_appinit.c | 2 +-
.../arm/stm32/olimex-stm32-h407/scripts/Make.defs | 36 +-
boards/arm/stm32/olimex-stm32-h407/src/.gitignore | 2 -
boards/arm/stm32/olimex-stm32-h407/src/Make.defs | 88 +
boards/arm/stm32/olimex-stm32-h407/src/Makefile | 87 -
.../stm32/olimex-stm32-h407/src/stm32_appinit.c | 2 +-
.../stm32/olimex-stm32-h407/src/stm32_autoleds.c | 4 +-
.../arm/stm32/olimex-stm32-h407/src/stm32_boot.c | 2 +-
boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c | 2 +-
.../stm32/olimex-stm32-h407/src/stm32_userleds.c | 4 +-
.../stm32/olimex-stm32-p107/configs/nsh/defconfig | 1 -
.../arm/stm32/olimex-stm32-p107/scripts/Make.defs | 46 +-
boards/arm/stm32/olimex-stm32-p107/src/.gitignore | 2 -
boards/arm/stm32/olimex-stm32-p107/src/Make.defs | 54 +
boards/arm/stm32/olimex-stm32-p107/src/Makefile | 53 -
.../stm32/olimex-stm32-p107/src/stm32_appinit.c | 2 +-
.../arm/stm32/olimex-stm32-p107/src/stm32_boot.c | 2 +-
boards/arm/stm32/olimex-stm32-p107/src/stm32_can.c | 2 +-
.../stm32/olimex-stm32-p107/src/stm32_encx24j600.c | 8 +-
boards/arm/stm32/olimex-stm32-p107/src/stm32_spi.c | 2 +-
.../arm/stm32/olimex-stm32-p207/scripts/Make.defs | 36 +-
boards/arm/stm32/olimex-stm32-p207/src/Make.defs | 68 +
boards/arm/stm32/olimex-stm32-p207/src/Makefile | 67 -
.../stm32/olimex-stm32-p207/src/stm32_appinit.c | 2 +-
.../stm32/olimex-stm32-p407/configs/kelf/Make.defs | 51 +-
.../olimex-stm32-p407/configs/kmodule/Make.defs | 51 +-
.../olimex-stm32-p407/configs/kmodule/defconfig | 1 -
.../stm32/olimex-stm32-p407/configs/knsh/Make.defs | 42 +-
.../olimex-stm32-p407/configs/module/defconfig | 1 -
boards/arm/stm32/olimex-stm32-p407/include/board.h | 36 +-
.../arm/stm32/olimex-stm32-p407/kernel/.gitignore | 1 -
boards/arm/stm32/olimex-stm32-p407/kernel/Makefile | 16 +-
.../arm/stm32/olimex-stm32-p407/scripts/Make.defs | 38 +-
boards/arm/stm32/olimex-stm32-p407/src/Make.defs | 72 +
boards/arm/stm32/olimex-stm32-p407/src/Makefile | 75 -
.../olimex-stm32-p407/src/olimex-stm32-p407.h | 57 +-
.../stm32/olimex-stm32-p407/src/stm32_appinit.c | 2 +-
.../stm32/olimex-stm32-p407/src/stm32_bringup.c | 9 +-
.../arm/stm32/olimex-stm32-p407/src/stm32_dhtxx.c | 173 -
.../arm/stm32/olimex-stm32-p407/src/stm32_sram.c | 2 +-
boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c | 2 +-
.../stm32/olimexino-stm32/configs/can/defconfig | 3 +-
.../olimexino-stm32/configs/composite/defconfig | 3 +-
.../stm32/olimexino-stm32/configs/nsh/defconfig | 3 +-
.../olimexino-stm32/configs/smallnsh/defconfig | 3 +-
.../stm32/olimexino-stm32/configs/tiny/defconfig | 3 +-
boards/arm/stm32/olimexino-stm32/scripts/Make.defs | 46 +-
boards/arm/stm32/olimexino-stm32/src/.gitignore | 2 -
boards/arm/stm32/olimexino-stm32/src/Make.defs | 66 +
boards/arm/stm32/olimexino-stm32/src/Makefile | 65 -
.../arm/stm32/olimexino-stm32/src/stm32_appinit.c | 2 +-
boards/arm/stm32/olimexino-stm32/src/stm32_can.c | 2 +-
boards/arm/stm32/omnibusf4/kernel/.gitignore | 1 -
boards/arm/stm32/omnibusf4/kernel/Makefile | 16 +-
boards/arm/stm32/omnibusf4/scripts/Make.defs | 44 +-
boards/arm/stm32/omnibusf4/src/.gitignore | 2 -
boards/arm/stm32/omnibusf4/src/Make.defs | 111 +
boards/arm/stm32/omnibusf4/src/Makefile | 110 -
boards/arm/stm32/omnibusf4/src/stm32_appinit.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_boot.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_critmon.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_idle.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_mmcsd.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_netinit.c | 4 +-
boards/arm/stm32/omnibusf4/src/stm32_ostest.c | 6 +-
boards/arm/stm32/omnibusf4/src/stm32_pm.c | 4 +-
boards/arm/stm32/omnibusf4/src/stm32_pwm.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_spi.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_usb.c | 2 +-
boards/arm/stm32/omnibusf4/src/stm32_userleds.c | 4 +-
boards/arm/stm32/photon/scripts/Make.defs | 36 +-
boards/arm/stm32/photon/src/Make.defs | 76 +
boards/arm/stm32/photon/src/Makefile | 75 -
boards/arm/stm32/photon/src/stm32_appinit.c | 2 +-
boards/arm/stm32/photon/src/stm32_boot.c | 2 +-
boards/arm/stm32/photon/src/stm32_rgbled.c | 2 +-
boards/arm/stm32/photon/src/stm32_spi.c | 2 +-
boards/arm/stm32/shenzhou/README.txt | 2 +-
boards/arm/stm32/shenzhou/configs/nxwm/defconfig | 1 -
boards/arm/stm32/shenzhou/scripts/Make.defs | 36 +-
boards/arm/stm32/shenzhou/src/.gitignore | 2 -
boards/arm/stm32/shenzhou/src/Make.defs | 92 +
boards/arm/stm32/shenzhou/src/Makefile | 91 -
boards/arm/stm32/shenzhou/src/stm32_adc.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_appinit.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/shenzhou/src/stm32_boot.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_can.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_chipid.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_ili93xx.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_spi.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_ssd1289.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_usb.c | 2 +-
boards/arm/stm32/shenzhou/src/stm32_userleds.c | 4 +-
boards/arm/stm32/stm3210e-eval/README.txt | 10 +-
.../stm3210e-eval/configs/composite/defconfig | 1 -
.../arm/stm32/stm3210e-eval/configs/nsh2/defconfig | 1 -
.../arm/stm32/stm3210e-eval/configs/nx/defconfig | 1 -
.../stm32/stm3210e-eval/configs/nxterm/defconfig | 1 -
.../arm/stm32/stm3210e-eval/configs/pm/defconfig | 1 -
boards/arm/stm32/stm3210e-eval/scripts/Make.defs | 36 +-
boards/arm/stm32/stm3210e-eval/src/.gitignore | 2 -
boards/arm/stm32/stm3210e-eval/src/Make.defs | 88 +
boards/arm/stm32/stm3210e-eval/src/Makefile | 91 -
boards/arm/stm32/stm3210e-eval/src/stm32_adc.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_appinit.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_boot.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_can.c | 2 +-
.../stm32/stm3210e-eval/src/stm32_deselectlcd.c | 2 +-
.../stm32/stm3210e-eval/src/stm32_deselectnor.c | 2 +-
.../stm32/stm3210e-eval/src/stm32_deselectsram.c | 2 +-
.../arm/stm32/stm3210e-eval/src/stm32_extcontext.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_extmem.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_idle.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_lcd.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_leds.c | 4 +-
boards/arm/stm32/stm3210e-eval/src/stm32_lm75.c | 122 -
boards/arm/stm32/stm3210e-eval/src/stm32_pm.c | 6 +-
.../arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c | 2 +-
.../arm/stm32/stm3210e-eval/src/stm32_selectlcd.c | 2 +-
.../arm/stm32/stm3210e-eval/src/stm32_selectnor.c | 2 +-
.../arm/stm32/stm3210e-eval/src/stm32_selectsram.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_spi.c | 2 +-
boards/arm/stm32/stm3210e-eval/src/stm32_usbdev.c | 2 +-
boards/arm/stm32/stm3220g-eval/README.txt | 10 +-
.../stm32/stm3220g-eval/configs/dhcpd/defconfig | 2 -
.../stm32/stm3220g-eval/configs/nettest/defconfig | 1 -
.../arm/stm32/stm3220g-eval/configs/nsh2/defconfig | 1 -
.../arm/stm32/stm3220g-eval/configs/nxwm/defconfig | 1 -
.../stm32/stm3220g-eval/configs/telnetd/defconfig | 1 -
boards/arm/stm32/stm3220g-eval/scripts/Make.defs | 36 +-
boards/arm/stm32/stm3220g-eval/src/.gitignore | 2 -
boards/arm/stm32/stm3220g-eval/src/Make.defs | 80 +
boards/arm/stm32/stm3220g-eval/src/Makefile | 79 -
boards/arm/stm32/stm3220g-eval/src/stm32_adc.c | 2 +-
boards/arm/stm32/stm3220g-eval/src/stm32_appinit.c | 2 +-
.../arm/stm32/stm3220g-eval/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/stm3220g-eval/src/stm32_boot.c | 2 +-
boards/arm/stm32/stm3220g-eval/src/stm32_can.c | 2 +-
.../stm32/stm3220g-eval/src/stm32_deselectlcd.c | 2 +-
.../stm32/stm3220g-eval/src/stm32_deselectsram.c | 2 +-
boards/arm/stm32/stm3220g-eval/src/stm32_extmem.c | 2 +-
boards/arm/stm32/stm3220g-eval/src/stm32_lcd.c | 2 +-
boards/arm/stm32/stm3220g-eval/src/stm32_pwm.c | 2 +-
.../arm/stm32/stm3220g-eval/src/stm32_selectlcd.c | 2 +-
.../arm/stm32/stm3220g-eval/src/stm32_selectsram.c | 2 +-
boards/arm/stm32/stm3220g-eval/src/stm32_spi.c | 2 +-
boards/arm/stm32/stm3220g-eval/src/stm32_usb.c | 2 +-
.../arm/stm32/stm3220g-eval/src/stm32_userleds.c | 4 +-
boards/arm/stm32/stm3240g-eval/README.txt | 46 +-
.../stm32/stm3240g-eval/configs/dhcpd/defconfig | 2 -
.../stm32/stm3240g-eval/configs/discover/defconfig | 1 -
.../stm32/stm3240g-eval/configs/knxwm/Make.defs | 40 +-
.../stm32/stm3240g-eval/configs/nettest/defconfig | 1 -
.../arm/stm32/stm3240g-eval/configs/nsh/defconfig | 1 -
.../arm/stm32/stm3240g-eval/configs/nsh2/defconfig | 1 -
.../stm32/stm3240g-eval/configs/nxterm/defconfig | 1 -
.../arm/stm32/stm3240g-eval/configs/nxwm/defconfig | 1 -
.../stm32/stm3240g-eval/configs/telnetd/defconfig | 1 -
.../stm32/stm3240g-eval/configs/xmlrpc/defconfig | 1 -
boards/arm/stm32/stm3240g-eval/kernel/.gitignore | 1 -
boards/arm/stm32/stm3240g-eval/kernel/Makefile | 16 +-
boards/arm/stm32/stm3240g-eval/scripts/Make.defs | 36 +-
boards/arm/stm32/stm3240g-eval/src/.gitignore | 2 -
boards/arm/stm32/stm3240g-eval/src/Make.defs | 85 +
boards/arm/stm32/stm3240g-eval/src/Makefile | 88 -
boards/arm/stm32/stm3240g-eval/src/stm32_adc.c | 2 +-
boards/arm/stm32/stm3240g-eval/src/stm32_appinit.c | 2 +-
.../arm/stm32/stm3240g-eval/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/stm3240g-eval/src/stm32_can.c | 2 +-
.../stm32/stm3240g-eval/src/stm32_deselectlcd.c | 2 +-
.../stm32/stm3240g-eval/src/stm32_deselectsram.c | 2 +-
boards/arm/stm32/stm3240g-eval/src/stm32_extmem.c | 2 +-
boards/arm/stm32/stm3240g-eval/src/stm32_lcd.c | 2 +-
boards/arm/stm32/stm3240g-eval/src/stm32_ostest.c | 53 +-
boards/arm/stm32/stm3240g-eval/src/stm32_pwm.c | 2 +-
.../arm/stm32/stm3240g-eval/src/stm32_selectlcd.c | 2 +-
.../arm/stm32/stm3240g-eval/src/stm32_selectsram.c | 2 +-
boards/arm/stm32/stm3240g-eval/src/stm32_spi.c | 2 +-
boards/arm/stm32/stm3240g-eval/src/stm32_usb.c | 2 +-
.../arm/stm32/stm3240g-eval/src/stm32_userleds.c | 4 +-
boards/arm/stm32/stm32_tiny/README.txt | 8 +-
boards/arm/stm32/stm32_tiny/include/board.h | 21 +-
boards/arm/stm32/stm32_tiny/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32_tiny/src/.gitignore | 2 -
boards/arm/stm32/stm32_tiny/src/Make.defs | 52 +
boards/arm/stm32/stm32_tiny/src/Makefile | 54 -
boards/arm/stm32/stm32_tiny/src/stm32_appinit.c | 21 +-
boards/arm/stm32/stm32_tiny/src/stm32_boot.c | 2 +-
boards/arm/stm32/stm32_tiny/src/stm32_leds.c | 4 +-
boards/arm/stm32/stm32_tiny/src/stm32_nrf24l01.c | 129 -
boards/arm/stm32/stm32_tiny/src/stm32_pwm.c | 2 +-
boards/arm/stm32/stm32_tiny/src/stm32_spi.c | 2 +-
boards/arm/stm32/stm32_tiny/src/stm32_tiny.h | 20 +-
boards/arm/stm32/stm32_tiny/src/stm32_usbdev.c | 2 +-
boards/arm/stm32/stm32butterfly2/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32butterfly2/src/Make.defs | 69 +
boards/arm/stm32/stm32butterfly2/src/Makefile | 68 -
boards/arm/stm32/stm32f103-minimum/README.txt | 4 +-
boards/arm/stm32/stm32f103-minimum/include/board.h | 59 +-
.../arm/stm32/stm32f103-minimum/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32f103-minimum/src/.gitignore | 2 -
boards/arm/stm32/stm32f103-minimum/src/Make.defs | 127 +
boards/arm/stm32/stm32f103-minimum/src/Makefile | 170 -
.../arm/stm32/stm32f103-minimum/src/stm32_apa102.c | 103 -
.../stm32/stm32f103-minimum/src/stm32_apds9960.c | 182 -
.../stm32/stm32f103-minimum/src/stm32_appinit.c | 2 +-
.../stm32/stm32f103-minimum/src/stm32_autoleds.c | 4 +-
.../arm/stm32/stm32f103-minimum/src/stm32_bmp180.c | 103 -
.../arm/stm32/stm32f103-minimum/src/stm32_boot.c | 2 +-
.../stm32/stm32f103-minimum/src/stm32_bringup.c | 91 +-
.../arm/stm32/stm32f103-minimum/src/stm32_hcsr04.c | 268 -
boards/arm/stm32/stm32f103-minimum/src/stm32_lcd.c | 153 -
.../stm32f103-minimum/src/stm32_lcd_ssd1306.c | 101 +
.../stm32/stm32f103-minimum/src/stm32_lcd_st7567.c | 153 +
.../arm/stm32/stm32f103-minimum/src/stm32_lm75.c | 122 -
.../stm32/stm32f103-minimum/src/stm32_max6675.c | 101 -
.../stm32/stm32f103-minimum/src/stm32_nrf24l01.c | 147 -
.../stm32/stm32f103-minimum/src/stm32_nunchuck.c | 99 -
boards/arm/stm32/stm32f103-minimum/src/stm32_pwm.c | 2 +-
.../stm32/stm32f103-minimum/src/stm32_qencoder.c | 80 -
.../arm/stm32/stm32f103-minimum/src/stm32_rgbled.c | 2 +-
boards/arm/stm32/stm32f103-minimum/src/stm32_spi.c | 2 +-
.../stm32/stm32f103-minimum/src/stm32_ssd1306.c | 130 -
.../arm/stm32/stm32f103-minimum/src/stm32_tone.c | 152 -
.../arm/stm32/stm32f103-minimum/src/stm32_usbdev.c | 2 +-
.../stm32/stm32f103-minimum/src/stm32_veml6070.c | 105 -
.../stm32/stm32f103-minimum/src/stm32_zerocross.c | 193 -
.../stm32f103-minimum/src/stm32f103_minimum.h | 121 +-
.../stm32f334-disco/configs/buckboost/defconfig | 2 +-
.../stm32/stm32f334-disco/configs/nsh/defconfig | 2 +-
.../stm32f334-disco/configs/powerled/defconfig | 2 +-
boards/arm/stm32/stm32f334-disco/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32f334-disco/src/Make.defs | 80 +
boards/arm/stm32/stm32f334-disco/src/Makefile | 79 -
.../arm/stm32/stm32f334-disco/src/stm32_appinit.c | 2 +-
boards/arm/stm32/stm32f334-disco/src/stm32_smps.c | 161 +-
boards/arm/stm32/stm32f3discovery/README.txt | 37 +-
.../stm32/stm32f3discovery/configs/nsh/defconfig | 1 -
.../stm32f3discovery/configs/usbnsh/defconfig | 1 -
.../arm/stm32/stm32f3discovery/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32f3discovery/src/.gitignore | 2 -
boards/arm/stm32/stm32f3discovery/src/Make.defs | 64 +
boards/arm/stm32/stm32f3discovery/src/Makefile | 67 -
.../arm/stm32/stm32f3discovery/src/stm32_appinit.c | 2 +-
boards/arm/stm32/stm32f3discovery/src/stm32_boot.c | 2 +-
.../arm/stm32/stm32f3discovery/src/stm32_bringup.c | 6 +-
boards/arm/stm32/stm32f3discovery/src/stm32_pwm.c | 2 +-
.../stm32/stm32f3discovery/src/stm32_qencoder.c | 82 -
boards/arm/stm32/stm32f3discovery/src/stm32_spi.c | 2 +-
boards/arm/stm32/stm32f3discovery/src/stm32_usb.c | 2 +-
.../stm32/stm32f3discovery/src/stm32f3discovery.h | 69 +-
.../arm/stm32/stm32f411e-disco/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32f411e-disco/src/Make.defs | 50 +
boards/arm/stm32/stm32f411e-disco/src/Makefile | 49 -
.../arm/stm32/stm32f411e-disco/src/stm32_appinit.c | 2 +-
boards/arm/stm32/stm32f411e-disco/src/stm32_boot.c | 2 +-
boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c | 2 +-
boards/arm/stm32/stm32f429i-disco/README.txt | 29 +-
.../stm32/stm32f429i-disco/configs/fb/defconfig | 1 -
.../stm32f429i-disco/configs/highpri/defconfig | 1 +
.../stm32/stm32f429i-disco/configs/lcd/defconfig | 1 -
.../stm32/stm32f429i-disco/configs/lvgl/defconfig | 1 -
boards/arm/stm32/stm32f429i-disco/include/board.h | 19 +-
.../arm/stm32/stm32f429i-disco/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32f429i-disco/src/.gitignore | 2 -
boards/arm/stm32/stm32f429i-disco/src/Make.defs | 99 +
boards/arm/stm32/stm32f429i-disco/src/Makefile | 102 -
.../arm/stm32/stm32f429i-disco/src/stm32_appinit.c | 2 +-
.../stm32/stm32f429i-disco/src/stm32_autoleds.c | 4 +-
boards/arm/stm32/stm32f429i-disco/src/stm32_boot.c | 2 +-
.../arm/stm32/stm32f429i-disco/src/stm32_bringup.c | 210 +-
.../arm/stm32/stm32f429i-disco/src/stm32_extmem.c | 2 +-
.../arm/stm32/stm32f429i-disco/src/stm32_highpri.c | 43 +-
boards/arm/stm32/stm32f429i-disco/src/stm32_idle.c | 2 +-
.../arm/stm32/stm32f429i-disco/src/stm32_l3gd20.c | 142 -
boards/arm/stm32/stm32f429i-disco/src/stm32_lcd.c | 2 +-
.../arm/stm32/stm32f429i-disco/src/stm32_ostest.c | 53 +-
boards/arm/stm32/stm32f429i-disco/src/stm32_pwm.c | 2 +-
boards/arm/stm32/stm32f429i-disco/src/stm32_spi.c | 2 +-
boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c | 2 +-
.../stm32/stm32f429i-disco/src/stm32_userleds.c | 4 +-
.../stm32/stm32f429i-disco/src/stm32f429i-disco.h | 17 +-
boards/arm/stm32/stm32f4discovery/Kconfig | 1 +
boards/arm/stm32/stm32f4discovery/README.txt | 45 +-
.../stm32f4discovery/configs/cxxtest/Make.defs | 79 +-
.../stm32f4discovery/configs/cxxtest/defconfig | 1 -
.../stm32/stm32f4discovery/configs/elf/Make.defs | 42 +-
.../stm32/stm32f4discovery/configs/ipv6/defconfig | 1 -
.../stm32f4discovery/configs/max31855/defconfig | 1 -
.../stm32f4discovery/configs/module/defconfig | 1 -
.../stm32f4discovery/configs/netnsh/defconfig | 1 -
.../stm32/stm32f4discovery/configs/nsh/defconfig | 1 -
.../stm32f4discovery/configs/nxlines/defconfig | 1 -
.../stm32/stm32f4discovery/configs/pm/defconfig | 1 -
.../stm32f4discovery/configs/posix_spawn/Make.defs | 42 +-
.../stm32/stm32f4discovery/configs/rndis/defconfig | 1 -
.../stm32f4discovery/configs/testlibcxx/Make.defs | 40 +-
.../stm32f4discovery/configs/usbnsh/defconfig | 1 -
.../stm32f4discovery/configs/winbuild/Make.defs | 29 +-
.../stm32f4discovery/configs/winbuild/defconfig | 1 -
boards/arm/stm32/stm32f4discovery/include/board.h | 78 +-
.../arm/stm32/stm32f4discovery/kernel/.gitignore | 1 -
boards/arm/stm32/stm32f4discovery/kernel/Makefile | 16 +-
.../arm/stm32/stm32f4discovery/scripts/Make.defs | 83 +-
boards/arm/stm32/stm32f4discovery/src/.gitignore | 2 -
boards/arm/stm32/stm32f4discovery/src/Make.defs | 196 +
boards/arm/stm32/stm32f4discovery/src/Makefile | 235 -
.../arm/stm32/stm32f4discovery/src/stm32_appinit.c | 2 +-
.../stm32/stm32f4discovery/src/stm32_autoleds.c | 4 +-
.../stm32/stm32f4discovery/src/stm32_bh1750fvi.c | 105 -
.../arm/stm32/stm32f4discovery/src/stm32_bmp180.c | 103 -
boards/arm/stm32/stm32f4discovery/src/stm32_boot.c | 2 +-
.../arm/stm32/stm32f4discovery/src/stm32_bringup.c | 78 +-
boards/arm/stm32/stm32f4discovery/src/stm32_can.c | 2 +-
.../arm/stm32/stm32f4discovery/src/stm32_critmon.c | 2 +-
.../stm32/stm32f4discovery/src/stm32_enc28j60.c | 8 +-
.../arm/stm32/stm32f4discovery/src/stm32_extmem.c | 2 +-
.../arm/stm32/stm32f4discovery/src/stm32_gs2200m.c | 2 +-
boards/arm/stm32/stm32f4discovery/src/stm32_idle.c | 2 +-
.../arm/stm32/stm32f4discovery/src/stm32_lis3dsh.c | 135 -
.../stm32/stm32f4discovery/src/stm32_max31855.c | 97 -
.../arm/stm32/stm32f4discovery/src/stm32_max6675.c | 101 -
.../stm32/stm32f4discovery/src/stm32_mlx90614.c | 107 -
.../arm/stm32/stm32f4discovery/src/stm32_mmcsd.c | 2 +-
.../arm/stm32/stm32f4discovery/src/stm32_netinit.c | 4 +-
.../stm32/stm32f4discovery/src/stm32_nunchuck.c | 99 -
.../arm/stm32/stm32f4discovery/src/stm32_ostest.c | 51 +-
boards/arm/stm32/stm32f4discovery/src/stm32_pm.c | 4 +-
.../stm32/stm32f4discovery/src/stm32_pmbuttons.c | 2 +-
boards/arm/stm32/stm32f4discovery/src/stm32_pwm.c | 2 +-
.../stm32/stm32f4discovery/src/stm32_qencoder.c | 80 -
.../arm/stm32/stm32f4discovery/src/stm32_rgbled.c | 2 +-
boards/arm/stm32/stm32f4discovery/src/stm32_spi.c | 2 +-
.../arm/stm32/stm32f4discovery/src/stm32_ssd1289.c | 2 +-
.../arm/stm32/stm32f4discovery/src/stm32_st7567.c | 4 +-
boards/arm/stm32/stm32f4discovery/src/stm32_usb.c | 2 +-
.../stm32/stm32f4discovery/src/stm32_userleds.c | 4 +-
.../arm/stm32/stm32f4discovery/src/stm32_xen1210.c | 356 -
.../stm32/stm32f4discovery/src/stm32_zerocross.c | 197 -
.../stm32/stm32f4discovery/src/stm32f4discovery.h | 71 +-
boards/arm/stm32/stm32ldiscovery/README.txt | 8 +-
.../stm32/stm32ldiscovery/configs/chrono/defconfig | 2 +-
.../stm32/stm32ldiscovery/configs/nsh/defconfig | 3 +-
boards/arm/stm32/stm32ldiscovery/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32ldiscovery/src/.gitignore | 2 -
boards/arm/stm32/stm32ldiscovery/src/Make.defs | 64 +
boards/arm/stm32/stm32ldiscovery/src/Makefile | 67 -
.../arm/stm32/stm32ldiscovery/src/stm32_appinit.c | 2 +-
boards/arm/stm32/stm32ldiscovery/src/stm32_boot.c | 2 +-
.../arm/stm32/stm32ldiscovery/src/stm32_bringup.c | 6 +-
boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c | 2 +-
boards/arm/stm32/stm32ldiscovery/src/stm32_pwm.c | 2 +-
.../arm/stm32/stm32ldiscovery/src/stm32_qencoder.c | 82 -
boards/arm/stm32/stm32ldiscovery/src/stm32_spi.c | 2 +-
.../stm32/stm32ldiscovery/src/stm32ldiscovery.h | 63 +-
boards/arm/stm32/stm32vldiscovery/README.txt | 2 +-
.../arm/stm32/stm32vldiscovery/scripts/Make.defs | 36 +-
boards/arm/stm32/stm32vldiscovery/src/.gitignore | 2 -
boards/arm/stm32/stm32vldiscovery/src/Make.defs | 47 +
boards/arm/stm32/stm32vldiscovery/src/Makefile | 46 -
.../arm/stm32/stm32vldiscovery/src/stm32_appinit.c | 2 +-
boards/arm/stm32/stm32vldiscovery/src/stm32_boot.c | 2 +-
boards/arm/stm32/stm32vldiscovery/src/stm32_leds.c | 4 +-
boards/arm/stm32/viewtool-stm32f107/README.txt | 12 +-
.../viewtool-stm32f107/configs/highpri/defconfig | 1 -
.../viewtool-stm32f107/configs/netnsh/defconfig | 1 -
.../stm32/viewtool-stm32f107/configs/nsh/defconfig | 1 -
.../arm/stm32/viewtool-stm32f107/scripts/Make.defs | 36 +-
boards/arm/stm32/viewtool-stm32f107/src/.gitignore | 2 -
boards/arm/stm32/viewtool-stm32f107/src/Make.defs | 94 +
boards/arm/stm32/viewtool-stm32f107/src/Makefile | 97 -
.../stm32/viewtool-stm32f107/src/stm32_ads7843e.c | 2 +-
.../stm32/viewtool-stm32f107/src/stm32_appinit.c | 2 +-
.../arm/stm32/viewtool-stm32f107/src/stm32_boot.c | 2 +-
.../stm32/viewtool-stm32f107/src/stm32_bringup.c | 7 +-
.../arm/stm32/viewtool-stm32f107/src/stm32_can.c | 2 +-
.../arm/stm32/viewtool-stm32f107/src/stm32_ft80x.c | 2 +-
.../stm32/viewtool-stm32f107/src/stm32_highpri.c | 56 +-
.../stm32/viewtool-stm32f107/src/stm32_max3421e.c | 2 +-
.../stm32/viewtool-stm32f107/src/stm32_mpl115a.c | 101 -
.../arm/stm32/viewtool-stm32f107/src/stm32_spi.c | 2 +-
.../stm32/viewtool-stm32f107/src/stm32_ssd1289.c | 2 +-
.../b-l072z-lrwan1/configs/adc/defconfig | 2 +-
.../b-l072z-lrwan1/configs/nsh/defconfig | 2 +-
.../b-l072z-lrwan1/configs/nxlines_oled/defconfig | 2 +-
.../b-l072z-lrwan1/configs/sx127x/defconfig | 2 +-
.../stm32f0l0g0/b-l072z-lrwan1/scripts/Make.defs | 36 +-
boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/Makefile | 3 +-
.../stm32f0l0g0/b-l072z-lrwan1/src/stm32_appinit.c | 2 +-
.../arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_spi.c | 2 +-
boards/arm/stm32f0l0g0/drivers/Kconfig | 4 -
.../nucleo-f072rb/configs/nsh/defconfig | 2 +-
.../stm32f0l0g0/nucleo-f072rb/scripts/Make.defs | 36 +-
.../arm/stm32f0l0g0/nucleo-f072rb/src/.gitignore | 2 -
boards/arm/stm32f0l0g0/nucleo-f072rb/src/Makefile | 3 +-
.../stm32f0l0g0/nucleo-f072rb/src/stm32_appinit.c | 2 +-
.../stm32f0l0g0/nucleo-f072rb/src/stm32_autoleds.c | 4 +-
.../arm/stm32f0l0g0/nucleo-f072rb/src/stm32_boot.c | 2 +-
.../stm32f0l0g0/nucleo-f072rb/src/stm32_userleds.c | 4 +-
.../nucleo-f091rc/configs/nsh/defconfig | 2 +-
.../nucleo-f091rc/configs/sx127x/defconfig | 2 +-
.../stm32f0l0g0/nucleo-f091rc/scripts/Make.defs | 36 +-
.../arm/stm32f0l0g0/nucleo-f091rc/src/.gitignore | 2 -
boards/arm/stm32f0l0g0/nucleo-f091rc/src/Makefile | 3 +-
.../stm32f0l0g0/nucleo-f091rc/src/stm32_appinit.c | 2 +-
.../stm32f0l0g0/nucleo-f091rc/src/stm32_autoleds.c | 4 +-
.../arm/stm32f0l0g0/nucleo-f091rc/src/stm32_boot.c | 2 +-
.../arm/stm32f0l0g0/nucleo-f091rc/src/stm32_spi.c | 2 +-
.../stm32f0l0g0/nucleo-f091rc/src/stm32_userleds.c | 4 +-
.../nucleo-g070rb/configs/nsh/defconfig | 2 +-
.../stm32f0l0g0/nucleo-g070rb/scripts/Make.defs | 36 +-
boards/arm/stm32f0l0g0/nucleo-g070rb/src/Makefile | 3 +-
.../stm32f0l0g0/nucleo-g070rb/src/stm32_appinit.c | 2 +-
.../nucleo-g071rb/configs/nsh/defconfig | 2 +-
.../stm32f0l0g0/nucleo-g071rb/scripts/Make.defs | 36 +-
boards/arm/stm32f0l0g0/nucleo-g071rb/src/Makefile | 3 +-
.../stm32f0l0g0/nucleo-g071rb/src/stm32_appinit.c | 2 +-
.../nucleo-l073rz/configs/nsh/defconfig | 2 +-
.../nucleo-l073rz/configs/sx127x/defconfig | 2 +-
.../stm32f0l0g0/nucleo-l073rz/scripts/Make.defs | 36 +-
boards/arm/stm32f0l0g0/nucleo-l073rz/src/Makefile | 3 +-
.../stm32f0l0g0/nucleo-l073rz/src/stm32_appinit.c | 2 +-
.../stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c | 2 +-
.../arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c | 2 +-
.../stm32f051-discovery/configs/nsh/defconfig | 2 +-
.../stm32f051-discovery/scripts/Make.defs | 36 +-
.../stm32f0l0g0/stm32f051-discovery/src/.gitignore | 2 -
.../stm32f0l0g0/stm32f051-discovery/src/Makefile | 3 +-
.../stm32f051-discovery/src/stm32_appinit.c | 2 +-
.../stm32f051-discovery/src/stm32_boot.c | 2 +-
.../stm32f072-discovery/configs/nsh/defconfig | 2 +-
.../stm32f072-discovery/scripts/Make.defs | 36 +-
.../stm32f0l0g0/stm32f072-discovery/src/.gitignore | 2 -
.../stm32f0l0g0/stm32f072-discovery/src/Makefile | 3 +-
.../stm32f072-discovery/src/stm32_appinit.c | 2 +-
.../stm32f072-discovery/src/stm32_boot.c | 2 +-
boards/arm/stm32f7/drivers/Kconfig | 4 -
.../stm32f7/nucleo-144/configs/f722-nsh/Make.defs | 36 +-
.../nucleo-144/configs/f746-evalos/Make.defs | 36 +-
.../stm32f7/nucleo-144/configs/f746-nsh/Make.defs | 36 +-
.../nucleo-144/configs/f767-evalos/Make.defs | 36 +-
.../nucleo-144/configs/f767-netnsh/Make.defs | 36 +-
.../stm32f7/nucleo-144/configs/f767-nsh/Make.defs | 36 +-
boards/arm/stm32f7/nucleo-144/src/.gitignore | 2 -
boards/arm/stm32f7/nucleo-144/src/Makefile | 3 +-
.../stm32f7/nucleo-144/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c | 6 +-
boards/arm/stm32f7/nucleo-144/src/stm32_boot.c | 2 +-
boards/arm/stm32f7/nucleo-144/src/stm32_pwm.c | 2 +-
boards/arm/stm32f7/nucleo-144/src/stm32_spi.c | 2 +-
boards/arm/stm32f7/nucleo-144/src/stm32_usb.c | 2 +-
boards/arm/stm32f7/stm32f746-ws/scripts/Make.defs | 36 +-
boards/arm/stm32f7/stm32f746-ws/src/.gitignore | 2 -
boards/arm/stm32f7/stm32f746-ws/src/Makefile | 3 +-
boards/arm/stm32f7/stm32f746-ws/src/stm32_boot.c | 2 +-
boards/arm/stm32f7/stm32f746-ws/src/stm32_spi.c | 2 +-
boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c | 2 +-
.../arm/stm32f7/stm32f746g-disco/kernel/.gitignore | 1 -
.../arm/stm32f7/stm32f746g-disco/kernel/Makefile | 16 +-
.../arm/stm32f7/stm32f746g-disco/scripts/Make.defs | 38 +-
boards/arm/stm32f7/stm32f746g-disco/src/.gitignore | 2 -
boards/arm/stm32f7/stm32f746g-disco/src/Makefile | 3 +-
.../stm32f746g-disco/src/stm32_appinitialize.c | 2 +-
.../arm/stm32f7/stm32f746g-disco/src/stm32_boot.c | 2 +-
.../stm32f7/stm32f746g-disco/src/stm32_extmem.c | 2 +-
.../arm/stm32f7/stm32f746g-disco/src/stm32_lcd.c | 2 +-
.../stm32f7/stm32f746g-disco/src/stm32_ostest.c | 53 +-
.../arm/stm32f7/stm32f746g-disco/src/stm32_spi.c | 2 +-
.../arm/stm32f7/stm32f769i-disco/kernel/.gitignore | 1 -
.../arm/stm32f7/stm32f769i-disco/kernel/Makefile | 16 +-
.../arm/stm32f7/stm32f769i-disco/scripts/Make.defs | 36 +-
boards/arm/stm32f7/stm32f769i-disco/src/.gitignore | 2 -
boards/arm/stm32f7/stm32f769i-disco/src/Makefile | 3 +-
.../stm32f769i-disco/src/stm32_appinitialize.c | 2 +-
.../arm/stm32f7/stm32f769i-disco/src/stm32_boot.c | 2 +-
.../stm32f7/stm32f769i-disco/src/stm32_ostest.c | 54 +-
.../arm/stm32f7/stm32f769i-disco/src/stm32_pwm.c | 2 +-
.../arm/stm32f7/stm32f769i-disco/src/stm32_spi.c | 2 +-
boards/arm/stm32h7/drivers/Kconfig | 4 -
boards/arm/stm32h7/nucleo-h743zi/kernel/.gitignore | 1 -
boards/arm/stm32h7/nucleo-h743zi/kernel/Makefile | 16 +-
boards/arm/stm32h7/nucleo-h743zi/scripts/Make.defs | 36 +-
boards/arm/stm32h7/nucleo-h743zi/src/.gitignore | 2 -
boards/arm/stm32h7/nucleo-h743zi/src/Makefile | 3 +-
.../nucleo-h743zi/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot.c | 2 +-
.../arm/stm32h7/nucleo-h743zi/src/stm32_nrf24l01.c | 2 +-
boards/arm/stm32h7/nucleo-h743zi/src/stm32_pwm.c | 2 +-
boards/arm/stm32h7/nucleo-h743zi/src/stm32_spi.c | 2 +-
boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c | 2 +-
.../arm/stm32h7/stm32h747i-disco/include/board.h | 73 +-
.../arm/stm32h7/stm32h747i-disco/kernel/.gitignore | 1 -
.../arm/stm32h7/stm32h747i-disco/kernel/Makefile | 16 +-
.../arm/stm32h7/stm32h747i-disco/scripts/Make.defs | 36 +-
boards/arm/stm32h7/stm32h747i-disco/src/.gitignore | 2 -
boards/arm/stm32h7/stm32h747i-disco/src/Makefile | 11 +-
.../stm32h747i-disco/src/stm32_appinitialize.c | 2 +-
.../arm/stm32h7/stm32h747i-disco/src/stm32_boot.c | 2 +-
.../stm32h7/stm32h747i-disco/src/stm32_bringup.c | 18 +
.../stm32h7/stm32h747i-disco/src/stm32_dma_alloc.c | 105 +
.../arm/stm32h7/stm32h747i-disco/src/stm32_sdmmc.c | 160 +
.../arm/stm32h7/stm32h747i-disco/src/stm32_spi.c | 2 +-
.../arm/stm32h7/stm32h747i-disco/src/stm32_usb.c | 2 +-
.../stm32h747i-disco/src/stm32h747i-disco.h | 44 +-
.../arm/stm32l4/b-l475e-iot01a/scripts/Make.defs | 36 +-
boards/arm/stm32l4/b-l475e-iot01a/src/.gitignore | 2 -
boards/arm/stm32l4/b-l475e-iot01a/src/Makefile | 3 +-
.../arm/stm32l4/b-l475e-iot01a/src/stm32_appinit.c | 2 +-
boards/arm/stm32l4/b-l475e-iot01a/src/stm32_boot.c | 2 +-
boards/arm/stm32l4/drivers/Kconfig | 4 -
boards/arm/stm32l4/nucleo-l432kc/README.txt | 98 +-
.../stm32l4/nucleo-l432kc/configs/nsh/defconfig | 1 -
.../stm32l4/nucleo-l432kc/configs/spwm/defconfig | 1 -
boards/arm/stm32l4/nucleo-l432kc/scripts/Make.defs | 36 +-
boards/arm/stm32l4/nucleo-l432kc/src/Makefile | 3 +-
boards/arm/stm32l4/nucleo-l432kc/src/stm32_adc.c | 2 +-
.../arm/stm32l4/nucleo-l432kc/src/stm32_appinit.c | 6 +-
.../arm/stm32l4/nucleo-l432kc/src/stm32_autoleds.c | 4 +-
boards/arm/stm32l4/nucleo-l432kc/src/stm32_boot.c | 2 +-
boards/arm/stm32l4/nucleo-l432kc/src/stm32_pwm.c | 2 +-
.../arm/stm32l4/nucleo-l432kc/src/stm32_qencoder.c | 2 +-
boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c | 2 +-
boards/arm/stm32l4/nucleo-l432kc/src/stm32_spwm.c | 22 +-
.../arm/stm32l4/nucleo-l432kc/src/stm32_userleds.c | 4 +-
boards/arm/stm32l4/nucleo-l452re/scripts/Make.defs | 36 +-
boards/arm/stm32l4/nucleo-l452re/src/.gitignore | 2 -
boards/arm/stm32l4/nucleo-l452re/src/Makefile | 3 +-
.../arm/stm32l4/nucleo-l452re/src/stm32_appinit.c | 2 +-
.../arm/stm32l4/nucleo-l452re/src/stm32_autoleds.c | 4 +-
boards/arm/stm32l4/nucleo-l452re/src/stm32_boot.c | 2 +-
boards/arm/stm32l4/nucleo-l452re/src/stm32_spi.c | 2 +-
.../arm/stm32l4/nucleo-l452re/src/stm32_userleds.c | 4 +-
boards/arm/stm32l4/nucleo-l476rg/README.txt | 98 +-
.../stm32l4/nucleo-l476rg/configs/nsh/defconfig | 1 -
.../stm32l4/nucleo-l476rg/configs/nxdemo/defconfig | 1 -
boards/arm/stm32l4/nucleo-l476rg/scripts/Make.defs | 89 +-
boards/arm/stm32l4/nucleo-l476rg/src/Makefile | 3 +-
boards/arm/stm32l4/nucleo-l476rg/src/stm32_adc.c | 2 +-
.../arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c | 2 +-
.../arm/stm32l4/nucleo-l476rg/src/stm32_autoleds.c | 4 +-
boards/arm/stm32l4/nucleo-l476rg/src/stm32_boot.c | 2 +-
boards/arm/stm32l4/nucleo-l476rg/src/stm32_pwm.c | 2 +-
.../arm/stm32l4/nucleo-l476rg/src/stm32_qencoder.c | 2 +-
boards/arm/stm32l4/nucleo-l476rg/src/stm32_spi.c | 2 +-
.../arm/stm32l4/nucleo-l476rg/src/stm32_userleds.c | 4 +-
boards/arm/stm32l4/nucleo-l496zg/scripts/Make.defs | 36 +-
boards/arm/stm32l4/nucleo-l496zg/src/.gitignore | 2 -
boards/arm/stm32l4/nucleo-l496zg/src/Makefile | 3 +-
.../nucleo-l496zg/src/stm32_appinitialize.c | 2 +-
boards/arm/stm32l4/nucleo-l496zg/src/stm32_boot.c | 2 +-
boards/arm/stm32l4/nucleo-l496zg/src/stm32_spi.c | 2 +-
boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c | 2 +-
boards/arm/stm32l4/stm32l476-mdk/scripts/Make.defs | 36 +-
boards/arm/stm32l4/stm32l476-mdk/src/Makefile | 3 +-
.../arm/stm32l4/stm32l476-mdk/src/stm32_appinit.c | 2 +-
boards/arm/stm32l4/stm32l476-mdk/src/stm32_boot.c | 2 +-
.../arm/stm32l4/stm32l476-mdk/src/stm32_bringup.c | 2 +-
.../stm32l4/stm32l476-mdk/src/stm32_clockconfig.c | 2 +-
boards/arm/stm32l4/stm32l476-mdk/src/stm32_spi.c | 2 +-
.../stm32l476vg-disco/configs/knsh/Make.defs | 42 +-
.../stm32l4/stm32l476vg-disco/kernel/.gitignore | 1 -
.../arm/stm32l4/stm32l476vg-disco/kernel/Makefile | 16 +-
.../stm32l4/stm32l476vg-disco/scripts/Make.defs | 38 +-
boards/arm/stm32l4/stm32l476vg-disco/src/Makefile | 3 +-
.../stm32l4/stm32l476vg-disco/src/stm32_appinit.c | 2 +-
.../stm32l4/stm32l476vg-disco/src/stm32_autoleds.c | 4 +-
.../arm/stm32l4/stm32l476vg-disco/src/stm32_boot.c | 2 +-
.../stm32l476vg-disco/src/stm32_clockconfig.c | 2 +-
.../arm/stm32l4/stm32l476vg-disco/src/stm32_spi.c | 2 +-
.../arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c | 2 +-
.../stm32l4/stm32l476vg-disco/src/stm32_userleds.c | 4 +-
.../stm32l4r9ai-disco/configs/knsh/Make.defs | 42 +-
.../stm32l4/stm32l4r9ai-disco/kernel/.gitignore | 1 -
.../arm/stm32l4/stm32l4r9ai-disco/kernel/Makefile | 16 +-
.../stm32l4/stm32l4r9ai-disco/scripts/Make.defs | 38 +-
.../arm/stm32l4/stm32l4r9ai-disco/src/.gitignore | 2 -
boards/arm/stm32l4/stm32l4r9ai-disco/src/Makefile | 3 +-
.../stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c | 2 +-
.../stm32l4/stm32l4r9ai-disco/src/stm32_autoleds.c | 4 +-
.../arm/stm32l4/stm32l4r9ai-disco/src/stm32_boot.c | 2 +-
.../stm32l4r9ai-disco/src/stm32_clockconfig.c | 2 +-
.../arm/stm32l4/stm32l4r9ai-disco/src/stm32_spi.c | 2 +-
.../arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c | 2 +-
.../stm32l4/stm32l4r9ai-disco/src/stm32_userleds.c | 4 +-
boards/arm/str71x/drivers/Kconfig | 4 -
boards/arm/str71x/olimex-strp711/README.txt | 8 +-
boards/arm/str71x/olimex-strp711/scripts/Make.defs | 38 +-
boards/arm/str71x/olimex-strp711/src/.gitignore | 2 -
boards/arm/str71x/olimex-strp711/src/Makefile | 3 +-
.../arm/str71x/olimex-strp711/src/str71_appinit.c | 2 +-
.../arm/str71x/olimex-strp711/src/str71_buttons.c | 4 +-
.../arm/str71x/olimex-strp711/src/str71_enc28j60.c | 8 +-
boards/arm/str71x/olimex-strp711/src/str71_leds.c | 4 +-
boards/arm/str71x/olimex-strp711/src/str71_spi.c | 4 +-
boards/arm/tiva/dk-tm4c129x/README.txt | 4 +-
boards/arm/tiva/dk-tm4c129x/configs/ipv6/defconfig | 1 -
boards/arm/tiva/dk-tm4c129x/configs/nsh/defconfig | 1 -
boards/arm/tiva/dk-tm4c129x/scripts/Make.defs | 36 +-
boards/arm/tiva/dk-tm4c129x/src/.gitignore | 2 -
boards/arm/tiva/dk-tm4c129x/src/Makefile | 3 +-
boards/arm/tiva/dk-tm4c129x/src/tm4c_appinit.c | 2 +-
boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c | 4 +-
boards/arm/tiva/dk-tm4c129x/src/tm4c_ethernet.c | 2 +-
boards/arm/tiva/dk-tm4c129x/src/tm4c_ssi.c | 2 +-
boards/arm/tiva/drivers/Kconfig | 4 -
boards/arm/tiva/eagle100/README.txt | 13 +-
boards/arm/tiva/eagle100/configs/httpd/defconfig | 3 +-
boards/arm/tiva/eagle100/configs/nettest/defconfig | 1 -
boards/arm/tiva/eagle100/configs/nsh/defconfig | 1 -
boards/arm/tiva/eagle100/configs/nxflat/defconfig | 1 -
boards/arm/tiva/eagle100/scripts/Make.defs | 36 +-
boards/arm/tiva/eagle100/src/.gitignore | 2 -
boards/arm/tiva/eagle100/src/Makefile | 3 +-
boards/arm/tiva/eagle100/src/lm_appinit.c | 2 +-
boards/arm/tiva/eagle100/src/lm_boot.c | 2 +-
boards/arm/tiva/eagle100/src/lm_ethernet.c | 2 +-
boards/arm/tiva/eagle100/src/lm_leds.c | 4 +-
boards/arm/tiva/eagle100/src/lm_ssi.c | 2 +-
boards/arm/tiva/ekk-lm3s9b96/scripts/Make.defs | 36 +-
boards/arm/tiva/ekk-lm3s9b96/src/.gitignore | 2 -
boards/arm/tiva/ekk-lm3s9b96/src/Makefile | 3 +-
boards/arm/tiva/ekk-lm3s9b96/src/lm_appinit.c | 2 +-
boards/arm/tiva/ekk-lm3s9b96/src/lm_boot.c | 4 +-
boards/arm/tiva/ekk-lm3s9b96/src/lm_ethernet.c | 2 +-
boards/arm/tiva/ekk-lm3s9b96/src/lm_leds.c | 4 +-
boards/arm/tiva/ekk-lm3s9b96/src/lm_ssi.c | 2 +-
boards/arm/tiva/launchxl-cc1310/scripts/Make.defs | 38 +-
boards/arm/tiva/launchxl-cc1310/src/Makefile | 3 +-
.../arm/tiva/launchxl-cc1310/src/cc1310_appinit.c | 2 +-
boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c | 2 +-
boards/arm/tiva/launchxl-cc1310/src/cc1310_ssi.c | 2 +-
.../arm/tiva/launchxl-cc1312r1/scripts/Make.defs | 38 +-
boards/arm/tiva/launchxl-cc1312r1/src/Makefile | 3 +-
.../tiva/launchxl-cc1312r1/src/cc1312_appinit.c | 2 +-
.../arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c | 2 +-
boards/arm/tiva/launchxl-cc1312r1/src/cc1312_ssi.c | 2 +-
boards/arm/tiva/lm3s6432-s2e/configs/nsh/defconfig | 1 -
boards/arm/tiva/lm3s6432-s2e/scripts/Make.defs | 36 +-
boards/arm/tiva/lm3s6432-s2e/src/.gitignore | 2 -
boards/arm/tiva/lm3s6432-s2e/src/Makefile | 3 +-
boards/arm/tiva/lm3s6432-s2e/src/lm_appinit.c | 2 +-
boards/arm/tiva/lm3s6432-s2e/src/lm_boot.c | 4 +-
boards/arm/tiva/lm3s6432-s2e/src/lm_ethernet.c | 2 +-
boards/arm/tiva/lm3s6432-s2e/src/lm_leds.c | 4 +-
boards/arm/tiva/lm3s6432-s2e/src/lm_ssi.c | 2 +-
boards/arm/tiva/lm3s6965-ek/README.txt | 2 +-
.../tiva/lm3s6965-ek/configs/discover/defconfig | 21 +-
.../arm/tiva/lm3s6965-ek/configs/tcpecho/defconfig | 1 -
boards/arm/tiva/lm3s6965-ek/include/board.h | 7 +-
boards/arm/tiva/lm3s6965-ek/kernel/Makefile | 16 +-
boards/arm/tiva/lm3s6965-ek/scripts/Make.defs | 46 +-
boards/arm/tiva/lm3s6965-ek/src/.gitignore | 2 -
boards/arm/tiva/lm3s6965-ek/src/Makefile | 3 +-
boards/arm/tiva/lm3s6965-ek/src/lm_appinit.c | 2 +-
boards/arm/tiva/lm3s6965-ek/src/lm_boot.c | 4 +-
boards/arm/tiva/lm3s6965-ek/src/lm_ethernet.c | 2 +-
boards/arm/tiva/lm3s6965-ek/src/lm_leds.c | 4 +-
boards/arm/tiva/lm3s6965-ek/src/lm_ssi.c | 2 +-
boards/arm/tiva/lm3s8962-ek/scripts/Make.defs | 36 +-
boards/arm/tiva/lm3s8962-ek/src/.gitignore | 2 -
boards/arm/tiva/lm3s8962-ek/src/Makefile | 3 +-
boards/arm/tiva/lm3s8962-ek/src/lm_appinit.c | 2 +-
boards/arm/tiva/lm3s8962-ek/src/lm_boot.c | 4 +-
boards/arm/tiva/lm3s8962-ek/src/lm_ethernet.c | 2 +-
boards/arm/tiva/lm3s8962-ek/src/lm_leds.c | 4 +-
boards/arm/tiva/lm3s8962-ek/src/lm_ssi.c | 2 +-
boards/arm/tiva/lm4f120-launchpad/README.txt | 2 +-
.../arm/tiva/lm4f120-launchpad/scripts/Make.defs | 36 +-
boards/arm/tiva/lm4f120-launchpad/src/.gitignore | 2 -
boards/arm/tiva/lm4f120-launchpad/src/Makefile | 3 +-
.../arm/tiva/lm4f120-launchpad/src/lm4f_appinit.c | 2 +-
.../arm/tiva/lm4f120-launchpad/src/lm4f_autoleds.c | 4 +-
boards/arm/tiva/lm4f120-launchpad/src/lm4f_boot.c | 4 +-
boards/arm/tiva/lm4f120-launchpad/src/lm4f_ssi.c | 2 +-
boards/arm/tiva/tm4c123g-launchpad/README.txt | 2 +-
.../arm/tiva/tm4c123g-launchpad/scripts/Make.defs | 36 +-
boards/arm/tiva/tm4c123g-launchpad/src/.gitignore | 2 -
boards/arm/tiva/tm4c123g-launchpad/src/Makefile | 3 +-
.../arm/tiva/tm4c123g-launchpad/src/tm4c_appinit.c | 2 +-
.../tiva/tm4c123g-launchpad/src/tm4c_autoleds.c | 4 +-
boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c | 4 +-
boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c | 2 +-
boards/arm/tiva/tm4c1294-launchpad/README.txt | 2 +-
.../arm/tiva/tm4c1294-launchpad/scripts/Make.defs | 36 +-
boards/arm/tiva/tm4c1294-launchpad/src/.gitignore | 2 -
boards/arm/tiva/tm4c1294-launchpad/src/Makefile | 3 +-
.../arm/tiva/tm4c1294-launchpad/src/tm4c_appinit.c | 2 +-
boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c | 4 +-
.../tiva/tm4c1294-launchpad/src/tm4c_ethernet.c | 2 +-
boards/arm/tms570/drivers/Kconfig | 4 -
.../arm/tms570/launchxl-tms57004/scripts/Make.defs | 53 +-
boards/arm/tms570/launchxl-tms57004/src/Makefile | 3 +-
.../tms570/launchxl-tms57004/src/tms570_appinit.c | 2 +-
.../tms570/launchxl-tms57004/src/tms570_buttons.c | 2 +-
.../tms570/tms570ls31x-usb-kit/scripts/Make.defs | 53 +-
boards/arm/tms570/tms570ls31x-usb-kit/src/Makefile | 3 +-
.../tms570ls31x-usb-kit/src/tms570_appinit.c | 2 +-
.../tms570ls31x-usb-kit/src/tms570_buttons.c | 2 +-
.../tms570/tms570ls31x-usb-kit/src/tms570_spi.c | 2 +-
boards/arm/xmc4/drivers/Kconfig | 4 -
boards/arm/xmc4/xmc4500-relax/scripts/Make.defs | 38 +-
boards/arm/xmc4/xmc4500-relax/src/Makefile | 3 +-
boards/arm/xmc4/xmc4500-relax/src/xmc4_appinit.c | 2 +-
boards/arm/xmc4/xmc4500-relax/src/xmc4_ostest.c | 6 +-
boards/arm/xmc4/xmc4700-relax/scripts/Make.defs | 38 +-
boards/arm/xmc4/xmc4700-relax/src/Makefile | 3 +-
boards/arm/xmc4/xmc4700-relax/src/xmc4_appinit.c | 2 +-
boards/arm/xmc4/xmc4700-relax/src/xmc4_ostest.c | 6 +-
boards/avr/at32uc3/avr32dev1/README.txt | 4 +-
boards/avr/at32uc3/avr32dev1/scripts/Make.defs | 35 +-
boards/avr/at32uc3/avr32dev1/src/.gitignore | 2 -
boards/avr/at32uc3/avr32dev1/src/Makefile | 3 +-
boards/avr/at32uc3/drivers/Kconfig | 4 -
boards/avr/at90usb/drivers/Kconfig | 4 -
boards/avr/at90usb/micropendous3/README.txt | 4 +-
boards/avr/at90usb/micropendous3/scripts/Make.defs | 37 +-
boards/avr/at90usb/micropendous3/src/.gitignore | 2 -
boards/avr/at90usb/micropendous3/src/Makefile | 3 +-
boards/avr/at90usb/teensy-2.0/README.txt | 4 +-
.../at90usb/teensy-2.0/configs/usbmsc/defconfig | 2 +-
boards/avr/at90usb/teensy-2.0/scripts/Make.defs | 37 +-
boards/avr/at90usb/teensy-2.0/src/.gitignore | 2 -
boards/avr/at90usb/teensy-2.0/src/Makefile | 3 +-
.../avr/at90usb/teensy-2.0/src/at90usb_appinit.c | 2 +-
boards/avr/atmega/amber/README.txt | 4 +-
boards/avr/atmega/amber/scripts/Make.defs | 37 +-
boards/avr/atmega/amber/src/.gitignore | 2 -
boards/avr/atmega/amber/src/Makefile | 3 +-
.../avr/atmega/arduino-mega2560/scripts/Make.defs | 34 +-
boards/avr/atmega/arduino-mega2560/src/Makefile | 21 +-
boards/avr/atmega/drivers/Kconfig | 4 -
boards/avr/atmega/moteino-mega/README.txt | 2 +-
boards/avr/atmega/moteino-mega/scripts/Make.defs | 37 +-
boards/avr/atmega/moteino-mega/src/.gitignore | 2 -
boards/avr/atmega/moteino-mega/src/Makefile | 3 +-
boards/hc/m9s12/demo9s12ne64/scripts/Make.defs | 35 +-
boards/hc/m9s12/demo9s12ne64/src/.gitignore | 2 -
boards/hc/m9s12/demo9s12ne64/src/Makefile | 3 +-
boards/hc/m9s12/demo9s12ne64/src/m9s12_appinit.c | 2 +-
boards/hc/m9s12/drivers/Kconfig | 4 -
boards/hc/m9s12/ne64badge/scripts/Make.defs | 35 +-
boards/hc/m9s12/ne64badge/src/.gitignore | 2 -
boards/hc/m9s12/ne64badge/src/Makefile | 3 +-
boards/hc/m9s12/ne64badge/src/m9s12_appinit.c | 2 +-
boards/mips/pic32mx/drivers/Kconfig | 4 -
boards/mips/pic32mx/mirtoo/README.txt | 4 +-
boards/mips/pic32mx/mirtoo/scripts/Make.defs | 38 +-
boards/mips/pic32mx/mirtoo/src/.gitignore | 2 -
boards/mips/pic32mx/mirtoo/src/Makefile | 3 +-
boards/mips/pic32mx/mirtoo/src/pic32_appinit.c | 2 +-
boards/mips/pic32mx/mirtoo/src/pic32_boot.c | 6 +-
boards/mips/pic32mx/mirtoo/src/pic32_spi2.c | 4 +-
.../pic32mx/pic32mx-starterkit/scripts/Make.defs | 39 +-
.../mips/pic32mx/pic32mx-starterkit/src/.gitignore | 2 -
.../mips/pic32mx/pic32mx-starterkit/src/Makefile | 3 +-
.../pic32mx-starterkit/src/pic32mx_appinit.c | 2 +-
.../pic32mx/pic32mx-starterkit/src/pic32mx_boot.c | 4 +-
.../pic32mx/pic32mx-starterkit/src/pic32mx_leds.c | 6 +-
.../pic32mx/pic32mx-starterkit/src/pic32mx_spi.c | 2 +-
boards/mips/pic32mx/pic32mx7mmb/README.txt | 2 +-
boards/mips/pic32mx/pic32mx7mmb/scripts/Make.defs | 39 +-
boards/mips/pic32mx/pic32mx7mmb/src/.gitignore | 2 -
boards/mips/pic32mx/pic32mx7mmb/src/Makefile | 3 +-
.../mips/pic32mx/pic32mx7mmb/src/pic32_appinit.c | 2 +-
boards/mips/pic32mx/pic32mx7mmb/src/pic32_boot.c | 17 +-
.../mips/pic32mx/pic32mx7mmb/src/pic32_mio283qt2.c | 13 +-
boards/mips/pic32mx/pic32mx7mmb/src/pic32_spi.c | 21 +-
.../pic32mx/pic32mx7mmb/src/pic32_touchscreen.c | 18 +-
boards/mips/pic32mx/sure-pic32mx/scripts/Make.defs | 39 +-
boards/mips/pic32mx/sure-pic32mx/src/.gitignore | 2 -
boards/mips/pic32mx/sure-pic32mx/src/Makefile | 3 +-
.../pic32mx/sure-pic32mx/src/pic32mx_appinit.c | 2 +-
.../pic32mx/sure-pic32mx/src/pic32mx_autoleds.c | 6 +-
.../mips/pic32mx/sure-pic32mx/src/pic32mx_boot.c | 4 +-
.../pic32mx/sure-pic32mx/src/pic32mx_buttons.c | 6 +-
.../pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c | 6 +-
boards/mips/pic32mx/sure-pic32mx/src/pic32mx_spi.c | 2 +-
boards/mips/pic32mx/ubw32/scripts/Make.defs | 39 +-
boards/mips/pic32mx/ubw32/src/.gitignore | 2 -
boards/mips/pic32mx/ubw32/src/Makefile | 3 +-
boards/mips/pic32mx/ubw32/src/pic32_appinit.c | 2 +-
boards/mips/pic32mx/ubw32/src/pic32_boot.c | 7 +-
boards/mips/pic32mx/ubw32/src/pic32_buttons.c | 16 +-
boards/mips/pic32mx/ubw32/src/pic32_leds.c | 4 +-
boards/mips/pic32mz/drivers/Kconfig | 4 -
.../pic32mz/flipnclick-pic32mz/scripts/Make.defs | 39 +-
.../mips/pic32mz/flipnclick-pic32mz/src/.gitignore | 2 -
.../mips/pic32mz/flipnclick-pic32mz/src/Makefile | 3 +-
.../flipnclick-pic32mz/src/pic32mz_appinit.c | 2 +-
.../flipnclick-pic32mz/src/pic32mz_autoleds.c | 6 +-
.../flipnclick-pic32mz/src/pic32mz_buttons.c | 2 +-
.../pic32mz/flipnclick-pic32mz/src/pic32mz_spi.c | 4 +-
.../flipnclick-pic32mz/src/pic32mz_ssd1306.c | 4 +-
.../flipnclick-pic32mz/src/pic32mz_userleds.c | 6 +-
.../pic32mz/pic32mz-starterkit/scripts/Make.defs | 39 +-
.../mips/pic32mz/pic32mz-starterkit/src/.gitignore | 2 -
.../mips/pic32mz/pic32mz-starterkit/src/Makefile | 3 +-
.../pic32mz-starterkit/src/pic32mz_appinit.c | 2 +-
.../pic32mz-starterkit/src/pic32mz_autoleds.c | 6 +-
.../pic32mz-starterkit/src/pic32mz_buttons.c | 2 +-
.../pic32mz/pic32mz-starterkit/src/pic32mz_spi.c | 2 +-
.../pic32mz-starterkit/src/pic32mz_userleds.c | 6 +-
boards/misoc/lm32/drivers/Kconfig | 4 -
boards/misoc/lm32/misoc/scripts/Make.defs | 38 +-
boards/misoc/lm32/misoc/src/.gitignore | 2 -
boards/misoc/lm32/misoc/src/Makefile | 3 +-
boards/or1k/mor1kx/drivers/Kconfig | 4 -
boards/or1k/mor1kx/or1k/scripts/Make.defs | 47 +-
boards/or1k/mor1kx/or1k/src/.gitignore | 11 -
boards/or1k/mor1kx/or1k/src/Makefile | 3 +-
boards/or1k/mor1kx/or1k/src/or1k_appinit.c | 2 +-
boards/renesas/m16c/drivers/Kconfig | 4 -
.../renesas/m16c/skp16c26/configs/ostest/defconfig | 4 +-
boards/renesas/m16c/skp16c26/scripts/Make.defs | 19 +-
boards/renesas/m16c/skp16c26/src/.gitignore | 2 -
boards/renesas/m16c/skp16c26/src/Makefile | 8 +-
boards/renesas/rx65n/drivers/Kconfig | 4 -
boards/renesas/rx65n/rx65n-grrose/README.txt | 33 +-
.../rx65n/rx65n-grrose/configs/ipv6/defconfig | 126 +
boards/renesas/rx65n/rx65n-grrose/include/board.h | 12 +-
.../rx65n/rx65n-grrose/include/rx65n_gpio.h | 232 +
.../renesas/rx65n/rx65n-grrose/scripts/Make.defs | 66 +-
boards/renesas/rx65n/rx65n-grrose/src/Makefile | 17 +-
.../renesas/rx65n/rx65n-grrose/src/rx65n_appinit.c | 2 +-
boards/renesas/rx65n/rx65n-grrose/src/rx65n_gpio.c | 358 +
boards/renesas/rx65n/rx65n-rsk1mb/include/board.h | 55 +-
.../rx65n/rx65n-rsk1mb/include/rx65n_gpio.h | 97 +
.../renesas/rx65n/rx65n-rsk1mb/scripts/Make.defs | 70 +-
boards/renesas/rx65n/rx65n-rsk1mb/src/Makefile | 14 +-
boards/renesas/rx65n/rx65n-rsk1mb/src/rx65n_gpio.c | 127 +
boards/renesas/rx65n/rx65n-rsk2mb/README.txt | 28 +
.../rx65n/rx65n-rsk2mb/configs/ipv6/defconfig | 110 +
boards/renesas/rx65n/rx65n-rsk2mb/include/board.h | 12 +-
.../rx65n/rx65n-rsk2mb/include/rx65n_gpio.h | 177 +
.../renesas/rx65n/rx65n-rsk2mb/scripts/Make.defs | 70 +-
boards/renesas/rx65n/rx65n-rsk2mb/src/Makefile | 17 +-
.../renesas/rx65n/rx65n-rsk2mb/src/rx65n_appinit.c | 2 +-
boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_gpio.c | 321 +
boards/renesas/rx65n/rx65n/scripts/Make.defs | 66 +-
boards/renesas/rx65n/rx65n/src/Makefile | 15 +-
boards/renesas/sh1/drivers/Kconfig | 4 -
boards/renesas/sh1/us7032evb1/scripts/Make.defs | 60 +-
boards/renesas/sh1/us7032evb1/shterm/.gitignore | 1 -
boards/renesas/sh1/us7032evb1/src/.gitignore | 2 -
boards/renesas/sh1/us7032evb1/src/Makefile | 13 +-
boards/risc-v/fe310/drivers/Kconfig | 4 -
boards/risc-v/fe310/hifive1-revb/scripts/Make.defs | 36 +-
boards/risc-v/fe310/hifive1-revb/src/Makefile | 2 +-
.../risc-v/fe310/hifive1-revb/src/fe310_appinit.c | 2 +-
boards/risc-v/gap8/drivers/Kconfig | 4 -
boards/risc-v/gap8/gapuino/scripts/Make.defs | 36 +-
boards/risc-v/gap8/gapuino/src/Makefile | 2 +-
boards/risc-v/gap8/gapuino/src/gapuino_appinit.c | 2 +-
boards/risc-v/k210/drivers/Kconfig | 4 -
boards/risc-v/k210/maix-bit/README.txt | 11 +-
boards/risc-v/k210/maix-bit/configs/elf/defconfig | 1 -
boards/risc-v/k210/maix-bit/configs/knsh/defconfig | 59 +
.../risc-v/k210/maix-bit/configs/module/defconfig | 1 -
.../k210/maix-bit/configs/posix_spawn/defconfig | 1 -
boards/risc-v/k210/maix-bit/kernel/.gitignore | 1 -
boards/risc-v/k210/maix-bit/kernel/Makefile | 16 +-
boards/risc-v/k210/maix-bit/scripts/Make.defs | 45 +-
boards/risc-v/k210/maix-bit/src/Makefile | 2 +-
boards/risc-v/k210/maix-bit/src/k210_appinit.c | 2 +-
boards/risc-v/litex/arty_a7/scripts/Make.defs | 36 +-
boards/risc-v/litex/arty_a7/src/Makefile | 2 +-
boards/risc-v/litex/arty_a7/src/litex_appinit.c | 2 +-
boards/risc-v/litex/drivers/Kconfig | 4 -
boards/risc-v/nr5m100/drivers/Kconfig | 4 -
.../nr5m100/nr5m100-nexys4/scripts/Make.defs | 36 +-
boards/risc-v/nr5m100/nr5m100-nexys4/src/Makefile | 2 +-
.../nr5m100/nr5m100-nexys4/src/nr5_appinit.c | 2 +-
boards/sim/sim/drivers/Kconfig | 4 -
boards/sim/sim/sim/configs/cxxtest/Make.defs | 38 +-
boards/sim/sim/sim/configs/module/defconfig | 1 -
boards/sim/sim/sim/configs/rpproxy/defconfig | 2 +-
boards/sim/sim/sim/configs/rpserver/defconfig | 2 +-
boards/sim/sim/sim/scripts/Make.defs | 44 +-
boards/sim/sim/sim/src/.gitignore | 2 -
boards/sim/sim/sim/src/Makefile | 1 -
boards/sim/sim/sim/src/sim_appinit.c | 2 +-
boards/sim/sim/sim/src/sim_bringup.c | 55 +-
boards/sim/sim/sim/src/sim_touchscreen.c | 44 +-
boards/x86/qemu/drivers/Kconfig | 4 -
boards/x86/qemu/qemu-i486/configs/nsh/defconfig | 15 +-
boards/x86/qemu/qemu-i486/scripts/Make.defs | 36 +-
boards/x86/qemu/qemu-i486/src/.gitignore | 2 -
boards/x86/qemu/qemu-i486/src/Makefile | 3 +-
boards/x86/qemu/qemu-i486/src/qemu_appinit.c | 19 +-
boards/x86_64/intel64/drivers/Kconfig | 4 -
boards/x86_64/intel64/qemu-intel64/README.txt | 4 +-
.../intel64/qemu-intel64/configs/nsh/defconfig | 60 +
.../x86_64/intel64/qemu-intel64/scripts/Make.defs | 44 +-
boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld | 12 +-
boards/x86_64/intel64/qemu-intel64/src/.gitignore | 2 -
boards/x86_64/intel64/qemu-intel64/src/Makefile | 5 +-
.../x86_64/intel64/qemu-intel64/src/qemu_appinit.c | 15 +-
.../x86_64/intel64/qemu-intel64/src/qemu_bringup.c | 61 +
.../x86_64/intel64/qemu-intel64/src/qemu_intel64.h | 2 +
boards/xtensa/esp32/drivers/Kconfig | 4 -
boards/xtensa/esp32/esp32-core/scripts/Make.defs | 54 +-
boards/xtensa/esp32/esp32-core/src/Makefile | 6 +-
boards/xtensa/esp32/esp32-core/src/esp32_appinit.c | 2 +-
boards/z16/z16f/drivers/Kconfig | 4 -
boards/z16/z16f/z16f2800100zcog/README.txt | 3 +
.../z16f/z16f2800100zcog/configs/nsh/.gitignore | 4 -
.../z16f/z16f2800100zcog/configs/ostest/.gitignore | 4 -
boards/z16/z16f/z16f2800100zcog/scripts/Make.defs | 77 +-
boards/z16/z16f/z16f2800100zcog/src/.gitignore | 3 -
boards/z16/z16f/z16f2800100zcog/src/Makefile | 46 +-
boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c | 71 +
boards/z16/z16f/z16f2800100zcog/src/z16f_boot.c | 77 +-
boards/z16/z16f/z16f2800100zcog/src/z16f_leds.c | 57 +-
boards/z80/ez80/drivers/Kconfig | 4 -
.../ez80/ez80f910200kitg/configs/ostest/.gitignore | 5 -
boards/z80/ez80/ez80f910200kitg/scripts/Make.defs | 37 +-
boards/z80/ez80/ez80f910200kitg/src/.gitignore | 3 -
boards/z80/ez80/ez80f910200kitg/src/Makefile | 3 +-
.../ez80/ez80f910200zco/configs/dhcpd/.gitignore | 6 -
.../ez80/ez80f910200zco/configs/dhcpd/defconfig | 1 -
.../ez80/ez80f910200zco/configs/httpd/.gitignore | 6 -
.../ez80/ez80f910200zco/configs/httpd/defconfig | 2 +-
.../ez80/ez80f910200zco/configs/nettest/.gitignore | 6 -
.../z80/ez80/ez80f910200zco/configs/nsh/.gitignore | 6 -
.../ez80/ez80f910200zco/configs/poll/.gitignore | 6 -
.../z80/ez80/ez80f910200zco/configs/poll/defconfig | 2 +-
boards/z80/ez80/ez80f910200zco/scripts/Make.defs | 37 +-
boards/z80/ez80/ez80f910200zco/src/.gitignore | 3 -
boards/z80/ez80/ez80f910200zco/src/Makefile | 3 +-
boards/z80/ez80/ez80f910200zco/src/ez80_buttons.c | 59 +-
.../ez80/makerlisp/configs/nsh_flash/.gitignore | 6 -
.../z80/ez80/makerlisp/configs/nsh_ram/.gitignore | 6 -
.../z80/ez80/makerlisp/configs/sdboot/.gitignore | 6 -
boards/z80/ez80/makerlisp/scripts/Make.defs | 37 +-
boards/z80/ez80/makerlisp/src/.gitignore | 10 -
boards/z80/ez80/makerlisp/src/Makefile | 3 +-
boards/z80/ez80/makerlisp/src/ez80_appinit.c | 2 +-
boards/z80/ez80/z20x/configs/hello/.gitignore | 6 -
boards/z80/ez80/z20x/configs/nsh/.gitignore | 6 -
boards/z80/ez80/z20x/configs/sdboot/.gitignore | 6 -
boards/z80/ez80/z20x/configs/w25boot/.gitignore | 6 -
boards/z80/ez80/z20x/scripts/Make.defs | 37 +-
boards/z80/ez80/z20x/src/.gitignore | 10 -
boards/z80/ez80/z20x/src/Makefile | 3 +-
boards/z80/ez80/z20x/src/ez80_appinit.c | 2 +-
boards/z80/z180/drivers/Kconfig | 4 -
boards/z80/z180/p112/scripts/Make.defs | 54 +-
boards/z80/z180/p112/src/.gitignore | 13 +-
boards/z80/z180/p112/src/Makefile | 6 +-
boards/z80/z8/drivers/Kconfig | 4 -
.../z8/z8encore000zco/configs/ostest/.gitignore | 5 -
boards/z80/z8/z8encore000zco/scripts/Make.defs | 36 +-
boards/z80/z8/z8encore000zco/src/.gitignore | 3 -
boards/z80/z8/z8encore000zco/src/Makefile | 3 +-
.../z8/z8f64200100kit/configs/ostest/.gitignore | 5 -
boards/z80/z8/z8f64200100kit/scripts/Make.defs | 36 +-
boards/z80/z8/z8f64200100kit/src/.gitignore | 3 -
boards/z80/z8/z8f64200100kit/src/Makefile | 3 +-
boards/z80/z80/z80sim/scripts/Make.defs | 57 +-
boards/z80/z80/z80sim/src/.gitignore | 13 +-
boards/z80/z80/z80sim/src/Makefile | 3 +-
boards/z80/z80/z80sim/src/z80_irq.c | 41 +-
boards/z80/z80/z80sim/src/z80_serial.c | 57 +-
crypto/Makefile | 7 +-
drivers/.gitignore | 10 -
drivers/1wire/1wire.c | 6 +-
drivers/1wire/Make.defs | 2 +-
drivers/Makefile | 82 +-
drivers/analog/Make.defs | 8 +-
drivers/analog/adc.c | 8 +-
drivers/analog/comp.c | 8 +-
drivers/analog/dac.c | 12 +-
drivers/audio/cxd56.c | 1614 +-
drivers/audio/cxd56.h | 40 +-
drivers/bch/Make.defs | 2 +-
drivers/can/Make.defs | 2 +-
drivers/can/can.c | 8 +-
drivers/contactless/Make.defs | 2 +-
drivers/crypto/Make.defs | 2 +-
{boards/z80/z80/drivers => drivers/dummy}/Kconfig | 0
drivers/i2c/Make.defs | 2 +-
drivers/input/Make.defs | 2 +-
drivers/input/ads7843e.c | 6 +-
drivers/input/button_lower.c | 3 +-
drivers/input/ft5x06.c | 2 +-
drivers/input/max11802.c | 10 +-
drivers/input/mxt.c | 2 +-
drivers/input/tsc2007.c | 273 +-
drivers/ioexpander/Make.defs | 4 +-
drivers/lcd/Make.defs | 6 +-
drivers/lcd/ft80x.c | 8 +-
drivers/leds/Make.defs | 5 -
drivers/leds/userled_lower.c | 6 +-
drivers/loop/Make.defs | 2 +-
drivers/mmcsd/Make.defs | 2 +-
drivers/mmcsd/mmcsd_sdio.c | 16 +-
drivers/mmcsd/mmcsd_spi.c | 4 +-
drivers/modem/Make.defs | 4 +-
drivers/modem/altair/Make.defs | 2 +-
drivers/modem/altair/altmdm_sys.c | 16 +-
drivers/mtd/filemtd.c | 4 +-
drivers/mtd/sst39vf.c | 181 +-
drivers/net/enc28j60.c | 77 +-
drivers/net/encx24j600.c | 94 +-
drivers/net/rpmsgdrv.c | 53 +-
drivers/net/slip.c | 6 +-
drivers/net/telnet.c | 4 +-
drivers/net/tun.c | 8 +-
drivers/pipes/fifo.c | 26 +-
drivers/pipes/pipe.c | 22 +-
drivers/pipes/pipe_common.c | 54 +-
drivers/power/Make.defs | 18 +-
drivers/power/activity_governor.c | 57 +-
drivers/power/bq2425x.c | 20 +-
drivers/power/bq2429x.c | 58 +-
drivers/power/bq769x0.c | 105 +-
drivers/power/max1704x.c | 81 +-
drivers/power/mcp73871.c | 9 +-
drivers/rf/Make.defs | 3 -
drivers/rptun/Make.defs | 2 +-
drivers/rptun/rptun.c | 15 +-
drivers/sensors/Kconfig | 29 +
drivers/sensors/Make.defs | 8 +-
drivers/sensors/hc_sr04.c | 4 +-
drivers/sensors/hdc1008.c | 1008 +
drivers/sensors/l3gd20.c | 51 +-
drivers/sensors/lis3dh.c | 16 +-
drivers/sensors/lis3dsh.c | 108 +-
drivers/serial/pty.c | 27 +-
drivers/serial/serial.c | 12 +-
drivers/spi/Make.defs | 2 +-
drivers/syslog/ramlog.c | 75 +-
drivers/syslog/syslog_channel.c | 15 +-
drivers/syslog/syslog_flush.c | 8 +-
drivers/syslog/syslog_initialize.c | 2 +-
drivers/syslog/syslog_rpmsg.c | 52 +-
drivers/syslog/vsyslog.c | 7 +-
drivers/timers/Make.defs | 3 -
drivers/timers/cs2100-cp.c | 28 +-
drivers/timers/pwm.c | 14 +-
drivers/timers/rpmsg_rtc.c | 31 +-
drivers/usbdev/Make.defs | 2 +-
drivers/usbdev/usbdev_trace.c | 14 +-
drivers/usbdev/usbmsc.c | 4 +-
drivers/usbhost/Kconfig | 92 +
drivers/usbhost/Make.defs | 6 +-
drivers/usbhost/usbhost_ft232r.c | 2804 ++
drivers/usbhost/usbhost_hidkbd.c | 4 +-
drivers/usbhost/usbhost_hidmouse.c | 4 +-
drivers/usbhost/usbhost_max3421e.c | 62 +-
drivers/usbhost/usbhost_xboxcontroller.c | 36 +-
drivers/usbmisc/Make.defs | 2 +-
drivers/usbmonitor/Make.defs | 2 +-
drivers/usbmonitor/usbmonitor.c | 7 +-
drivers/video/Make.defs | 2 +-
drivers/video/video.c | 52 +-
drivers/wireless/Kconfig | 4 +
drivers/wireless/Make.defs | 12 +-
drivers/wireless/bluetooth/Make.defs | 2 +-
drivers/wireless/bluetooth/bt_uart_bcm4343x.c | 6 +-
drivers/wireless/bluetooth/bt_uart_shim.c | 23 +-
drivers/wireless/gs2200m.c | 384 +-
drivers/wireless/ieee80211/Make.defs | 2 +-
drivers/wireless/ieee80211/bcm43xxx/Make.defs | 2 +-
drivers/wireless/ieee80211/bcm43xxx/bcmf_driver.c | 100 +-
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c | 23 +-
drivers/wireless/ieee802154/Make.defs | 8 +-
drivers/wireless/ieee802154/at86rf23x/Make.defs | 2 +-
drivers/wireless/ieee802154/mrf24j40/Make.defs | 2 +-
drivers/wireless/ieee802154/xbee/Make.defs | 2 +-
drivers/wireless/ieee802154/xbee/xbee.c | 290 +-
drivers/wireless/ieee802154/xbee/xbee_netdev.c | 123 +-
drivers/wireless/lpwan/Make.defs | 2 +-
drivers/wireless/lpwan/sx127x/Make.defs | 2 +-
drivers/wireless/nrf24l01.c | 19 +-
drivers/wireless/spirit/Make.defs | 6 +-
drivers/wireless/spirit/drivers/Make.defs | 2 +-
drivers/wireless/spirit/include/Make.defs | 2 +-
drivers/wireless/spirit/lib/spirit_spi.c | 8 +-
fs/.gitignore | 10 -
fs/Makefile | 15 +-
fs/aio/aio_initialize.c | 2 +-
fs/aio/aioc_contain.c | 6 +-
fs/binfs/Make.defs | 1 -
fs/cromfs/Make.defs | 1 -
fs/fat/Make.defs | 1 -
fs/fat/fs_fat32.c | 86 +-
fs/fat/fs_fat32.h | 40 +-
fs/fat/fs_fat32attrib.c | 39 +-
fs/fat/fs_fat32dirent.c | 343 +-
fs/fat/fs_fat32util.c | 78 +-
fs/hostfs/Make.defs | 5 -
fs/hostfs/hostfs_rpmsg.c | 10 +-
fs/hostfs/hostfs_rpmsg_server.c | 50 +-
fs/inode/fs_filedetach.c | 2 +-
fs/inode/fs_files.c | 8 +-
fs/inode/inode.h | 10 +
fs/littlefs/.gitignore | 3 +
fs/littlefs/DESIGN.md | 1225 -
fs/littlefs/Make.defs | 79 +-
fs/littlefs/README.md | 220 -
fs/littlefs/SPEC.md | 370 -
fs/littlefs/lfs.c | 3464 ---
fs/littlefs/lfs.h | 673 -
fs/littlefs/lfs_util.c | 83 -
fs/littlefs/lfs_util.h | 275 -
fs/littlefs/lfs_vfs.c | 145 +-
fs/mmap/Make.defs | 1 -
fs/mount/fs_mount.c | 91 +-
fs/mount/fs_umount2.c | 67 +-
fs/mqueue/mq_close.c | 66 +-
fs/mqueue/mq_open.c | 128 +-
fs/mqueue/mq_unlink.c | 66 +-
fs/nfs/Make.defs | 6 -
fs/nfs/nfs_proto.h | 295 +-
fs/nfs/nfs_util.c | 68 +-
fs/nxffs/Make.defs | 2 -
fs/procfs/Make.defs | 1 -
fs/procfs/fs_procfs.c | 54 +-
fs/procfs/fs_procfsproc.c | 156 +-
fs/procfs/fs_procfsuptime.c | 16 +-
fs/romfs/Make.defs | 1 -
fs/smartfs/Make.defs | 1 -
fs/spiffs/Make.defs | 3 +-
fs/spiffs/src/spiffs_cache.h | 14 +-
fs/spiffs/src/spiffs_check.h | 24 +-
fs/spiffs/src/spiffs_gc.h | 18 +-
fs/spiffs/src/spiffs_mtd.h | 14 +-
fs/tmpfs/Make.defs | 1 -
fs/tmpfs/fs_tmpfs.c | 12 +-
fs/unionfs/Make.defs | 1 -
fs/vfs/fs_close.c | 96 +-
fs/vfs/fs_dup.c | 59 +-
fs/vfs/fs_dup2.c | 76 +-
fs/vfs/fs_dupfd.c | 29 +-
fs/vfs/fs_dupfd2.c | 33 +-
fs/vfs/fs_fcntl.c | 110 +-
fs/vfs/fs_fdopen.c | 79 +-
fs/vfs/fs_fstat.c | 160 +-
fs/vfs/fs_getfilep.c | 2 +-
fs/vfs/fs_ioctl.c | 152 +-
fs/vfs/fs_lseek.c | 75 +-
fs/vfs/fs_poll.c | 109 +-
fs/vfs/fs_stat.c | 173 +-
graphics/.gitignore | 10 -
graphics/Kconfig | 9 +-
graphics/Makefile | 17 +-
graphics/README.txt | 18 +-
graphics/nxbe/Make.defs | 2 +-
graphics/nxglib/Make.defs | 2 +-
graphics/nxglib/Makefile.cursor | 12 +-
graphics/nxglib/Makefile.devblit | 12 +-
graphics/nxglib/Makefile.pwfb | 12 +-
graphics/nxmu/.gitignore | 10 -
graphics/nxmu/Make.defs | 2 +-
graphics/nxterm/Make.defs | 2 +-
graphics/nxterm/nxterm_register.c | 44 +-
graphics/vnc/client/Make.defs | 2 +-
graphics/vnc/server/Kconfig | 4 +-
graphics/vnc/server/Make.defs | 2 +-
graphics/vnc/server/vnc_server.h | 27 +-
include/.gitignore | 2 -
include/aio.h | 9 +-
include/cxx/csched | 43 +-
include/debug.h | 848 +-
include/dsp.h | 8 -
include/elf.h | 2 +-
include/elf32.h | 1 +
include/elf64.h | 1 +
include/errno.h | 145 +-
include/fcntl.h | 2 +-
include/mqueue.h | 4 +-
include/nuttx/arch.h | 59 +-
include/nuttx/binfmt/binfmt.h | 3 +-
include/nuttx/board.h | 2 +-
include/nuttx/clock.h | 77 +-
include/nuttx/drivers/drivers.h | 32 +-
include/nuttx/fs/fs.h | 414 +-
include/nuttx/fs/hostfs.h | 32 +-
include/nuttx/kmalloc.h | 26 +-
include/nuttx/lib/builtin.h | 12 +-
include/nuttx/lib/regex.h | 2 +-
include/nuttx/mm/mm.h | 17 +-
include/nuttx/mm/shm.h | 21 +-
include/nuttx/mqueue.h | 91 +-
include/nuttx/mutex.h | 9 +-
include/nuttx/net/dns.h | 12 +-
include/nuttx/net/net.h | 118 +-
include/nuttx/power/bq2429x.h | 77 +-
include/nuttx/rptun/rptun.h | 5 +-
include/nuttx/sched.h | 294 +-
include/nuttx/semaphore.h | 24 +-
include/nuttx/sensors/hdc1008.h | 95 +
include/nuttx/sensors/l3gd20.h | 155 +-
include/nuttx/sensors/lis3dsh.h | 72 +-
include/nuttx/signal.h | 75 +-
include/nuttx/spawn.h | 2 +-
include/nuttx/spi/slave.h | 86 +-
include/nuttx/syslog/syslog_rpmsg.h | 3 +
include/nuttx/tls.h | 171 +-
include/nuttx/usb/usbhost.h | 157 +-
include/nuttx/userspace.h | 16 +-
include/nuttx/video/video.h | 23 +-
include/nuttx/wireless/gs2200m.h | 8 +
include/nuttx/wireless/ioctl.h | 59 +-
include/nuttx/wqueue.h | 33 +-
include/pthread.h | 20 +-
include/sched.h | 51 +-
include/spawn.h | 45 +-
include/stddef.h | 20 +
include/stdint.h | 2 +-
include/stdio.h | 20 +-
include/stdlib.h | 63 +-
include/sys/boardctl.h | 2 +-
include/sys/ioctl.h | 4 -
include/sys/mount.h | 2 +-
include/sys/socket.h | 43 +-
include/sys/stat.h | 75 +-
include/sys/syscall.h | 537 +-
include/sys/syscall_lookup.h | 381 +
include/syslog.h | 47 +-
include/threads.h | 26 +-
include/time.h | 15 +
include/unistd.h | 4 +-
include/wchar.h | 23 +-
include/wctype.h | 1 -
libs/libc/.gitignore | 5 -
libs/libc/Makefile | 81 +-
libs/libc/README.txt | 1 +
libs/libc/aio/aio_suspend.c | 2 +-
libs/libc/aio/lio_listio.c | 20 +-
libs/libc/bin/.gitignore | 8 -
libs/libc/bin/Makefile | 2 +-
libs/libc/builtin/Kconfig | 2 +-
libs/libc/builtin/lib_builtin_forindex.c | 4 -
libs/libc/builtin/lib_builtin_getname.c | 4 -
libs/libc/builtin/lib_builtin_isavail.c | 4 -
libs/libc/dlfcn/Kconfig | 3 -
libs/libc/dlfcn/lib_dlsymtab.c | 18 +-
libs/libc/errno/Make.defs | 26 +
libs/libc/errno/lib_errno.c | 61 +
libs/libc/kbin/.gitignore | 8 -
libs/libc/kbin/Makefile | 2 +-
libs/libc/libc.csv | 187 +-
libs/libc/libc.h | 15 +-
libs/libc/machine/Kconfig | 5 +
libs/libc/machine/Make.defs | 10 +-
libs/libc/machine/arm/Make.defs | 16 +-
libs/libc/machine/risc-v/Make.defs | 2 +-
libs/libc/math.csv | 5 +-
libs/libc/misc/Kconfig | 43 -
libs/libc/misc/Make.defs | 4 -
libs/libc/misc/lib_ioctl.c | 117 -
libs/libc/misc/lib_match.c | 23 +-
libs/libc/misc/lib_mkfifo.c | 12 +-
libs/libc/misc/lib_stream.c | 25 +-
libs/libc/misc/lib_utsname.c | 5 +-
libs/libc/netdb/Kconfig | 25 +-
libs/libc/netdb/Make.defs | 3 +-
libs/libc/netdb/lib_dns.h | 12 +-
libs/libc/netdb/lib_dnsaddserver.c | 33 +-
libs/libc/netdb/lib_dnsdefaultserver.c | 66 +
libs/libc/netdb/lib_dnsforeach.c | 43 +-
libs/libc/netdb/lib_dnsinit.c | 14 +-
libs/libc/netdb/lib_getaddrinfo.c | 5 +-
libs/libc/netdb/lib_gethostentbynamer.c | 23 +-
libs/libc/netdb/lib_netdb.c | 2 +-
libs/libc/netdb/lib_parsehostfile.c | 2 +-
libs/libc/pthread/Make.defs | 48 +-
libs/libc/pthread/pthread_attr_getschedpolicy.c | 3 +-
libs/libc/pthread/pthread_attr_init.c | 3 +-
libs/libc/pthread/pthread_get_stackaddr_np.c | 78 +
libs/libc/pthread/pthread_get_stacksize_np.c | 80 +
libs/libc/pthread/pthread_getspecific.c | 63 +
libs/libc/pthread/pthread_keycreate.c | 99 +
libs/libc/pthread/pthread_keydelete.c | 59 +
libs/libc/pthread/pthread_mutexattr_gettype.c | 3 +-
libs/libc/pthread/pthread_mutexattr_settype.c | 5 +-
libs/libc/pthread/pthread_setspecific.c | 80 +
libs/libc/pthread/pthread_startup.c | 5 +-
libs/libc/semaphore/sem_getvalue.c | 8 +-
libs/libc/semaphore/sem_setprotocol.c | 8 +-
libs/libc/signal/sig_addset.c | 47 +-
libs/libc/signal/sig_delset.c | 47 +-
libs/libc/signal/sig_ismember.c | 54 +-
libs/libc/spawn/Make.defs | 5 +-
libs/libc/spawn/lib_task_spawn.c | 6 +-
libs/libc/stdio/Kconfig | 9 -
libs/libc/stdio/lib_asprintf.c | 6 +-
libs/libc/stdio/lib_clearerr.c | 2 +-
libs/libc/stdio/lib_fflush.c | 2 +-
libs/libc/stdio/lib_fgets.c | 2 +-
libs/libc/stdio/lib_fopen.c | 70 +-
libs/libc/stdio/lib_libdtoa.c | 17 +-
libs/libc/stdio/lib_libvsprintf.c | 64 +-
libs/libc/stdio/lib_vasprintf.c | 59 +-
libs/libc/syslog/lib_setlogmask.c | 56 +-
libs/libc/tls/Kconfig | 51 +-
libs/libc/tls/Make.defs | 48 +-
libs/libc/tls/tls_getelem.c | 93 -
libs/libc/tls/tls_getinfo.c | 76 +
libs/libc/tls/tls_getvalue.c | 78 +
libs/libc/tls/tls_setelem.c | 89 -
libs/libc/tls/tls_setvalue.c | 79 +
libs/libc/ubin/.gitignore | 8 -
libs/libc/ubin/Makefile | 48 -
libs/libc/unistd/lib_gethostname.c | 3 +-
libs/libc/unistd/lib_getopt.c | 49 +-
libs/libc/unistd/lib_pipe.c | 12 +-
libs/libc/unistd/lib_sethostname.c | 9 +-
libs/libc/userfs/.gitignore | 9 -
libs/libc/wchar/lib_mbrtowc.c | 3 +-
libs/libc/wqueue/Kconfig | 2 +-
libs/libc/wqueue/Make.defs | 23 +-
libs/libc/zoneinfo/.gitignore | 1 -
libs/libc/zoneinfo/Makefile | 18 +-
libs/libdsp/Makefile | 9 +-
libs/libnx/.gitignore | 5 -
libs/libnx/Makefile | 38 +-
libs/libnx/bin/.gitignore | 8 -
libs/libnx/bin/Makefile | 2 +-
libs/libnx/kbin/.gitignore | 8 -
libs/libnx/kbin/Makefile | 2 +-
libs/libnx/nxcontext.h | 26 +-
libs/libnx/nxfonts/.gitignore | 1 -
libs/libnx/nxfonts/Make.defs | 2 +-
libs/libnx/nxfonts/Makefile.sources | 4 +-
libs/libnx/ubin/.gitignore | 8 -
libs/libnx/ubin/Makefile | 48 -
libs/libxx/.gitignore | 10 -
libs/libxx/Makefile | 20 +-
libs/libxx/libxx.hxx | 3 +-
mm/.gitignore | 5 -
mm/Kconfig | 2 +-
mm/Makefile | 39 +-
mm/bin/.gitignore | 8 -
mm/bin/Makefile | 2 +-
mm/iob/Make.defs | 2 +-
mm/iob/iob.h | 26 +-
mm/iob/iob_clone.c | 6 +-
mm/iob/iob_navail.c | 4 +-
mm/kbin/.gitignore | 8 -
mm/kbin/Makefile | 2 +-
mm/mm_gran/mm_gran.h | 26 +-
mm/mm_gran/mm_pgalloc.c | 26 +-
mm/mm_heap/mm_free.c | 3 +-
mm/mm_heap/mm_malloc.c | 6 +-
mm/mm_heap/mm_sem.c | 17 +-
mm/shm/shmat.c | 2 +-
mm/shm/shmdt.c | 44 +-
mm/ubin/.gitignore | 8 -
mm/ubin/Makefile | 48 -
mm/umm_heap/umm_globals.c | 2 +-
mm/umm_heap/umm_heap.h | 10 +-
mm/umm_heap/umm_malloc.c | 2 +-
net/.gitignore | 10 -
net/Makefile | 20 +-
net/arp/arp_notify.c | 2 +-
net/arp/arp_send.c | 45 +-
net/arp/arp_table.c | 6 +-
net/bluetooth/bluetooth_recvfrom.c | 55 +-
net/bluetooth/bluetooth_sendto.c | 51 +-
net/icmp/icmp_recvfrom.c | 61 +-
net/icmp/icmp_sendto.c | 80 +-
net/icmpv6/icmpv6_autoconfig.c | 82 +-
net/icmpv6/icmpv6_neighbor.c | 58 +-
net/icmpv6/icmpv6_notify.c | 2 +-
net/icmpv6/icmpv6_recvfrom.c | 61 +-
net/icmpv6/icmpv6_rnotify.c | 2 +-
net/icmpv6/icmpv6_sendto.c | 74 +-
net/ieee802154/ieee802154_recvfrom.c | 67 +-
net/ieee802154/ieee802154_sendto.c | 53 +-
net/igmp/igmp_group.c | 22 +-
net/igmp/igmp_timer.c | 46 +-
net/inet/inet_sockif.c | 17 +-
net/local/local_conn.c | 2 +-
net/local/local_connect.c | 49 +-
net/mld/mld.h | 26 +-
net/mld/mld_group.c | 2 +-
net/neighbor/neighbor_add.c | 2 +-
net/neighbor/neighbor_update.c | 2 +-
net/netdev/netdev_ioctl.c | 34 +-
net/netdev/netdev_register.c | 106 +-
net/netlink/netlink_conn.c | 2 +-
net/pkt/pkt_recvfrom.c | 2 +-
net/pkt/pkt_send.c | 2 +-
net/sixlowpan/sixlowpan_reassbuf.c | 4 +-
net/sixlowpan/sixlowpan_send.c | 2 +-
net/sixlowpan/sixlowpan_tcpsend.c | 2 +-
net/socket/getsockopt.c | 14 +-
net/socket/net_checksd.c | 45 +-
net/socket/net_close.c | 63 +-
net/socket/net_dup.c | 18 +-
net/socket/net_dup2.c | 12 +-
net/socket/net_sockets.c | 48 +-
net/socket/net_timeo.c | 5 +-
net/socket/setsockopt.c | 6 +-
net/socket/socket.c | 48 +-
net/tcp/tcp.h | 22 +-
net/tcp/tcp_accept.c | 4 +-
net/tcp/tcp_close.c | 2 +-
net/tcp/tcp_conn.c | 79 +-
net/tcp/tcp_connect.c | 48 +-
net/tcp/tcp_input.c | 30 +-
net/tcp/tcp_netpoll.c | 101 +-
net/tcp/tcp_recvfrom.c | 79 +-
net/tcp/tcp_send_unbuffered.c | 2 +-
net/tcp/tcp_sendfile.c | 18 +-
net/tcp/tcp_setsockopt.c | 8 +-
net/tcp/tcp_timer.c | 9 +-
net/tcp/tcp_txdrain.c | 2 +-
net/tcp/tcp_wrbuffer.c | 4 +-
net/udp/udp.h | 18 +-
net/udp/udp_conn.c | 27 +-
net/udp/udp_netpoll.c | 83 +-
net/udp/udp_recvfrom.c | 19 +-
net/udp/udp_sendto_unbuffered.c | 50 +-
net/udp/udp_txdrain.c | 2 +-
net/udp/udp_wrbuffer.c | 4 +-
net/usrsock/usrsock_conn.c | 15 +-
net/usrsock/usrsock_dev.c | 4 +-
openamp/.gitignore | 1 +
...e-the-address-check-in-rpmsg_send-rpmsg_t.patch | 38 +
...x-change-clock_systimespec-to-clock_systi.patch | 29 +
...-rpmsg_register_endpoint-into-rpmsg_init_.patch | 128 +
...dn-t-allocate-0-1023-address-in-rpmsg_cre.patch | 227 +
.../0004-rpmsg-wait-ept-ready-in-rpmsg_send.patch | 128 +
...n-fail-if-either-source-or-destination-ad.patch | 45 +
...eproc_mmap-support-va-to-pa-da-conversion.patch | 780 +
.../0007-rpmsg-bring-back-zero-copy-transfer.patch | 470 +
...acknowledge-the-received-creation-message.patch | 132 +
...proc_virtio_read_config-rproc_virtio_writ.patch | 119 +
...otiate-individual-buffer-size-dynamically.patch | 159 +
openamp/Makefile | 9 +-
openamp/libmetal.defs | 29 +-
openamp/open-amp.defs | 24 +-
pass1/.gitignore | 10 -
pass1/Makefile | 11 +-
sched/.gitignore | 10 -
sched/Kconfig | 30 +-
sched/Makefile | 50 +-
sched/clock/Make.defs | 2 +-
sched/clock/clock.c | 5 +-
sched/clock/clock_gettime.c | 9 +-
sched/clock/clock_initialize.c | 7 +-
sched/clock/clock_settime.c | 2 +-
sched/clock/clock_systime_ticks.c | 156 +
sched/clock/clock_systime_timespec.c | 198 +
sched/clock/clock_systimer.c | 156 -
sched/clock/clock_systimespec.c | 198 -
sched/errno/Make.defs | 45 -
sched/errno/errno_get.c | 78 -
sched/errno/errno_getptr.c | 125 -
sched/errno/errno_set.c | 77 -
sched/group/Make.defs | 47 +-
sched/group/group.h | 68 +-
sched/group/group_childstatus.c | 124 +-
sched/group/group_continue.c | 45 +-
sched/group/group_create.c | 20 +-
sched/group/group_exitinfo.c | 2 +-
sched/group/group_free.c | 5 +-
sched/group/group_killchildren.c | 53 +-
sched/group/group_leave.c | 55 +-
sched/group/group_malloc.c | 5 +-
sched/group/group_setupstreams.c | 45 +-
sched/group/group_setuptaskfiles.c | 58 +-
sched/group/group_signal.c | 15 +-
sched/group/group_suspendchildren.c | 55 +-
sched/group/group_tlsalloc.c | 101 +
sched/group/group_tlsfree.c | 88 +
sched/group/group_waiter.c | 8 +-
sched/group/group_zalloc.c | 7 +-
sched/init/nx_bringup.c | 51 +-
sched/init/nx_start.c | 8 +-
sched/irq/irq_attach.c | 6 +-
sched/irq/irq_csection.c | 71 +-
sched/irq/irq_dispatch.c | 8 +-
sched/irq/irq_procfs.c | 2 +-
sched/mqueue/mq_descreate.c | 2 +-
sched/mqueue/mq_rcvinternal.c | 11 +-
sched/mqueue/mq_sndinternal.c | 11 +-
sched/mqueue/mq_timedreceive.c | 2 +-
sched/mqueue/mq_timedsend.c | 2 +-
sched/mqueue/mq_waitirq.c | 4 +-
sched/paging/Make.defs | 2 +-
sched/paging/pg_miss.c | 4 +-
sched/paging/pg_worker.c | 126 +-
sched/pthread/Make.defs | 47 +-
sched/pthread/pthread.h | 4 +-
sched/pthread/pthread_cancel.c | 58 +-
sched/pthread/pthread_completejoin.c | 4 +-
sched/pthread/pthread_condbroadcast.c | 2 +-
sched/pthread/pthread_condsignal.c | 56 +-
sched/pthread/pthread_condtimedwait.c | 6 +-
sched/pthread/pthread_create.c | 78 +-
sched/pthread/pthread_get_stackaddr_np.c | 77 -
sched/pthread/pthread_get_stacksize_np.c | 79 -
sched/pthread/pthread_getaffinity.c | 6 +-
sched/pthread/pthread_getschedparam.c | 4 +-
sched/pthread/pthread_getspecific.c | 101 -
sched/pthread/pthread_join.c | 41 +-
sched/pthread/pthread_keycreate.c | 140 -
sched/pthread/pthread_keydelete.c | 103 -
sched/pthread/pthread_kill.c | 2 +-
sched/pthread/pthread_mutexconsistent.c | 45 +-
sched/pthread/pthread_mutexdestroy.c | 53 +-
sched/pthread/pthread_mutexinit.c | 44 +-
sched/pthread/pthread_mutextimedlock.c | 6 +-
sched/pthread/pthread_mutextrylock.c | 64 +-
sched/pthread/pthread_setaffinity.c | 45 +-
sched/pthread/pthread_setschedparam.c | 57 +-
sched/pthread/pthread_setschedprio.c | 53 +-
sched/pthread/pthread_setspecific.c | 116 -
sched/sched/Make.defs | 41 +-
sched/sched/sched.h | 96 +-
sched/sched/sched_addblocked.c | 10 +-
sched/sched/sched_addprioritized.c | 4 +-
sched/sched/sched_addreadytorun.c | 36 +-
sched/sched/sched_continue.c | 45 +-
sched/sched/sched_cpuload.c | 4 +-
sched/sched/sched_cpuload_oneshot.c | 43 +-
sched/sched/sched_cpuload_period.c | 8 +-
sched/sched/sched_cpupause.c | 4 +-
sched/sched/sched_cpuselect.c | 4 +-
sched/sched/sched_critmonitor.c | 16 +-
sched/sched/sched_foreach.c | 43 +-
sched/sched/sched_get_stackinfo.c | 105 +
sched/sched/sched_getaffinity.c | 14 +-
sched/sched/sched_getfiles.c | 47 +-
sched/sched/sched_getparam.c | 12 +-
sched/sched/sched_getscheduler.c | 10 +-
sched/sched/sched_getsockets.c | 43 +-
sched/sched/sched_getstreams.c | 50 +-
sched/sched/sched_gettcb.c | 35 +-
sched/sched/sched_lock.c | 51 +-
sched/sched/sched_mergepending.c | 40 +-
sched/sched/sched_mergeprioritized.c | 51 +-
sched/sched/sched_note.c | 2 +-
sched/sched/sched_processtimer.c | 4 +-
sched/sched/sched_releasetcb.c | 53 +-
sched/sched/sched_removeblocked.c | 4 +-
sched/sched/sched_removereadytorun.c | 18 +-
sched/sched/sched_reprioritize.c | 47 +-
sched/sched/sched_resumescheduler.c | 14 +-
sched/sched/sched_roundrobin.c | 49 +-
sched/sched/sched_rrgetinterval.c | 2 +-
sched/sched/sched_self.c | 43 +-
sched/sched/sched_setaffinity.c | 63 +-
sched/sched/sched_setparam.c | 14 +-
sched/sched/sched_setpriority.c | 16 +-
sched/sched/sched_setscheduler.c | 68 +-
sched/sched/sched_sporadic.c | 62 +-
sched/sched/sched_suspend.c | 51 +-
sched/sched/sched_suspendscheduler.c | 8 +-
sched/sched/sched_tasklistlock.c | 14 +-
sched/sched/sched_timerexpiration.c | 83 +-
sched/sched/sched_unlock.c | 63 +-
sched/sched/sched_verifytcb.c | 4 +-
sched/sched/sched_wait.c | 11 +-
sched/sched/sched_waitid.c | 218 +-
sched/sched/sched_waitpid.c | 408 +-
sched/sched/sched_yield.c | 2 +-
sched/semaphore/sem_holder.c | 70 +-
sched/semaphore/sem_initialize.c | 41 +-
sched/semaphore/sem_post.c | 63 +-
sched/semaphore/sem_setprotocol.c | 8 +-
sched/semaphore/sem_tickwait.c | 2 +-
sched/semaphore/sem_timeout.c | 2 +-
sched/semaphore/sem_wait.c | 14 +-
sched/semaphore/sem_waitirq.c | 41 +-
sched/semaphore/semaphore.h | 63 +-
sched/signal/sig_action.c | 42 +-
sched/signal/sig_default.c | 20 +-
sched/signal/sig_deliver.c | 60 +-
sched/signal/sig_dispatch.c | 26 +-
sched/signal/sig_kill.c | 2 +-
sched/signal/sig_lowest.c | 4 +-
sched/signal/sig_nanosleep.c | 4 +-
sched/signal/sig_pending.c | 3 +-
sched/signal/sig_timedwait.c | 2 +-
sched/signal/sig_unmaskpendingsignal.c | 4 +-
sched/task/exit.c | 46 +-
sched/task/task.h | 4 +-
sched/task/task_activate.c | 48 +-
sched/task/task_create.c | 27 +-
sched/task/task_delete.c | 2 +-
sched/task/task_exit.c | 56 +-
sched/task/task_exithook.c | 9 +-
sched/task/task_getgroup.c | 2 +-
sched/task/task_init.c | 77 +-
sched/task/task_posixspawn.c | 10 +-
sched/task/task_prctl.c | 4 +-
sched/task/task_recover.c | 2 +-
sched/task/task_reparent.c | 65 +-
sched/task/task_restart.c | 52 +-
sched/task/task_setup.c | 106 +-
sched/task/task_spawn.c | 35 +-
sched/task/task_spawnparms.c | 12 +-
sched/task/task_start.c | 2 +-
sched/task/task_terminate.c | 6 +-
sched/task/task_vfork.c | 123 +-
sched/timer/timer_gettime.c | 2 +-
sched/wdog/wd_cancel.c | 2 +-
sched/wdog/wd_start.c | 6 +-
sched/wdog/wdog.h | 2 +-
sched/wqueue/kwork_hpthread.c | 4 +-
sched/wqueue/kwork_inherit.c | 10 +-
sched/wqueue/kwork_lpthread.c | 4 +-
sched/wqueue/kwork_process.c | 6 +-
sched/wqueue/kwork_queue.c | 2 +-
sched/wqueue/wqueue.h | 12 +-
syscall/.gitignore | 10 -
syscall/Makefile | 11 +-
syscall/README.txt | 30 +
syscall/syscall.csv | 247 +-
syscall/syscall_funclookup.c | 112 +-
syscall/syscall_lookup.h | 403 -
syscall/syscall_nparms.c | 16 +-
syscall/syscall_stublookup.c | 461 +-
tools/.gitignore | 3 +-
tools/Config.mk | 113 +-
tools/Directories.mk | 6 +-
tools/KernelLibs.mk | 8 +-
tools/LibTargets.mk | 167 +-
tools/Makefile.export | 6 +-
tools/Makefile.host | 89 +-
tools/Makefile.unix | 279 +-
tools/Makefile.win | 297 +-
tools/ProtectedLibs.mk | 8 +-
tools/README.txt | 19 +-
tools/csvparser.h | 54 +-
tools/cxd56/.gitignore | 1 -
tools/cxd56/Makefile | 2 +-
tools/esp32/Makefile | 2 +-
tools/incdir.bat | 5 -
tools/incdir.c | 496 +
tools/incdir.sh | 12 +-
tools/logparser.c | 576 -
tools/macar-rcs.sh | 44 +
tools/mkdeps.c | 143 +-
tools/mkexport.sh | 10 +-
tools/mksyscall.c | 238 +-
tools/nxstyle.c | 17 +-
tools/pic32/.gitignore | 2 -
tools/pic32/Config.mk | 6 +-
tools/pic32/Makefile.host | 4 +-
tools/refresh.sh | 54 +-
tools/sethost.sh | 94 +-
tools/testbuild.sh | 17 +-
tools/zds/.gitignore | 3 -
tools/zds/Makefile | 8 +-
tools/zipme.sh | 69 +-
video/Makefile | 9 +-
video/videomode/Make.defs | 1 -
wireless/.gitignore | 10 -
wireless/Makefile | 21 +-
wireless/bluetooth/Make.defs | 2 +-
wireless/bluetooth/bt_hcicore.c | 4 +-
wireless/ieee802154/Make.defs | 2 +-
wireless/ieee802154/mac802154.c | 127 +-
wireless/ieee802154/mac802154_device.c | 4 +-
wireless/ieee802154/mac802154_netdev.c | 2 +-
wireless/pktradio/Make.defs | 2 +-
4870 files changed, 171199 insertions(+), 176223 deletions(-)
delete mode 100644 ChangeLog
create mode 100644 arch/arm/include/armv8-m/irq.h
create mode 100644 arch/arm/include/armv8-m/irq_cmnvector.h
create mode 100644 arch/arm/include/armv8-m/irq_lazyfpu.h
create mode 100644 arch/arm/include/armv8-m/nvicpri.h
create mode 100644 arch/arm/include/armv8-m/spinlock.h
create mode 100644 arch/arm/include/armv8-m/syscall.h
create mode 100644 arch/arm/include/stm32/stm32g47xxx_irq.h
create mode 100644 arch/arm/src/arm/arm_allocpage.c
create mode 100644 arch/arm/src/arm/arm_assert.c
create mode 100644 arch/arm/src/arm/arm_blocktask.c
create mode 100644 arch/arm/src/arm/arm_cache.S
create mode 100644 arch/arm/src/arm/arm_checkmapping.c
create mode 100644 arch/arm/src/arm/arm_copyfullstate.c
create mode 100644 arch/arm/src/arm/arm_dataabort.c
create mode 100644 arch/arm/src/arm/arm_doirq.c
create mode 100644 arch/arm/src/arm/arm_fullcontextrestore.S
create mode 100644 arch/arm/src/arm/arm_head.S
create mode 100644 arch/arm/src/arm/arm_initialstate.c
create mode 100644 arch/arm/src/arm/arm_nommuhead.S
create mode 100644 arch/arm/src/arm/arm_pginitialize.c
create mode 100644 arch/arm/src/arm/arm_prefetchabort.c
create mode 100644 arch/arm/src/arm/arm_releasepending.c
create mode 100644 arch/arm/src/arm/arm_reprioritizertr.c
create mode 100644 arch/arm/src/arm/arm_saveusercontext.S
create mode 100644 arch/arm/src/arm/arm_schedulesigaction.c
create mode 100644 arch/arm/src/arm/arm_sigdeliver.c
create mode 100644 arch/arm/src/arm/arm_syscall.c
create mode 100644 arch/arm/src/arm/arm_unblocktask.c
create mode 100644 arch/arm/src/arm/arm_undefinedinsn.c
create mode 100644 arch/arm/src/arm/arm_va2pte.c
create mode 100644 arch/arm/src/arm/arm_vectoraddrexcptn.S
create mode 100644 arch/arm/src/arm/arm_vectors.S
create mode 100644 arch/arm/src/arm/arm_vectortab.S
delete mode 100644 arch/arm/src/arm/up_allocpage.c
delete mode 100644 arch/arm/src/arm/up_assert.c
delete mode 100644 arch/arm/src/arm/up_blocktask.c
delete mode 100644 arch/arm/src/arm/up_cache.S
delete mode 100644 arch/arm/src/arm/up_checkmapping.c
delete mode 100644 arch/arm/src/arm/up_copyfullstate.c
delete mode 100644 arch/arm/src/arm/up_dataabort.c
delete mode 100644 arch/arm/src/arm/up_doirq.c
delete mode 100644 arch/arm/src/arm/up_fullcontextrestore.S
delete mode 100644 arch/arm/src/arm/up_head.S
delete mode 100644 arch/arm/src/arm/up_initialstate.c
delete mode 100644 arch/arm/src/arm/up_nommuhead.S
delete mode 100644 arch/arm/src/arm/up_pginitialize.c
delete mode 100644 arch/arm/src/arm/up_prefetchabort.c
delete mode 100644 arch/arm/src/arm/up_releasepending.c
delete mode 100644 arch/arm/src/arm/up_reprioritizertr.c
delete mode 100644 arch/arm/src/arm/up_saveusercontext.S
delete mode 100644 arch/arm/src/arm/up_schedulesigaction.c
delete mode 100644 arch/arm/src/arm/up_sigdeliver.c
delete mode 100644 arch/arm/src/arm/up_syscall.c
delete mode 100644 arch/arm/src/arm/up_unblocktask.c
delete mode 100644 arch/arm/src/arm/up_undefinedinsn.c
delete mode 100644 arch/arm/src/arm/up_va2pte.c
delete mode 100644 arch/arm/src/arm/up_vectoraddrexcptn.S
delete mode 100644 arch/arm/src/arm/up_vectors.S
delete mode 100644 arch/arm/src/arm/up_vectortab.S
create mode 100644 arch/arm/src/armv6-m/arm_assert.c
create mode 100644 arch/arm/src/armv6-m/arm_blocktask.c
create mode 100644 arch/arm/src/armv6-m/arm_copyfullstate.c
create mode 100644 arch/arm/src/armv6-m/arm_doirq.c
create mode 100644 arch/arm/src/armv6-m/arm_dumpnvic.c
create mode 100644 arch/arm/src/armv6-m/arm_exception.S
create mode 100644 arch/arm/src/armv6-m/arm_fullcontextrestore.S
create mode 100644 arch/arm/src/armv6-m/arm_hardfault.c
create mode 100644 arch/arm/src/armv6-m/arm_initialstate.c
create mode 100644 arch/arm/src/armv6-m/arm_releasepending.c
create mode 100644 arch/arm/src/armv6-m/arm_reprioritizertr.c
create mode 100644 arch/arm/src/armv6-m/arm_saveusercontext.S
create mode 100644 arch/arm/src/armv6-m/arm_schedulesigaction.c
create mode 100644 arch/arm/src/armv6-m/arm_sigdeliver.c
create mode 100644 arch/arm/src/armv6-m/arm_signal_dispatch.c
create mode 100644 arch/arm/src/armv6-m/arm_signal_handler.S
create mode 100644 arch/arm/src/armv6-m/arm_svcall.c
create mode 100644 arch/arm/src/armv6-m/arm_switchcontext.S
create mode 100644 arch/arm/src/armv6-m/arm_systemreset.c
create mode 100644 arch/arm/src/armv6-m/arm_unblocktask.c
create mode 100644 arch/arm/src/armv6-m/arm_vectors.c
delete mode 100644 arch/arm/src/armv6-m/up_assert.c
delete mode 100644 arch/arm/src/armv6-m/up_blocktask.c
delete mode 100644 arch/arm/src/armv6-m/up_copyfullstate.c
delete mode 100644 arch/arm/src/armv6-m/up_doirq.c
delete mode 100644 arch/arm/src/armv6-m/up_dumpnvic.c
delete mode 100644 arch/arm/src/armv6-m/up_exception.S
delete mode 100644 arch/arm/src/armv6-m/up_fullcontextrestore.S
delete mode 100644 arch/arm/src/armv6-m/up_hardfault.c
delete mode 100644 arch/arm/src/armv6-m/up_initialstate.c
delete mode 100644 arch/arm/src/armv6-m/up_releasepending.c
delete mode 100644 arch/arm/src/armv6-m/up_reprioritizertr.c
delete mode 100644 arch/arm/src/armv6-m/up_saveusercontext.S
delete mode 100644 arch/arm/src/armv6-m/up_schedulesigaction.c
delete mode 100644 arch/arm/src/armv6-m/up_sigdeliver.c
delete mode 100644 arch/arm/src/armv6-m/up_signal_dispatch.c
delete mode 100644 arch/arm/src/armv6-m/up_signal_handler.S
delete mode 100644 arch/arm/src/armv6-m/up_svcall.c
delete mode 100644 arch/arm/src/armv6-m/up_switchcontext.S
delete mode 100644 arch/arm/src/armv6-m/up_systemreset.c
delete mode 100644 arch/arm/src/armv6-m/up_unblocktask.c
delete mode 100644 arch/arm/src/armv6-m/up_vectors.c
delete mode 100644 arch/arm/src/armv7-a/arm_vfork.S
create mode 100644 arch/arm/src/armv7-a/vfork.S
create mode 100644 arch/arm/src/armv7-m/arm_assert.c
create mode 100644 arch/arm/src/armv7-m/arm_blocktask.c
create mode 100644 arch/arm/src/armv7-m/arm_cache.c
create mode 100644 arch/arm/src/armv7-m/arm_copyarmstate.c
create mode 100644 arch/arm/src/armv7-m/arm_copyfullstate.c
create mode 100644 arch/arm/src/armv7-m/arm_doirq.c
create mode 100644 arch/arm/src/armv7-m/arm_hardfault.c
create mode 100644 arch/arm/src/armv7-m/arm_initialstate.c
create mode 100644 arch/arm/src/armv7-m/arm_itm.c
create mode 100644 arch/arm/src/armv7-m/arm_itm_syslog.c
create mode 100644 arch/arm/src/armv7-m/arm_memfault.c
create mode 100644 arch/arm/src/armv7-m/arm_mpu.c
create mode 100644 arch/arm/src/armv7-m/arm_ramvec_attach.c
create mode 100644 arch/arm/src/armv7-m/arm_ramvec_initialize.c
create mode 100644 arch/arm/src/armv7-m/arm_releasepending.c
create mode 100644 arch/arm/src/armv7-m/arm_reprioritizertr.c
create mode 100644 arch/arm/src/armv7-m/arm_schedulesigaction.c
create mode 100644 arch/arm/src/armv7-m/arm_sigdeliver.c
create mode 100644 arch/arm/src/armv7-m/arm_signal_dispatch.c
create mode 100644 arch/arm/src/armv7-m/arm_stackcheck.c
create mode 100644 arch/arm/src/armv7-m/arm_svcall.c
create mode 100644 arch/arm/src/armv7-m/arm_systemreset.c
create mode 100644 arch/arm/src/armv7-m/arm_systick.c
create mode 100644 arch/arm/src/armv7-m/arm_trigger_irq.c
create mode 100644 arch/arm/src/armv7-m/arm_unblocktask.c
create mode 100644 arch/arm/src/armv7-m/arm_vectors.c
create mode 100644 arch/arm/src/armv7-m/gnu/arm_exception.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_fetchadd.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_fpu.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_fullcontextrestore.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_lazyexception.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_saveusercontext.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_setjmp.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_signal_handler.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_switchcontext.S
create mode 100644 arch/arm/src/armv7-m/gnu/arm_testset.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_exception.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_fetchadd.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_fpu.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_fullcontextrestore.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_lazyexception.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_saveusercontext.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_setjmp.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_signal_handler.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_switchcontext.S
delete mode 100644 arch/arm/src/armv7-m/gnu/up_testset.S
create mode 100644 arch/arm/src/armv7-m/iar/arm_fetchadd.S
create mode 100644 arch/arm/src/armv7-m/iar/arm_fullcontextrestore.S
create mode 100644 arch/arm/src/armv7-m/iar/arm_saveusercontext.S
create mode 100644 arch/arm/src/armv7-m/iar/arm_switchcontext.S
create mode 100644 arch/arm/src/armv7-m/iar/arm_testset.S
delete mode 100644 arch/arm/src/armv7-m/iar/up_fetchadd.S
delete mode 100644 arch/arm/src/armv7-m/iar/up_fullcontextrestore.S
delete mode 100644 arch/arm/src/armv7-m/iar/up_saveusercontext.S
delete mode 100644 arch/arm/src/armv7-m/iar/up_switchcontext.S
delete mode 100644 arch/arm/src/armv7-m/iar/up_testset.S
delete mode 100644 arch/arm/src/armv7-m/up_assert.c
delete mode 100644 arch/arm/src/armv7-m/up_blocktask.c
delete mode 100644 arch/arm/src/armv7-m/up_cache.c
delete mode 100644 arch/arm/src/armv7-m/up_copyarmstate.c
delete mode 100644 arch/arm/src/armv7-m/up_copyfullstate.c
delete mode 100644 arch/arm/src/armv7-m/up_doirq.c
delete mode 100644 arch/arm/src/armv7-m/up_hardfault.c
delete mode 100644 arch/arm/src/armv7-m/up_initialstate.c
delete mode 100644 arch/arm/src/armv7-m/up_itm.c
delete mode 100644 arch/arm/src/armv7-m/up_itm_syslog.c
delete mode 100644 arch/arm/src/armv7-m/up_memfault.c
delete mode 100644 arch/arm/src/armv7-m/up_mpu.c
delete mode 100644 arch/arm/src/armv7-m/up_ramvec_attach.c
delete mode 100644 arch/arm/src/armv7-m/up_ramvec_initialize.c
delete mode 100644 arch/arm/src/armv7-m/up_releasepending.c
delete mode 100644 arch/arm/src/armv7-m/up_reprioritizertr.c
delete mode 100644 arch/arm/src/armv7-m/up_schedulesigaction.c
delete mode 100644 arch/arm/src/armv7-m/up_sigdeliver.c
delete mode 100644 arch/arm/src/armv7-m/up_signal_dispatch.c
delete mode 100644 arch/arm/src/armv7-m/up_stackcheck.c
delete mode 100644 arch/arm/src/armv7-m/up_svcall.c
delete mode 100644 arch/arm/src/armv7-m/up_systemreset.c
delete mode 100644 arch/arm/src/armv7-m/up_systick.c
delete mode 100644 arch/arm/src/armv7-m/up_trigger_irq.c
delete mode 100644 arch/arm/src/armv7-m/up_unblocktask.c
delete mode 100644 arch/arm/src/armv7-m/up_vectors.c
delete mode 100644 arch/arm/src/armv7-r/arm_vfork.S
create mode 100644 arch/arm/src/armv7-r/vfork.S
create mode 100644 arch/arm/src/armv8-m/Kconfig
create mode 100644 arch/arm/src/armv8-m/Toolchain.defs
create mode 100644 arch/arm/src/armv8-m/arm_assert.c
create mode 100644 arch/arm/src/armv8-m/arm_blocktask.c
create mode 100644 arch/arm/src/armv8-m/arm_cache.c
create mode 100644 arch/arm/src/armv8-m/arm_copyarmstate.c
create mode 100644 arch/arm/src/armv8-m/arm_copyfullstate.c
create mode 100644 arch/arm/src/armv8-m/arm_doirq.c
create mode 100644 arch/arm/src/armv8-m/arm_exception.S
create mode 100644 arch/arm/src/armv8-m/arm_fetchadd.S
create mode 100644 arch/arm/src/armv8-m/arm_fpu.S
create mode 100644 arch/arm/src/armv8-m/arm_fullcontextrestore.S
create mode 100644 arch/arm/src/armv8-m/arm_hardfault.c
create mode 100644 arch/arm/src/armv8-m/arm_initialstate.c
create mode 100644 arch/arm/src/armv8-m/arm_itm.c
create mode 100644 arch/arm/src/armv8-m/arm_itm_syslog.c
create mode 100644 arch/arm/src/armv8-m/arm_lazyexception.S
create mode 100644 arch/arm/src/armv8-m/arm_memfault.c
create mode 100644 arch/arm/src/armv8-m/arm_mpu.c
create mode 100644 arch/arm/src/armv8-m/arm_ramvec_attach.c
create mode 100644 arch/arm/src/armv8-m/arm_ramvec_initialize.c
create mode 100644 arch/arm/src/armv8-m/arm_releasepending.c
create mode 100644 arch/arm/src/armv8-m/arm_reprioritizertr.c
create mode 100644 arch/arm/src/armv8-m/arm_saveusercontext.S
create mode 100644 arch/arm/src/armv8-m/arm_schedulesigaction.c
create mode 100644 arch/arm/src/armv8-m/arm_setjmp.S
create mode 100644 arch/arm/src/armv8-m/arm_sigdeliver.c
create mode 100644 arch/arm/src/armv8-m/arm_signal_dispatch.c
create mode 100644 arch/arm/src/armv8-m/arm_signal_handler.S
create mode 100644 arch/arm/src/armv8-m/arm_stackcheck.c
create mode 100644 arch/arm/src/armv8-m/arm_svcall.c
create mode 100644 arch/arm/src/armv8-m/arm_switchcontext.S
create mode 100644 arch/arm/src/armv8-m/arm_systemreset.c
create mode 100644 arch/arm/src/armv8-m/arm_systick.c
create mode 100644 arch/arm/src/armv8-m/arm_testset.S
create mode 100644 arch/arm/src/armv8-m/arm_trigger_irq.c
create mode 100644 arch/arm/src/armv8-m/arm_unblocktask.c
create mode 100644 arch/arm/src/armv8-m/arm_vectors.c
create mode 100644 arch/arm/src/armv8-m/barriers.h
create mode 100644 arch/arm/src/armv8-m/dwt.h
create mode 100644 arch/arm/src/armv8-m/etm.h
create mode 100644 arch/arm/src/armv8-m/exc_return.h
create mode 100644 arch/arm/src/armv8-m/fpb.h
create mode 100644 arch/arm/src/armv8-m/itm.h
create mode 100644 arch/arm/src/armv8-m/itm_syslog.h
create mode 100644 arch/arm/src/armv8-m/mpu.h
create mode 100644 arch/arm/src/armv8-m/nvic.h
create mode 100644 arch/arm/src/armv8-m/psr.h
create mode 100644 arch/arm/src/armv8-m/ram_vectors.h
create mode 100644 arch/arm/src/armv8-m/svcall.h
create mode 100644 arch/arm/src/armv8-m/systick.h
create mode 100644 arch/arm/src/armv8-m/tpi.h
create mode 100644 arch/arm/src/armv8-m/vfork.S
create mode 100644 arch/arm/src/common/arm_allocateheap.c
create mode 100644 arch/arm/src/common/arm_arch.h
create mode 100644 arch/arm/src/common/arm_checkstack.c
create mode 100644 arch/arm/src/common/arm_createstack.c
create mode 100644 arch/arm/src/common/arm_etherstub.c
create mode 100644 arch/arm/src/common/arm_exit.c
create mode 100644 arch/arm/src/common/arm_hostfs.c
create mode 100644 arch/arm/src/common/arm_idle.c
create mode 100644 arch/arm/src/common/arm_initialize.c
create mode 100644 arch/arm/src/common/arm_internal.h
create mode 100644 arch/arm/src/common/arm_interruptcontext.c
create mode 100644 arch/arm/src/common/arm_lowputs.c
rename arch/arm/src/common/{up_lwl_console.c => arm_lwl_console.c} (100%)
create mode 100644 arch/arm/src/common/arm_mdelay.c
create mode 100644 arch/arm/src/common/arm_modifyreg16.c
create mode 100644 arch/arm/src/common/arm_modifyreg32.c
create mode 100644 arch/arm/src/common/arm_modifyreg8.c
create mode 100644 arch/arm/src/common/arm_pthread_start.c
create mode 100644 arch/arm/src/common/arm_puts.c
create mode 100644 arch/arm/src/common/arm_releasestack.c
create mode 100644 arch/arm/src/common/arm_semi_syslog.c
create mode 100644 arch/arm/src/common/arm_stackframe.c
create mode 100644 arch/arm/src/common/arm_task_start.c
create mode 100644 arch/arm/src/common/arm_udelay.c
create mode 100644 arch/arm/src/common/arm_usestack.c
create mode 100644 arch/arm/src/common/arm_vfork.c
create mode 100644 arch/arm/src/common/arm_vfork.h
delete mode 100644 arch/arm/src/common/up_allocateheap.c
delete mode 100644 arch/arm/src/common/up_arch.h
delete mode 100644 arch/arm/src/common/up_checkstack.c
delete mode 100644 arch/arm/src/common/up_createstack.c
delete mode 100644 arch/arm/src/common/up_etherstub.c
delete mode 100644 arch/arm/src/common/up_exit.c
delete mode 100644 arch/arm/src/common/up_hostfs.c
delete mode 100644 arch/arm/src/common/up_idle.c
delete mode 100644 arch/arm/src/common/up_initialize.c
delete mode 100644 arch/arm/src/common/up_internal.h
delete mode 100644 arch/arm/src/common/up_interruptcontext.c
delete mode 100644 arch/arm/src/common/up_lowputs.c
delete mode 100644 arch/arm/src/common/up_mdelay.c
delete mode 100644 arch/arm/src/common/up_modifyreg16.c
delete mode 100644 arch/arm/src/common/up_modifyreg32.c
delete mode 100644 arch/arm/src/common/up_modifyreg8.c
delete mode 100644 arch/arm/src/common/up_pthread_start.c
delete mode 100644 arch/arm/src/common/up_puts.c
delete mode 100644 arch/arm/src/common/up_releasestack.c
delete mode 100644 arch/arm/src/common/up_semi_syslog.c
delete mode 100644 arch/arm/src/common/up_stackframe.c
delete mode 100644 arch/arm/src/common/up_task_start.c
delete mode 100644 arch/arm/src/common/up_udelay.c
delete mode 100644 arch/arm/src/common/up_usestack.c
delete mode 100644 arch/arm/src/common/up_vfork.c
delete mode 100644 arch/arm/src/common/up_vfork.h
create mode 100644 arch/arm/src/nrf52/hardware/nrf52_ppi.h
mode change 100755 => 100644 arch/arm/src/samv7/sam_eefc.c
mode change 100755 => 100644 arch/arm/src/samv7/sam_eefc.h
mode change 100755 => 100644 arch/arm/src/samv7/sam_uid.c
mode change 100755 => 100644 arch/arm/src/samv7/sam_uid.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g474cxx_pinmap.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g474mxx_pinmap.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g474qxx_pinmap.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g474rxx_pinmap.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g474vxx_pinmap.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g47xxx_gpio.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g47xxx_memorymap.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g47xxx_pinmap.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g47xxx_pwr.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g47xxx_rcc.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g47xxx_syscfg.h
create mode 100644 arch/arm/src/stm32/hardware/stm32g47xxx_uart.h
create mode 100644 arch/arm/src/stm32/stm32g47xxx_rcc.c
create mode 100644 arch/arm/src/stm32h7/stm32_oneshot.c
create mode 100644 arch/arm/src/stm32h7/stm32_oneshot.h
create mode 100644 arch/arm/src/stm32h7/stm32_oneshot_lowerhalf.c
create mode 100644 arch/arm/src/stm32h7/stm32_spi_slave.c
create mode 100644 arch/arm/src/tiva/common/tiva_idle.c
create mode 100644 arch/avr/include/avr/arch.h
create mode 100644 arch/avr/include/avr32/arch.h
create mode 100644 arch/avr/include/tls.h
create mode 100644 arch/hc/include/tls.h
create mode 100644 arch/mips/include/tls.h
create mode 100644 arch/mips/src/common/mips_allocateheap.c
create mode 100644 arch/mips/src/common/mips_arch.h
create mode 100644 arch/mips/src/common/mips_createstack.c
create mode 100644 arch/mips/src/common/mips_etherstub.c
create mode 100644 arch/mips/src/common/mips_exit.c
create mode 100644 arch/mips/src/common/mips_idle.c
create mode 100644 arch/mips/src/common/mips_initialize.c
create mode 100644 arch/mips/src/common/mips_internal.h
create mode 100644 arch/mips/src/common/mips_interruptcontext.c
create mode 100644 arch/mips/src/common/mips_lowputs.c
create mode 100644 arch/mips/src/common/mips_mdelay.c
create mode 100644 arch/mips/src/common/mips_modifyreg16.c
create mode 100644 arch/mips/src/common/mips_modifyreg32.c
create mode 100644 arch/mips/src/common/mips_modifyreg8.c
create mode 100644 arch/mips/src/common/mips_puts.c
create mode 100644 arch/mips/src/common/mips_releasestack.c
create mode 100644 arch/mips/src/common/mips_stackframe.c
create mode 100644 arch/mips/src/common/mips_udelay.c
create mode 100644 arch/mips/src/common/mips_usestack.c
delete mode 100644 arch/mips/src/common/up_allocateheap.c
delete mode 100644 arch/mips/src/common/up_arch.h
delete mode 100644 arch/mips/src/common/up_createstack.c
delete mode 100644 arch/mips/src/common/up_etherstub.c
delete mode 100644 arch/mips/src/common/up_exit.c
delete mode 100644 arch/mips/src/common/up_idle.c
delete mode 100644 arch/mips/src/common/up_initialize.c
delete mode 100644 arch/mips/src/common/up_internal.h
delete mode 100644 arch/mips/src/common/up_interruptcontext.c
delete mode 100644 arch/mips/src/common/up_lowputs.c
delete mode 100644 arch/mips/src/common/up_mdelay.c
delete mode 100644 arch/mips/src/common/up_modifyreg16.c
delete mode 100644 arch/mips/src/common/up_modifyreg32.c
delete mode 100644 arch/mips/src/common/up_modifyreg8.c
delete mode 100644 arch/mips/src/common/up_puts.c
delete mode 100644 arch/mips/src/common/up_releasestack.c
delete mode 100644 arch/mips/src/common/up_stackframe.c
delete mode 100644 arch/mips/src/common/up_udelay.c
delete mode 100644 arch/mips/src/common/up_usestack.c
create mode 100644 arch/mips/src/mips32/mips_assert.c
create mode 100644 arch/mips/src/mips32/mips_blocktask.c
create mode 100644 arch/mips/src/mips32/mips_cache.S
create mode 100644 arch/mips/src/mips32/mips_copystate.c
create mode 100644 arch/mips/src/mips32/mips_doirq.c
create mode 100644 arch/mips/src/mips32/mips_dumpstate.c
create mode 100644 arch/mips/src/mips32/mips_initialstate.c
create mode 100644 arch/mips/src/mips32/mips_irq.c
create mode 100644 arch/mips/src/mips32/mips_releasepending.c
create mode 100644 arch/mips/src/mips32/mips_reprioritizertr.c
create mode 100644 arch/mips/src/mips32/mips_schedulesigaction.c
create mode 100644 arch/mips/src/mips32/mips_sigdeliver.c
create mode 100644 arch/mips/src/mips32/mips_swint0.c
create mode 100644 arch/mips/src/mips32/mips_syscall0.S
create mode 100644 arch/mips/src/mips32/mips_unblocktask.c
create mode 100644 arch/mips/src/mips32/mips_vfork.c
create mode 100644 arch/mips/src/mips32/mips_vfork.h
delete mode 100644 arch/mips/src/mips32/up_assert.c
delete mode 100644 arch/mips/src/mips32/up_blocktask.c
delete mode 100644 arch/mips/src/mips32/up_cache.S
delete mode 100644 arch/mips/src/mips32/up_copystate.c
delete mode 100644 arch/mips/src/mips32/up_doirq.c
delete mode 100644 arch/mips/src/mips32/up_dumpstate.c
delete mode 100644 arch/mips/src/mips32/up_initialstate.c
delete mode 100644 arch/mips/src/mips32/up_irq.c
delete mode 100644 arch/mips/src/mips32/up_releasepending.c
delete mode 100644 arch/mips/src/mips32/up_reprioritizertr.c
delete mode 100644 arch/mips/src/mips32/up_schedulesigaction.c
delete mode 100644 arch/mips/src/mips32/up_sigdeliver.c
delete mode 100644 arch/mips/src/mips32/up_swint0.c
delete mode 100644 arch/mips/src/mips32/up_syscall0.S
delete mode 100644 arch/mips/src/mips32/up_unblocktask.c
delete mode 100644 arch/mips/src/mips32/up_vfork.c
delete mode 100644 arch/mips/src/mips32/up_vfork.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-adc.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-bmx.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-can.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-che.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-cm.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-config.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-cvr.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-ddp.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-decodeirq.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-devcfg.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-dma.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-ethernet.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-ethernet.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-exception.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-flash.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-gpio.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-gpioirq.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-head.S
delete mode 100644 arch/mips/src/pic32mx/pic32mx-i2c.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-ic.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-int.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-ioport.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-irq.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-lowconsole.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-lowinit.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-memorymap.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-oc.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-osc.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-pmp.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-pps.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-reset.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-rtcc.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-serial.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-spi.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-spi.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-timer.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-timerisr.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-uart.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-usbdev.c
delete mode 100644 arch/mips/src/pic32mx/pic32mx-usbotg.h
delete mode 100644 arch/mips/src/pic32mx/pic32mx-wdt.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_adc.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_bmx.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_can.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_che.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_cm.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_config.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_cvr.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_ddp.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_decodeirq.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_devcfg.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_dma.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_ethernet.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_ethernet.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_exception.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_flash.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_gpio.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_gpioirq.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_head.S
create mode 100644 arch/mips/src/pic32mx/pic32mx_i2c.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_ic.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_int.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_ioport.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_irq.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_lowconsole.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_lowinit.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_memorymap.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_oc.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_osc.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_pmp.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_pps.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_reset.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_rtcc.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_serial.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_spi.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_spi.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_timer.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_timerisr.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_uart.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_usbdev.c
create mode 100644 arch/mips/src/pic32mx/pic32mx_usbotg.h
create mode 100644 arch/mips/src/pic32mx/pic32mx_wdt.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-dma.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-ethernet.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-features.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-i2c.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-int.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-ioport.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-memorymap.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-osc.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-pps.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-prefetch.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-spi.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-timer.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mz-uart.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_dma.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_ethernet.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_features.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_i2c.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_int.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_ioport.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_memorymap.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_osc.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_pps.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_prefetch.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_spi.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_timer.h
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mz_uart.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mzec-pps.h
rename arch/mips/src/pic32mz/hardware/{pic32mzec-features.h => pic32mzec_features.h} (100%)
rename arch/mips/src/pic32mz/hardware/{pic32mzec-memorymap.h => pic32mzec_memorymap.h} (100%)
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mzec_pps.h
delete mode 100644 arch/mips/src/pic32mz/hardware/pic32mzef-pps.h
rename arch/mips/src/pic32mz/hardware/{pic32mzef-features.h => pic32mzef_features.h} (100%)
rename arch/mips/src/pic32mz/hardware/{pic32mzef-memorymap.h => pic32mzef_memorymap.h} (100%)
create mode 100644 arch/mips/src/pic32mz/hardware/pic32mzef_pps.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-config.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-decodeirq.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-dma.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-dma.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-ethernet.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-exception.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-excptmacros.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-freerun.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-freerun.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-gpio.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-gpio.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-gpioirq.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-head.S
delete mode 100644 arch/mips/src/pic32mz/pic32mz-i2c.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-i2c.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-irq.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-lowconsole.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-lowconsole.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-lowinit.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-lowinit.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-oneshot-lowerhalf.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-oneshot.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-oneshot.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-serial.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-spi.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-spi.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-timer-lowerhalf.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-timer.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-timer.h
delete mode 100644 arch/mips/src/pic32mz/pic32mz-timerisr.c
delete mode 100644 arch/mips/src/pic32mz/pic32mz-usbdev.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_config.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_decodeirq.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_dma.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_dma.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_ethernet.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_exception.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_excptmacros.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_freerun.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_freerun.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_gpio.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_gpio.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_gpioirq.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_head.S
create mode 100644 arch/mips/src/pic32mz/pic32mz_i2c.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_i2c.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_irq.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_lowconsole.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_lowconsole.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_lowinit.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_lowinit.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_oneshot.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_oneshot.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_oneshot_lowerhalf.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_serial.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_spi.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_spi.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_timer.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_timer.h
create mode 100644 arch/mips/src/pic32mz/pic32mz_timer_lowerhalf.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_timerisr.c
create mode 100644 arch/mips/src/pic32mz/pic32mz_usbdev.h
create mode 100644 arch/misoc/include/tls.h
create mode 100644 arch/or1k/include/tls.h
create mode 100644 arch/renesas/include/m16c/arch.h
create mode 100644 arch/renesas/include/rx65n/arch.h
create mode 100644 arch/renesas/include/sh1/arch.h
create mode 100644 arch/renesas/include/tls.h
delete mode 100644 arch/renesas/src/.gitignore
create mode 100644 arch/risc-v/include/rv32im/arch.h
create mode 100644 arch/risc-v/include/rv64gc/arch.h
create mode 100644 arch/risc-v/include/tls.h
create mode 100644 arch/risc-v/src/common/riscv_allocateheap.c
create mode 100644 arch/risc-v/src/common/riscv_arch.h
create mode 100644 arch/risc-v/src/common/riscv_checkstack.c
create mode 100644 arch/risc-v/src/common/riscv_createstack.c
create mode 100644 arch/risc-v/src/common/riscv_exit.c
create mode 100644 arch/risc-v/src/common/riscv_idle.c
create mode 100644 arch/risc-v/src/common/riscv_initialize.c
create mode 100644 arch/risc-v/src/common/riscv_internal.h
create mode 100644 arch/risc-v/src/common/riscv_interruptcontext.c
create mode 100644 arch/risc-v/src/common/riscv_mdelay.c
create mode 100644 arch/risc-v/src/common/riscv_modifyreg32.c
create mode 100644 arch/risc-v/src/common/riscv_pthread_start.c
create mode 100644 arch/risc-v/src/common/riscv_puts.c
create mode 100644 arch/risc-v/src/common/riscv_releasestack.c
create mode 100644 arch/risc-v/src/common/riscv_stackframe.c
create mode 100644 arch/risc-v/src/common/riscv_task_start.c
create mode 100644 arch/risc-v/src/common/riscv_udelay.c
create mode 100644 arch/risc-v/src/common/riscv_usestack.c
delete mode 100644 arch/risc-v/src/common/up_allocateheap.c
delete mode 100644 arch/risc-v/src/common/up_arch.h
delete mode 100644 arch/risc-v/src/common/up_checkstack.c
delete mode 100644 arch/risc-v/src/common/up_createstack.c
delete mode 100644 arch/risc-v/src/common/up_exit.c
delete mode 100644 arch/risc-v/src/common/up_idle.c
delete mode 100644 arch/risc-v/src/common/up_initialize.c
delete mode 100644 arch/risc-v/src/common/up_internal.h
delete mode 100644 arch/risc-v/src/common/up_interruptcontext.c
delete mode 100644 arch/risc-v/src/common/up_mdelay.c
delete mode 100644 arch/risc-v/src/common/up_modifyreg32.c
delete mode 100644 arch/risc-v/src/common/up_pthread_start.c
delete mode 100644 arch/risc-v/src/common/up_puts.c
delete mode 100644 arch/risc-v/src/common/up_releasestack.c
delete mode 100644 arch/risc-v/src/common/up_stackframe.c
delete mode 100644 arch/risc-v/src/common/up_task_start.c
delete mode 100644 arch/risc-v/src/common/up_udelay.c
delete mode 100644 arch/risc-v/src/common/up_usestack.c
create mode 100644 arch/risc-v/src/fe310/fe310_schedulesigaction.c
delete mode 100644 arch/risc-v/src/fe310/up_schedulesigaction.c
create mode 100644 arch/risc-v/src/gap8/gap8_head.S
delete mode 100644 arch/risc-v/src/gap8/startup_gap8.S
create mode 100644 arch/risc-v/src/k210/hardware/k210_sysctl.h
create mode 100644 arch/risc-v/src/k210/k210_schedulesigaction.c
delete mode 100644 arch/risc-v/src/k210/up_schedulesigaction.c
create mode 100644 arch/risc-v/src/litex/litex_schedulesigaction.c
delete mode 100644 arch/risc-v/src/litex/up_schedulesigaction.c
create mode 100644 arch/risc-v/src/nr5m100/nr5_schedulesigaction.c
delete mode 100644 arch/risc-v/src/nr5m100/up_schedulesigaction.c
create mode 100644 arch/risc-v/src/rv32im/riscv_assert.c
create mode 100644 arch/risc-v/src/rv32im/riscv_blocktask.c
create mode 100644 arch/risc-v/src/rv32im/riscv_copystate.c
create mode 100644 arch/risc-v/src/rv32im/riscv_doirq.c
rename arch/risc-v/src/rv32im/{up_fpu.S => riscv_fpu.S} (100%)
create mode 100644 arch/risc-v/src/rv32im/riscv_initialstate.c
create mode 100644 arch/risc-v/src/rv32im/riscv_releasepending.c
create mode 100644 arch/risc-v/src/rv32im/riscv_reprioritizertr.c
create mode 100644 arch/risc-v/src/rv32im/riscv_sigdeliver.c
create mode 100644 arch/risc-v/src/rv32im/riscv_swint.c
rename arch/risc-v/src/rv32im/{up_syscall.S => riscv_syscall.S} (100%)
create mode 100644 arch/risc-v/src/rv32im/riscv_unblocktask.c
create mode 100644 arch/risc-v/src/rv32im/riscv_vfork.c
create mode 100644 arch/risc-v/src/rv32im/riscv_vfork.h
delete mode 100644 arch/risc-v/src/rv32im/up_assert.c
delete mode 100644 arch/risc-v/src/rv32im/up_blocktask.c
delete mode 100644 arch/risc-v/src/rv32im/up_copystate.c
delete mode 100644 arch/risc-v/src/rv32im/up_doirq.c
delete mode 100644 arch/risc-v/src/rv32im/up_initialstate.c
delete mode 100644 arch/risc-v/src/rv32im/up_releasepending.c
delete mode 100644 arch/risc-v/src/rv32im/up_reprioritizertr.c
delete mode 100644 arch/risc-v/src/rv32im/up_sigdeliver.c
delete mode 100644 arch/risc-v/src/rv32im/up_swint.c
delete mode 100644 arch/risc-v/src/rv32im/up_unblocktask.c
delete mode 100644 arch/risc-v/src/rv32im/up_vfork.c
delete mode 100644 arch/risc-v/src/rv32im/up_vfork.h
create mode 100644 arch/risc-v/src/rv64gc/riscv_assert.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_blocktask.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_copystate.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_fault.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_initialstate.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_releasepending.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_reprioritizertr.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_sigdeliver.c
create mode 100644 arch/risc-v/src/rv64gc/riscv_signal_dispatch.c
rename arch/risc-v/src/rv64gc/{up_signal_handler.S => riscv_signal_handler.S} (100%)
create mode 100644 arch/risc-v/src/rv64gc/riscv_swint.c
rename arch/risc-v/src/rv64gc/{up_testset.S => riscv_testset.S} (100%)
create mode 100644 arch/risc-v/src/rv64gc/riscv_unblocktask.c
delete mode 100644 arch/risc-v/src/rv64gc/up_assert.c
delete mode 100644 arch/risc-v/src/rv64gc/up_blocktask.c
delete mode 100644 arch/risc-v/src/rv64gc/up_copystate.c
delete mode 100644 arch/risc-v/src/rv64gc/up_fault.c
delete mode 100644 arch/risc-v/src/rv64gc/up_initialstate.c
delete mode 100644 arch/risc-v/src/rv64gc/up_releasepending.c
delete mode 100644 arch/risc-v/src/rv64gc/up_reprioritizertr.c
delete mode 100644 arch/risc-v/src/rv64gc/up_sigdeliver.c
delete mode 100644 arch/risc-v/src/rv64gc/up_signal_dispatch.c
delete mode 100644 arch/risc-v/src/rv64gc/up_swint.c
delete mode 100644 arch/risc-v/src/rv64gc/up_unblocktask.c
create mode 100644 arch/x86/include/tls.h
create mode 100644 arch/x86_64/include/tls.h
create mode 100644 arch/xtensa/include/tls.h
create mode 100644 arch/z16/include/tls.h
delete mode 100644 arch/z16/src/common/up_allocateheap.c
delete mode 100644 arch/z16/src/common/up_arch.h
delete mode 100644 arch/z16/src/common/up_assert.c
delete mode 100644 arch/z16/src/common/up_blocktask.c
delete mode 100644 arch/z16/src/common/up_copystate.c
delete mode 100644 arch/z16/src/common/up_createstack.c
delete mode 100644 arch/z16/src/common/up_doirq.c
delete mode 100644 arch/z16/src/common/up_exit.c
delete mode 100644 arch/z16/src/common/up_idle.c
delete mode 100644 arch/z16/src/common/up_initialize.c
delete mode 100644 arch/z16/src/common/up_initialstate.c
delete mode 100644 arch/z16/src/common/up_internal.h
delete mode 100644 arch/z16/src/common/up_interruptcontext.c
delete mode 100644 arch/z16/src/common/up_mdelay.c
delete mode 100644 arch/z16/src/common/up_registerdump.c
delete mode 100644 arch/z16/src/common/up_releasepending.c
delete mode 100644 arch/z16/src/common/up_releasestack.c
delete mode 100644 arch/z16/src/common/up_reprioritizertr.c
delete mode 100644 arch/z16/src/common/up_schedulesigaction.c
delete mode 100644 arch/z16/src/common/up_sigdeliver.c
delete mode 100644 arch/z16/src/common/up_stackdump.c
delete mode 100644 arch/z16/src/common/up_stackframe.c
delete mode 100644 arch/z16/src/common/up_udelay.c
delete mode 100644 arch/z16/src/common/up_unblocktask.c
delete mode 100644 arch/z16/src/common/up_usestack.c
create mode 100644 arch/z16/src/common/z16_allocateheap.c
create mode 100644 arch/z16/src/common/z16_arch.h
create mode 100644 arch/z16/src/common/z16_assert.c
create mode 100644 arch/z16/src/common/z16_blocktask.c
create mode 100644 arch/z16/src/common/z16_copystate.c
create mode 100644 arch/z16/src/common/z16_createstack.c
create mode 100644 arch/z16/src/common/z16_doirq.c
create mode 100644 arch/z16/src/common/z16_exit.c
create mode 100644 arch/z16/src/common/z16_idle.c
create mode 100644 arch/z16/src/common/z16_initialize.c
create mode 100644 arch/z16/src/common/z16_initialstate.c
create mode 100644 arch/z16/src/common/z16_internal.h
create mode 100644 arch/z16/src/common/z16_interruptcontext.c
create mode 100644 arch/z16/src/common/z16_mdelay.c
create mode 100644 arch/z16/src/common/z16_registerdump.c
create mode 100644 arch/z16/src/common/z16_releasepending.c
create mode 100644 arch/z16/src/common/z16_releasestack.c
create mode 100644 arch/z16/src/common/z16_reprioritizertr.c
create mode 100644 arch/z16/src/common/z16_schedulesigaction.c
create mode 100644 arch/z16/src/common/z16_sigdeliver.c
create mode 100644 arch/z16/src/common/z16_stackdump.c
create mode 100644 arch/z16/src/common/z16_stackframe.c
create mode 100644 arch/z16/src/common/z16_udelay.c
create mode 100644 arch/z16/src/common/z16_unblocktask.c
create mode 100644 arch/z16/src/common/z16_usestack.c
create mode 100644 arch/z80/include/tls.h
delete mode 100644 arch/z80/src/common/up_allocateheap.c
delete mode 100644 arch/z80/src/common/up_arch.h
delete mode 100644 arch/z80/src/common/up_assert.c
delete mode 100644 arch/z80/src/common/up_blocktask.c
delete mode 100644 arch/z80/src/common/up_createstack.c
delete mode 100644 arch/z80/src/common/up_exit.c
delete mode 100644 arch/z80/src/common/up_idle.c
delete mode 100644 arch/z80/src/common/up_initialize.c
delete mode 100644 arch/z80/src/common/up_interruptcontext.c
delete mode 100644 arch/z80/src/common/up_mdelay.c
delete mode 100644 arch/z80/src/common/up_puts.c
delete mode 100644 arch/z80/src/common/up_releasepending.c
delete mode 100644 arch/z80/src/common/up_releasestack.c
delete mode 100644 arch/z80/src/common/up_reprioritizertr.c
delete mode 100644 arch/z80/src/common/up_stackdump.c
delete mode 100644 arch/z80/src/common/up_stackframe.c
delete mode 100644 arch/z80/src/common/up_udelay.c
delete mode 100644 arch/z80/src/common/up_unblocktask.c
delete mode 100644 arch/z80/src/common/up_usestack.c
create mode 100644 arch/z80/src/common/z80_allocateheap.c
create mode 100644 arch/z80/src/common/z80_arch.h
create mode 100644 arch/z80/src/common/z80_assert.c
create mode 100644 arch/z80/src/common/z80_blocktask.c
create mode 100644 arch/z80/src/common/z80_createstack.c
create mode 100644 arch/z80/src/common/z80_exit.c
create mode 100644 arch/z80/src/common/z80_idle.c
create mode 100644 arch/z80/src/common/z80_initialize.c
create mode 100644 arch/z80/src/common/z80_interruptcontext.c
create mode 100644 arch/z80/src/common/z80_mdelay.c
create mode 100644 arch/z80/src/common/z80_puts.c
create mode 100644 arch/z80/src/common/z80_releasepending.c
create mode 100644 arch/z80/src/common/z80_releasestack.c
create mode 100644 arch/z80/src/common/z80_reprioritizertr.c
create mode 100644 arch/z80/src/common/z80_stackdump.c
create mode 100644 arch/z80/src/common/z80_stackframe.c
create mode 100644 arch/z80/src/common/z80_udelay.c
create mode 100644 arch/z80/src/common/z80_unblocktask.c
create mode 100644 arch/z80/src/common/z80_usestack.c
create mode 100644 arch/z80/src/ez80/ez80_serial.c.SAVE
delete mode 100644 arch/z80/src/ez80/up_mem.h
create mode 100644 arch/z80/src/ez80/z80_mem.h
delete mode 100644 arch/z80/src/z180/up_mem.h
create mode 100644 arch/z80/src/z180/z80_mem.h
delete mode 100644 arch/z80/src/z8/up_mem.h
create mode 100644 arch/z80/src/z8/z80_mem.h
delete mode 100644 arch/z80/src/z80/.gitignore
delete mode 100644 arch/z80/src/z80/up_mem.h
create mode 100644 arch/z80/src/z80/z80_mem.h
delete mode 100644 audio/.gitignore
delete mode 100644 binfmt/.gitignore
delete mode 100644 boards/arm/a1x/drivers/Kconfig
delete mode 100644 boards/arm/am335x/drivers/Kconfig
delete mode 100644 boards/arm/c5471/c5471evm/src/.gitignore
delete mode 100644 boards/arm/c5471/drivers/Kconfig
delete mode 100644 boards/arm/cxd56xx/common/.gitignore
delete mode 100644 boards/arm/cxd56xx/spresense/src/.gitignore
delete mode 100644 boards/arm/dm320/drivers/Kconfig
delete mode 100644 boards/arm/dm320/ntosd-dm320/src/.gitignore
delete mode 100644 boards/arm/efm32/drivers/Kconfig
delete mode 100644 boards/arm/efm32/efm32-g8xx-stk/src/.gitignore
delete mode 100644 boards/arm/efm32/efm32gg-stk3700/src/.gitignore
delete mode 100644 boards/arm/efm32/olimex-efm32g880f128-stk/src/.gitignore
delete mode 100644 boards/arm/imx6/drivers/Kconfig
delete mode 100644 boards/arm/imxrt/drivers/Kconfig
delete mode 100644 boards/arm/imxrt/imxrt1020-evk/.gitignore
delete mode 100644 boards/arm/imxrt/imxrt1050-evk/kernel/.gitignore
delete mode 100644 boards/arm/imxrt/imxrt1060-evk/kernel/.gitignore
delete mode 100644 boards/arm/kinetis/drivers/Kconfig
delete mode 100644 boards/arm/kinetis/freedom-k28f/src/.gitignore
delete mode 100644 boards/arm/kinetis/kwikstik-k40/src/.gitignore
delete mode 100644 boards/arm/kinetis/teensy-3.x/src/.gitignore
delete mode 100644 boards/arm/kinetis/twr-k60n512/src/.gitignore
delete mode 100644 boards/arm/kl/drivers/Kconfig
delete mode 100644 boards/arm/kl/freedom-kl25z/src/.gitignore
delete mode 100644 boards/arm/kl/freedom-kl26z/src/.gitignore
delete mode 100644 boards/arm/kl/teensy-lc/src/.gitignore
delete mode 100644 boards/arm/lc823450/drivers/Kconfig
delete mode 100644 boards/arm/lc823450/lc823450-xgevk/kernel/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/drivers/Kconfig
delete mode 100644 boards/arm/lpc17xx_40xx/lincoln60/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/lpc4088-devkit/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/lx_cpu/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/mbed/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/mcb1700/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/open1788/kernel/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/open1788/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/pnev5180b/kernel/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/pnev5180b/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/u-blox-c027/src/.gitignore
delete mode 100644 boards/arm/lpc17xx_40xx/zkit-arm-1769/src/.gitignore
delete mode 100644 boards/arm/lpc214x/drivers/Kconfig
delete mode 100644 boards/arm/lpc214x/mcu123-lpc214x/src/.gitignore
delete mode 100644 boards/arm/lpc214x/zp214xpa/src/.gitignore
delete mode 100644 boards/arm/lpc2378/drivers/Kconfig
delete mode 100644 boards/arm/lpc2378/olimex-lpc2378/src/.gitignore
delete mode 100644 boards/arm/lpc31xx/drivers/Kconfig
delete mode 100644 boards/arm/lpc31xx/ea3131/src/.gitignore
delete mode 100644 boards/arm/lpc31xx/ea3152/src/.gitignore
delete mode 100644 boards/arm/lpc31xx/olimex-lpc-h3131/src/.gitignore
delete mode 100644 boards/arm/lpc43xx/bambino-200e/kernel/.gitignore
delete mode 100644 boards/arm/lpc43xx/bambino-200e/src/.gitignore
delete mode 100644 boards/arm/lpc43xx/drivers/Kconfig
delete mode 100644 boards/arm/lpc43xx/lpc4330-xplorer/src/.gitignore
delete mode 100644 boards/arm/lpc43xx/lpc4337-ws/src/.gitignore
delete mode 100644 boards/arm/lpc43xx/lpc4357-evb/src/.gitignore
delete mode 100644 boards/arm/lpc43xx/lpc4370-link2/src/.gitignore
delete mode 100644 boards/arm/lpc54xx/drivers/Kconfig
delete mode 100644 boards/arm/max326xx/drivers/Kconfig
delete mode 100644 boards/arm/moxart/drivers/Kconfig
delete mode 100644 boards/arm/nrf52/drivers/Kconfig
delete mode 100644 boards/arm/nrf52/nrf52-feather/src/.gitignore
delete mode 100644 boards/arm/nrf52/nrf52832-dk/src/.gitignore
delete mode 100644 boards/arm/nrf52/nrf52840-dk/src/.gitignore
delete mode 100644 boards/arm/nrf52/nrf52840-dongle/src/.gitignore
delete mode 100644 boards/arm/nuc1xx/drivers/Kconfig
delete mode 100644 boards/arm/nuc1xx/nutiny-nuc120/src/.gitignore
delete mode 100644 boards/arm/s32k1xx/drivers/Kconfig
delete mode 100644 boards/arm/s32k1xx/rddrone-uavcan144/src/.gitignore
delete mode 100644 boards/arm/s32k1xx/rddrone-uavcan146/src/.gitignore
delete mode 100644 boards/arm/s32k1xx/s32k118evb/src/.gitignore
delete mode 100644 boards/arm/s32k1xx/s32k144evb/src/.gitignore
delete mode 100644 boards/arm/s32k1xx/s32k146evb/src/.gitignore
delete mode 100644 boards/arm/s32k1xx/s32k148evb/src/.gitignore
delete mode 100644 boards/arm/sam34/arduino-due/src/.gitignore
delete mode 100644 boards/arm/sam34/drivers/Kconfig
delete mode 100644 boards/arm/sam34/flipnclick-sam3x/src/.gitignore
delete mode 100644 boards/arm/sam34/sam3u-ek/kernel/.gitignore
delete mode 100644 boards/arm/sam34/sam3u-ek/src/.gitignore
delete mode 100644 boards/arm/sam34/sam4e-ek/src/.gitignore
delete mode 100644 boards/arm/sam34/sam4l-xplained/src/.gitignore
delete mode 100644 boards/arm/sama5/drivers/Kconfig
delete mode 100755 boards/arm/sama5/sama5d3-xplained/boot/uImage
mode change 100755 => 100644 boards/arm/sama5/sama5d3-xplained/src/sam_bringup.c
delete mode 100644 boards/arm/samd2l2/arduino-m0/src/.gitignore
delete mode 100644 boards/arm/samd2l2/drivers/Kconfig
delete mode 100644 boards/arm/samd2l2/samd20-xplained/src/.gitignore
delete mode 100644 boards/arm/samd2l2/samd21-xplained/src/.gitignore
delete mode 100644 boards/arm/samd2l2/saml21-xplained/src/.gitignore
delete mode 100644 boards/arm/samd5e5/drivers/Kconfig
delete mode 100644 boards/arm/samv7/drivers/Kconfig
delete mode 100644 boards/arm/samv7/same70-xplained/kernel/.gitignore
delete mode 100644 boards/arm/samv7/samv71-xult/kernel/.gitignore
delete mode 100644 boards/arm/stm32/axoloti/src/.gitignore
create mode 100644 boards/arm/stm32/axoloti/src/Make.defs
delete mode 100644 boards/arm/stm32/axoloti/src/Makefile
create mode 100644 boards/arm/stm32/b-g474e-dpow1/Kconfig
create mode 100644 boards/arm/stm32/b-g474e-dpow1/README.txt
create mode 100644 boards/arm/stm32/b-g474e-dpow1/configs/nsh/defconfig
create mode 100644 boards/arm/stm32/b-g474e-dpow1/include/board.h
create mode 100644 boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs
create mode 100644 boards/arm/stm32/b-g474e-dpow1/scripts/ld.script
rename boards/{xtensa/esp32/esp32-core => arm/stm32/b-g474e-dpow1}/src/.gitignore (100%)
create mode 100644 boards/arm/stm32/b-g474e-dpow1/src/Make.defs
create mode 100644 boards/arm/stm32/b-g474e-dpow1/src/b-g474e-dpow1.h
create mode 100644 boards/arm/stm32/b-g474e-dpow1/src/stm32_appinit.c
create mode 100644 boards/arm/stm32/b-g474e-dpow1/src/stm32_autoleds.c
create mode 100644 boards/arm/stm32/b-g474e-dpow1/src/stm32_boot.c
create mode 100644 boards/arm/stm32/b-g474e-dpow1/src/stm32_userleds.c
delete mode 100644 boards/arm/stm32/clicker2-stm32/kernel/.gitignore
delete mode 100644 boards/arm/stm32/clicker2-stm32/src/.gitignore
create mode 100644 boards/arm/stm32/clicker2-stm32/src/Make.defs
delete mode 100644 boards/arm/stm32/clicker2-stm32/src/Makefile
delete mode 100644 boards/arm/stm32/cloudctrl/src/.gitignore
create mode 100644 boards/arm/stm32/cloudctrl/src/Make.defs
delete mode 100644 boards/arm/stm32/cloudctrl/src/Makefile
create mode 100644 boards/arm/stm32/common/Makefile
create mode 100644 boards/arm/stm32/common/include/board_qencoder.h
create mode 100644 boards/arm/stm32/common/include/stm32_apa102.h
create mode 100644 boards/arm/stm32/common/include/stm32_apds9960.h
create mode 100644 boards/arm/stm32/common/include/stm32_bh1750.h
create mode 100644 boards/arm/stm32/common/include/stm32_bmp180.h
create mode 100644 boards/arm/stm32/common/include/stm32_dhtxx.h
create mode 100644 boards/arm/stm32/common/include/stm32_hcsr04.h
create mode 100644 boards/arm/stm32/common/include/stm32_ina219.h
create mode 100644 boards/arm/stm32/common/include/stm32_l3gd20.h
create mode 100644 boards/arm/stm32/common/include/stm32_lis3dsh.h
create mode 100644 boards/arm/stm32/common/include/stm32_lm75.h
create mode 100644 boards/arm/stm32/common/include/stm32_max31855.h
create mode 100644 boards/arm/stm32/common/include/stm32_max6675.h
create mode 100644 boards/arm/stm32/common/include/stm32_mlx90614.h
create mode 100644 boards/arm/stm32/common/include/stm32_mpl115a.h
create mode 100644 boards/arm/stm32/common/include/stm32_nrf24l01.h
create mode 100644 boards/arm/stm32/common/include/stm32_nunchuck.h
create mode 100644 boards/arm/stm32/common/include/stm32_ssd1306.h
create mode 100644 boards/arm/stm32/common/include/stm32_tone.h
create mode 100644 boards/arm/stm32/common/include/stm32_veml6070.h
create mode 100644 boards/arm/stm32/common/include/stm32_xen1210.h
create mode 100644 boards/arm/stm32/common/include/stm32_zerocross.h
create mode 100644 boards/arm/stm32/common/src/Make.defs
create mode 100644 boards/arm/stm32/common/src/stm32_apa102.c
create mode 100644 boards/arm/stm32/common/src/stm32_apds9960.c
create mode 100644 boards/arm/stm32/common/src/stm32_bh1750.c
create mode 100644 boards/arm/stm32/common/src/stm32_bmp180.c
create mode 100644 boards/arm/stm32/common/src/stm32_dhtxx.c
create mode 100644 boards/arm/stm32/common/src/stm32_hcsr04.c
create mode 100644 boards/arm/stm32/common/src/stm32_ina219.c
create mode 100644 boards/arm/stm32/common/src/stm32_l3gd20.c
create mode 100644 boards/arm/stm32/common/src/stm32_lis3dsh.c
create mode 100644 boards/arm/stm32/common/src/stm32_lm75.c
create mode 100644 boards/arm/stm32/common/src/stm32_max31855.c
create mode 100644 boards/arm/stm32/common/src/stm32_max6675.c
create mode 100644 boards/arm/stm32/common/src/stm32_mlx90614.c
create mode 100644 boards/arm/stm32/common/src/stm32_mpl115a.c
create mode 100644 boards/arm/stm32/common/src/stm32_nrf24l01.c
create mode 100644 boards/arm/stm32/common/src/stm32_nunchuck.c
create mode 100644 boards/arm/stm32/common/src/stm32_qencoder.c
create mode 100644 boards/arm/stm32/common/src/stm32_ssd1306.c
create mode 100644 boards/arm/stm32/common/src/stm32_tone.c
create mode 100644 boards/arm/stm32/common/src/stm32_veml6070.c
create mode 100644 boards/arm/stm32/common/src/stm32_xen1210.c
create mode 100644 boards/arm/stm32/common/src/stm32_zerocross.c
delete mode 100644 boards/arm/stm32/drivers/Kconfig
delete mode 100644 boards/arm/stm32/fire-stm32v2/src/.gitignore
create mode 100644 boards/arm/stm32/fire-stm32v2/src/Make.defs
delete mode 100644 boards/arm/stm32/fire-stm32v2/src/Makefile
delete mode 100644 boards/arm/stm32/hymini-stm32v/src/.gitignore
create mode 100644 boards/arm/stm32/hymini-stm32v/src/Make.defs
delete mode 100644 boards/arm/stm32/hymini-stm32v/src/Makefile
create mode 100644 boards/arm/stm32/maple/src/Make.defs
delete mode 100644 boards/arm/stm32/maple/src/Makefile
create mode 100644 boards/arm/stm32/mikroe-stm32f4/include/nsh_romfsimg.h
delete mode 100644 boards/arm/stm32/mikroe-stm32f4/kernel/.gitignore
delete mode 100644 boards/arm/stm32/mikroe-stm32f4/src/.gitignore
create mode 100644 boards/arm/stm32/mikroe-stm32f4/src/Make.defs
delete mode 100644 boards/arm/stm32/mikroe-stm32f4/src/Makefile
delete mode 100644 boards/arm/stm32/mikroe-stm32f4/src/stm32_qencoder.c
create mode 100644 boards/arm/stm32/nucleo-f103rb/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f103rb/src/Makefile
create mode 100644 boards/arm/stm32/nucleo-f207zg/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f207zg/src/Makefile
create mode 100644 boards/arm/stm32/nucleo-f302r8/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f302r8/src/Makefile
create mode 100644 boards/arm/stm32/nucleo-f303re/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f303re/src/Makefile
create mode 100644 boards/arm/stm32/nucleo-f303ze/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f303ze/src/Makefile
create mode 100644 boards/arm/stm32/nucleo-f303ze/src/stm32_lcd.c
delete mode 100644 boards/arm/stm32/nucleo-f303ze/src/stm32_ssd1306.c
create mode 100644 boards/arm/stm32/nucleo-f334r8/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f334r8/src/Makefile
create mode 100644 boards/arm/stm32/nucleo-f410rb/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f410rb/src/Makefile
create mode 100644 boards/arm/stm32/nucleo-f429zi/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f429zi/src/Makefile
delete mode 100644 boards/arm/stm32/nucleo-f446re/src/.gitignore
create mode 100644 boards/arm/stm32/nucleo-f446re/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f446re/src/Makefile
delete mode 100644 boards/arm/stm32/nucleo-f446re/src/stm32_qencoder.c
create mode 100644 boards/arm/stm32/nucleo-f4x1re/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-f4x1re/src/Makefile
delete mode 100644 boards/arm/stm32/nucleo-f4x1re/src/stm32_qencoder.c
create mode 100644 boards/arm/stm32/nucleo-l152re/src/Make.defs
delete mode 100644 boards/arm/stm32/nucleo-l152re/src/Makefile
create mode 100644 boards/arm/stm32/olimex-stm32-e407/src/Make.defs
delete mode 100644 boards/arm/stm32/olimex-stm32-e407/src/Makefile
delete mode 100644 boards/arm/stm32/olimex-stm32-e407/src/stm32_bmp180.c
delete mode 100644 boards/arm/stm32/olimex-stm32-e407/src/stm32_ina219.c
create mode 100644 boards/arm/stm32/olimex-stm32-h405/src/Make.defs
delete mode 100644 boards/arm/stm32/olimex-stm32-h405/src/Makefile
delete mode 100644 boards/arm/stm32/olimex-stm32-h407/src/.gitignore
create mode 100644 boards/arm/stm32/olimex-stm32-h407/src/Make.defs
delete mode 100644 boards/arm/stm32/olimex-stm32-h407/src/Makefile
delete mode 100644 boards/arm/stm32/olimex-stm32-p107/src/.gitignore
create mode 100644 boards/arm/stm32/olimex-stm32-p107/src/Make.defs
delete mode 100644 boards/arm/stm32/olimex-stm32-p107/src/Makefile
create mode 100644 boards/arm/stm32/olimex-stm32-p207/src/Make.defs
delete mode 100644 boards/arm/stm32/olimex-stm32-p207/src/Makefile
delete mode 100644 boards/arm/stm32/olimex-stm32-p407/kernel/.gitignore
create mode 100644 boards/arm/stm32/olimex-stm32-p407/src/Make.defs
delete mode 100644 boards/arm/stm32/olimex-stm32-p407/src/Makefile
delete mode 100644 boards/arm/stm32/olimex-stm32-p407/src/stm32_dhtxx.c
delete mode 100644 boards/arm/stm32/olimexino-stm32/src/.gitignore
create mode 100644 boards/arm/stm32/olimexino-stm32/src/Make.defs
delete mode 100644 boards/arm/stm32/olimexino-stm32/src/Makefile
delete mode 100644 boards/arm/stm32/omnibusf4/kernel/.gitignore
delete mode 100644 boards/arm/stm32/omnibusf4/src/.gitignore
create mode 100644 boards/arm/stm32/omnibusf4/src/Make.defs
delete mode 100644 boards/arm/stm32/omnibusf4/src/Makefile
create mode 100644 boards/arm/stm32/photon/src/Make.defs
delete mode 100644 boards/arm/stm32/photon/src/Makefile
delete mode 100644 boards/arm/stm32/shenzhou/src/.gitignore
create mode 100644 boards/arm/stm32/shenzhou/src/Make.defs
delete mode 100644 boards/arm/stm32/shenzhou/src/Makefile
delete mode 100644 boards/arm/stm32/stm3210e-eval/src/.gitignore
create mode 100644 boards/arm/stm32/stm3210e-eval/src/Make.defs
delete mode 100644 boards/arm/stm32/stm3210e-eval/src/Makefile
delete mode 100644 boards/arm/stm32/stm3210e-eval/src/stm32_lm75.c
delete mode 100644 boards/arm/stm32/stm3220g-eval/src/.gitignore
create mode 100644 boards/arm/stm32/stm3220g-eval/src/Make.defs
delete mode 100644 boards/arm/stm32/stm3220g-eval/src/Makefile
delete mode 100644 boards/arm/stm32/stm3240g-eval/kernel/.gitignore
delete mode 100644 boards/arm/stm32/stm3240g-eval/src/.gitignore
create mode 100644 boards/arm/stm32/stm3240g-eval/src/Make.defs
delete mode 100644 boards/arm/stm32/stm3240g-eval/src/Makefile
delete mode 100644 boards/arm/stm32/stm32_tiny/src/.gitignore
create mode 100644 boards/arm/stm32/stm32_tiny/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32_tiny/src/Makefile
delete mode 100644 boards/arm/stm32/stm32_tiny/src/stm32_nrf24l01.c
create mode 100644 boards/arm/stm32/stm32butterfly2/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32butterfly2/src/Makefile
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/.gitignore
create mode 100644 boards/arm/stm32/stm32f103-minimum/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/Makefile
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_apa102.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_apds9960.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_bmp180.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_hcsr04.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_lcd.c
create mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_lcd_ssd1306.c
create mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_lcd_st7567.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_lm75.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_max6675.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_nrf24l01.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_nunchuck.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_qencoder.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_ssd1306.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_tone.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_veml6070.c
delete mode 100644 boards/arm/stm32/stm32f103-minimum/src/stm32_zerocross.c
create mode 100644 boards/arm/stm32/stm32f334-disco/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32f334-disco/src/Makefile
delete mode 100644 boards/arm/stm32/stm32f3discovery/src/.gitignore
create mode 100644 boards/arm/stm32/stm32f3discovery/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32f3discovery/src/Makefile
delete mode 100644 boards/arm/stm32/stm32f3discovery/src/stm32_qencoder.c
create mode 100644 boards/arm/stm32/stm32f411e-disco/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32f411e-disco/src/Makefile
delete mode 100644 boards/arm/stm32/stm32f429i-disco/src/.gitignore
create mode 100644 boards/arm/stm32/stm32f429i-disco/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32f429i-disco/src/Makefile
delete mode 100644 boards/arm/stm32/stm32f429i-disco/src/stm32_l3gd20.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/kernel/.gitignore
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/.gitignore
create mode 100644 boards/arm/stm32/stm32f4discovery/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/Makefile
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_bh1750fvi.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_bmp180.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_lis3dsh.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_max31855.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_max6675.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_mlx90614.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_nunchuck.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_qencoder.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_xen1210.c
delete mode 100644 boards/arm/stm32/stm32f4discovery/src/stm32_zerocross.c
delete mode 100644 boards/arm/stm32/stm32ldiscovery/src/.gitignore
create mode 100644 boards/arm/stm32/stm32ldiscovery/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32ldiscovery/src/Makefile
delete mode 100644 boards/arm/stm32/stm32ldiscovery/src/stm32_qencoder.c
delete mode 100644 boards/arm/stm32/stm32vldiscovery/src/.gitignore
create mode 100644 boards/arm/stm32/stm32vldiscovery/src/Make.defs
delete mode 100644 boards/arm/stm32/stm32vldiscovery/src/Makefile
delete mode 100644 boards/arm/stm32/viewtool-stm32f107/src/.gitignore
create mode 100644 boards/arm/stm32/viewtool-stm32f107/src/Make.defs
delete mode 100644 boards/arm/stm32/viewtool-stm32f107/src/Makefile
delete mode 100644 boards/arm/stm32/viewtool-stm32f107/src/stm32_mpl115a.c
delete mode 100644 boards/arm/stm32f0l0g0/drivers/Kconfig
delete mode 100644 boards/arm/stm32f0l0g0/nucleo-f072rb/src/.gitignore
delete mode 100644 boards/arm/stm32f0l0g0/nucleo-f091rc/src/.gitignore
delete mode 100644 boards/arm/stm32f0l0g0/stm32f051-discovery/src/.gitignore
delete mode 100644 boards/arm/stm32f0l0g0/stm32f072-discovery/src/.gitignore
delete mode 100644 boards/arm/stm32f7/drivers/Kconfig
delete mode 100644 boards/arm/stm32f7/nucleo-144/src/.gitignore
delete mode 100644 boards/arm/stm32f7/stm32f746-ws/src/.gitignore
delete mode 100644 boards/arm/stm32f7/stm32f746g-disco/kernel/.gitignore
delete mode 100644 boards/arm/stm32f7/stm32f746g-disco/src/.gitignore
delete mode 100644 boards/arm/stm32f7/stm32f769i-disco/kernel/.gitignore
delete mode 100644 boards/arm/stm32f7/stm32f769i-disco/src/.gitignore
delete mode 100644 boards/arm/stm32h7/drivers/Kconfig
delete mode 100644 boards/arm/stm32h7/nucleo-h743zi/kernel/.gitignore
delete mode 100644 boards/arm/stm32h7/nucleo-h743zi/src/.gitignore
delete mode 100644 boards/arm/stm32h7/stm32h747i-disco/kernel/.gitignore
delete mode 100644 boards/arm/stm32h7/stm32h747i-disco/src/.gitignore
create mode 100644 boards/arm/stm32h7/stm32h747i-disco/src/stm32_dma_alloc.c
create mode 100644 boards/arm/stm32h7/stm32h747i-disco/src/stm32_sdmmc.c
delete mode 100644 boards/arm/stm32l4/b-l475e-iot01a/src/.gitignore
delete mode 100644 boards/arm/stm32l4/drivers/Kconfig
delete mode 100644 boards/arm/stm32l4/nucleo-l452re/src/.gitignore
delete mode 100644 boards/arm/stm32l4/nucleo-l496zg/src/.gitignore
delete mode 100644 boards/arm/stm32l4/stm32l476vg-disco/kernel/.gitignore
delete mode 100644 boards/arm/stm32l4/stm32l4r9ai-disco/kernel/.gitignore
delete mode 100644 boards/arm/stm32l4/stm32l4r9ai-disco/src/.gitignore
delete mode 100644 boards/arm/str71x/drivers/Kconfig
delete mode 100644 boards/arm/str71x/olimex-strp711/src/.gitignore
delete mode 100644 boards/arm/tiva/dk-tm4c129x/src/.gitignore
delete mode 100644 boards/arm/tiva/drivers/Kconfig
delete mode 100644 boards/arm/tiva/eagle100/src/.gitignore
delete mode 100644 boards/arm/tiva/ekk-lm3s9b96/src/.gitignore
delete mode 100644 boards/arm/tiva/lm3s6432-s2e/src/.gitignore
delete mode 100644 boards/arm/tiva/lm3s6965-ek/src/.gitignore
delete mode 100644 boards/arm/tiva/lm3s8962-ek/src/.gitignore
delete mode 100644 boards/arm/tiva/lm4f120-launchpad/src/.gitignore
delete mode 100644 boards/arm/tiva/tm4c123g-launchpad/src/.gitignore
delete mode 100644 boards/arm/tiva/tm4c1294-launchpad/src/.gitignore
delete mode 100644 boards/arm/tms570/drivers/Kconfig
delete mode 100644 boards/arm/xmc4/drivers/Kconfig
delete mode 100644 boards/avr/at32uc3/avr32dev1/src/.gitignore
delete mode 100644 boards/avr/at32uc3/drivers/Kconfig
delete mode 100644 boards/avr/at90usb/drivers/Kconfig
delete mode 100644 boards/avr/at90usb/micropendous3/src/.gitignore
delete mode 100644 boards/avr/at90usb/teensy-2.0/src/.gitignore
delete mode 100644 boards/avr/atmega/amber/src/.gitignore
delete mode 100644 boards/avr/atmega/drivers/Kconfig
delete mode 100644 boards/avr/atmega/moteino-mega/src/.gitignore
delete mode 100644 boards/hc/m9s12/demo9s12ne64/src/.gitignore
delete mode 100644 boards/hc/m9s12/drivers/Kconfig
delete mode 100644 boards/hc/m9s12/ne64badge/src/.gitignore
delete mode 100644 boards/mips/pic32mx/drivers/Kconfig
delete mode 100644 boards/mips/pic32mx/mirtoo/src/.gitignore
delete mode 100644 boards/mips/pic32mx/pic32mx-starterkit/src/.gitignore
delete mode 100644 boards/mips/pic32mx/pic32mx7mmb/src/.gitignore
delete mode 100644 boards/mips/pic32mx/sure-pic32mx/src/.gitignore
delete mode 100644 boards/mips/pic32mx/ubw32/src/.gitignore
delete mode 100644 boards/mips/pic32mz/drivers/Kconfig
delete mode 100644 boards/mips/pic32mz/flipnclick-pic32mz/src/.gitignore
delete mode 100644 boards/mips/pic32mz/pic32mz-starterkit/src/.gitignore
delete mode 100644 boards/misoc/lm32/drivers/Kconfig
delete mode 100644 boards/misoc/lm32/misoc/src/.gitignore
delete mode 100644 boards/or1k/mor1kx/drivers/Kconfig
delete mode 100644 boards/renesas/m16c/drivers/Kconfig
delete mode 100644 boards/renesas/m16c/skp16c26/src/.gitignore
delete mode 100644 boards/renesas/rx65n/drivers/Kconfig
create mode 100644 boards/renesas/rx65n/rx65n-grrose/configs/ipv6/defconfig
create mode 100644 boards/renesas/rx65n/rx65n-grrose/include/rx65n_gpio.h
create mode 100644 boards/renesas/rx65n/rx65n-grrose/src/rx65n_gpio.c
create mode 100644 boards/renesas/rx65n/rx65n-rsk1mb/include/rx65n_gpio.h
create mode 100644 boards/renesas/rx65n/rx65n-rsk1mb/src/rx65n_gpio.c
create mode 100644 boards/renesas/rx65n/rx65n-rsk2mb/configs/ipv6/defconfig
create mode 100644 boards/renesas/rx65n/rx65n-rsk2mb/include/rx65n_gpio.h
create mode 100644 boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_gpio.c
delete mode 100644 boards/renesas/sh1/drivers/Kconfig
delete mode 100644 boards/renesas/sh1/us7032evb1/src/.gitignore
delete mode 100644 boards/risc-v/fe310/drivers/Kconfig
delete mode 100644 boards/risc-v/gap8/drivers/Kconfig
delete mode 100644 boards/risc-v/k210/drivers/Kconfig
create mode 100644 boards/risc-v/k210/maix-bit/configs/knsh/defconfig
delete mode 100644 boards/risc-v/k210/maix-bit/kernel/.gitignore
delete mode 100644 boards/risc-v/litex/drivers/Kconfig
delete mode 100644 boards/risc-v/nr5m100/drivers/Kconfig
delete mode 100644 boards/sim/sim/drivers/Kconfig
delete mode 100644 boards/x86/qemu/drivers/Kconfig
delete mode 100644 boards/x86/qemu/qemu-i486/src/.gitignore
delete mode 100644 boards/x86_64/intel64/drivers/Kconfig
create mode 100644 boards/x86_64/intel64/qemu-intel64/configs/nsh/defconfig
delete mode 100644 boards/x86_64/intel64/qemu-intel64/src/.gitignore
create mode 100644 boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c
delete mode 100644 boards/xtensa/esp32/drivers/Kconfig
delete mode 100644 boards/z16/z16f/drivers/Kconfig
delete mode 100644 boards/z16/z16f/z16f2800100zcog/configs/nsh/.gitignore
delete mode 100644 boards/z16/z16f/z16f2800100zcog/configs/ostest/.gitignore
delete mode 100644 boards/z16/z16f/z16f2800100zcog/src/.gitignore
create mode 100644 boards/z16/z16f/z16f2800100zcog/src/z16f_appinit.c
delete mode 100644 boards/z80/ez80/drivers/Kconfig
delete mode 100644 boards/z80/ez80/ez80f910200kitg/configs/ostest/.gitignore
delete mode 100644 boards/z80/ez80/ez80f910200kitg/src/.gitignore
delete mode 100644 boards/z80/ez80/ez80f910200zco/configs/dhcpd/.gitignore
delete mode 100644 boards/z80/ez80/ez80f910200zco/configs/httpd/.gitignore
delete mode 100644 boards/z80/ez80/ez80f910200zco/configs/nettest/.gitignore
delete mode 100644 boards/z80/ez80/ez80f910200zco/configs/nsh/.gitignore
delete mode 100644 boards/z80/ez80/ez80f910200zco/configs/poll/.gitignore
delete mode 100644 boards/z80/ez80/ez80f910200zco/src/.gitignore
delete mode 100644 boards/z80/ez80/makerlisp/configs/nsh_flash/.gitignore
delete mode 100644 boards/z80/ez80/makerlisp/configs/nsh_ram/.gitignore
delete mode 100644 boards/z80/ez80/makerlisp/configs/sdboot/.gitignore
delete mode 100644 boards/z80/ez80/makerlisp/src/.gitignore
delete mode 100644 boards/z80/ez80/z20x/configs/hello/.gitignore
delete mode 100644 boards/z80/ez80/z20x/configs/nsh/.gitignore
delete mode 100644 boards/z80/ez80/z20x/configs/sdboot/.gitignore
delete mode 100644 boards/z80/ez80/z20x/configs/w25boot/.gitignore
delete mode 100644 boards/z80/ez80/z20x/src/.gitignore
delete mode 100644 boards/z80/z180/drivers/Kconfig
delete mode 100644 boards/z80/z8/drivers/Kconfig
delete mode 100644 boards/z80/z8/z8encore000zco/configs/ostest/.gitignore
delete mode 100644 boards/z80/z8/z8encore000zco/src/.gitignore
delete mode 100644 boards/z80/z8/z8f64200100kit/configs/ostest/.gitignore
delete mode 100644 boards/z80/z8/z8f64200100kit/src/.gitignore
rename {boards/z80/z80/drivers => drivers/dummy}/Kconfig (100%)
create mode 100644 drivers/sensors/hdc1008.c
create mode 100644 drivers/usbhost/usbhost_ft232r.c
delete mode 100644 fs/.gitignore
create mode 100644 fs/littlefs/.gitignore
delete mode 100644 fs/littlefs/DESIGN.md
delete mode 100644 fs/littlefs/README.md
delete mode 100644 fs/littlefs/SPEC.md
delete mode 100644 fs/littlefs/lfs.c
delete mode 100644 fs/littlefs/lfs.h
delete mode 100644 fs/littlefs/lfs_util.c
delete mode 100644 fs/littlefs/lfs_util.h
delete mode 100644 graphics/.gitignore
delete mode 100644 graphics/nxmu/.gitignore
create mode 100644 include/nuttx/sensors/hdc1008.h
create mode 100644 include/sys/syscall_lookup.h
delete mode 100644 libs/libc/bin/.gitignore
create mode 100644 libs/libc/errno/Make.defs
create mode 100644 libs/libc/errno/lib_errno.c
delete mode 100644 libs/libc/kbin/.gitignore
delete mode 100644 libs/libc/misc/lib_ioctl.c
create mode 100644 libs/libc/netdb/lib_dnsdefaultserver.c
create mode 100644 libs/libc/pthread/pthread_get_stackaddr_np.c
create mode 100644 libs/libc/pthread/pthread_get_stacksize_np.c
create mode 100644 libs/libc/pthread/pthread_getspecific.c
create mode 100644 libs/libc/pthread/pthread_keycreate.c
create mode 100644 libs/libc/pthread/pthread_keydelete.c
create mode 100644 libs/libc/pthread/pthread_setspecific.c
delete mode 100644 libs/libc/tls/tls_getelem.c
create mode 100644 libs/libc/tls/tls_getinfo.c
create mode 100644 libs/libc/tls/tls_getvalue.c
delete mode 100644 libs/libc/tls/tls_setelem.c
create mode 100644 libs/libc/tls/tls_setvalue.c
delete mode 100644 libs/libc/ubin/.gitignore
delete mode 100644 libs/libc/ubin/Makefile
delete mode 100644 libs/libc/userfs/.gitignore
delete mode 100644 libs/libnx/.gitignore
delete mode 100644 libs/libnx/bin/.gitignore
delete mode 100644 libs/libnx/kbin/.gitignore
delete mode 100644 libs/libnx/ubin/.gitignore
delete mode 100644 libs/libnx/ubin/Makefile
delete mode 100644 mm/.gitignore
delete mode 100644 mm/bin/.gitignore
delete mode 100644 mm/kbin/.gitignore
delete mode 100644 mm/ubin/.gitignore
delete mode 100644 mm/ubin/Makefile
delete mode 100644 net/.gitignore
create mode 100644 openamp/0001-rpmsg-remove-the-address-check-in-rpmsg_send-rpmsg_t.patch
create mode 100644 openamp/0001-system-nuttx-change-clock_systimespec-to-clock_systi.patch
create mode 100644 openamp/0002-rpmsg-merge-rpmsg_register_endpoint-into-rpmsg_init_.patch
create mode 100644 openamp/0003-rpmsg-shouldn-t-allocate-0-1023-address-in-rpmsg_cre.patch
create mode 100644 openamp/0004-rpmsg-wait-ept-ready-in-rpmsg_send.patch
create mode 100644 openamp/0005-rpmsg-return-fail-if-either-source-or-destination-ad.patch
create mode 100644 openamp/0006-remoteproc_mmap-support-va-to-pa-da-conversion.patch
create mode 100644 openamp/0007-rpmsg-bring-back-zero-copy-transfer.patch
create mode 100644 openamp/0008-ns-acknowledge-the-received-creation-message.patch
create mode 100644 openamp/0009-implement-rproc_virtio_read_config-rproc_virtio_writ.patch
create mode 100644 openamp/0010-Negotiate-individual-buffer-size-dynamically.patch
delete mode 100644 sched/.gitignore
create mode 100644 sched/clock/clock_systime_ticks.c
create mode 100644 sched/clock/clock_systime_timespec.c
delete mode 100644 sched/clock/clock_systimer.c
delete mode 100644 sched/clock/clock_systimespec.c
delete mode 100644 sched/errno/Make.defs
delete mode 100644 sched/errno/errno_get.c
delete mode 100644 sched/errno/errno_getptr.c
delete mode 100644 sched/errno/errno_set.c
create mode 100644 sched/group/group_tlsalloc.c
create mode 100644 sched/group/group_tlsfree.c
delete mode 100644 sched/pthread/pthread_get_stackaddr_np.c
delete mode 100644 sched/pthread/pthread_get_stacksize_np.c
delete mode 100644 sched/pthread/pthread_getspecific.c
delete mode 100644 sched/pthread/pthread_keycreate.c
delete mode 100644 sched/pthread/pthread_keydelete.c
delete mode 100644 sched/pthread/pthread_setspecific.c
create mode 100644 sched/sched/sched_get_stackinfo.c
delete mode 100644 syscall/syscall_lookup.h
create mode 100644 tools/incdir.c
delete mode 100644 tools/logparser.c
create mode 100755 tools/macar-rcs.sh
mode change 100755 => 100644 tools/zipme.sh
delete mode 100644 wireless/.gitignore
[incubator-nuttx] 03/31: net/: Add WIP initial framework for
SocketCAN sockets.
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 46c67a47a0d24cb9ea8939d1c2ce8ff9b1474f47
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Thu Feb 13 09:59:00 2020 -0600
net/: Add WIP initial framework for SocketCAN sockets.
---
net/Kconfig | 1 +
net/Makefile | 1 +
net/can/Kconfig | 26 ++
net/can/Make.defs | 32 ++
net/can/can.h | 154 +++++++++
net/can/can_conn.c | 225 ++++++++++++++
net/can/can_sockif.c | 810 ++++++++++++++++++++++++++++++++++++++++++++++++
net/net_initialize.c | 7 +
net/socket/net_sockif.c | 7 +
9 files changed, 1263 insertions(+)
diff --git a/net/Kconfig b/net/Kconfig
index fed3d01..70cacf6 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -344,6 +344,7 @@ source "net/socket/Kconfig"
source "net/inet/Kconfig"
source "net/pkt/Kconfig"
source "net/local/Kconfig"
+source "net/can/Kconfig"
source "net/netlink/Kconfig"
source "net/tcp/Kconfig"
source "net/udp/Kconfig"
diff --git a/net/Makefile b/net/Makefile
index 077d035..f8ffe85 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -52,6 +52,7 @@ include igmp/Make.defs
include pkt/Make.defs
include local/Make.defs
include mld/Make.defs
+include can/Make.defs
include netlink/Make.defs
include tcp/Make.defs
include udp/Make.defs
diff --git a/net/can/Kconfig b/net/can/Kconfig
new file mode 100644
index 0000000..2ae1f7b
--- /dev/null
+++ b/net/can/Kconfig
@@ -0,0 +1,26 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+menu "SocketCAN Support"
+
+config NET_CAN
+ bool "SocketCAN support"
+ default n
+ ---help---
+ Enable support for SocketCAN sockets that will permit.
+
+ This logic is a WIP. Currently only fragmentary support is
+ available, not enough to actually do anything of consequence.
+
+if NET_CAN
+
+config CAN_CONNS
+ int "Number of CAN connections"
+ default 4
+ ---help---
+ Maximum number of CAN connections (all tasks).
+
+endif # NET_CAN
+endmenu # CAN Socket Support
diff --git a/net/can/Make.defs b/net/can/Make.defs
new file mode 100644
index 0000000..bb9ef9f
--- /dev/null
+++ b/net/can/Make.defs
@@ -0,0 +1,32 @@
+############################################################################
+# net/can/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership. The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# Logic specific to SocketCAN socket support
+
+ifeq ($(CONFIG_NET_CAN),y)
+
+SOCK_CSRCS += can_sockif.c
+NET_CSRCS += can_conn.c
+
+# Include can build support
+
+DEPPATH += --dep-path can
+VPATH += :can
+endif
diff --git a/net/can/can.h b/net/can/can.h
new file mode 100644
index 0000000..6f41ce9
--- /dev/null
+++ b/net/can/can.h
@@ -0,0 +1,154 @@
+/****************************************************************************
+ * net/can/can.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __NET_CAN_CAN_H
+#define __NET_CAN_CAN_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <poll.h>
+
+#include <netpacket/can.h>
+#include <nuttx/semaphore.h>
+
+#include "devif/devif.h"
+#include "socket/socket.h"
+
+#ifdef CONFIG_NET_CAN
+
+/****************************************************************************
+ * Public Type Definitions
+ ****************************************************************************/
+
+/* This "connection" structure describes the underlying state of the socket. */
+
+struct can_conn_s
+{
+ /* Common prologue of all connection structures. */
+
+ dq_entry_t node; /* Supports a doubly linked list */
+
+ /* This is a list of NetLink connection callbacks. Each callback
+ * represents a thread that is stalled, waiting for a device-specific
+ * event.
+ */
+
+ FAR struct devif_callback_s *list; /* NetLink callbacks */
+
+ /* CAN-specific content follows */
+
+ uint8_t protocol; /* Selected CAN protocol */
+ int16_t crefs; /* Reference count */
+
+ /* poll() support */
+
+ FAR sem_t *pollsem; /* Used to wakeup poll() */
+ FAR pollevent_t *pollevent; /* poll() wakeup event */
+};
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+#ifdef __cplusplus
+# define EXTERN extern "C"
+extern "C"
+{
+#else
+# define EXTERN extern
+#endif
+
+EXTERN const struct sock_intf_s g_can_sockif;
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+struct sockaddr_can; /* Forward reference */
+
+/****************************************************************************
+ * Name: can_initialize()
+ *
+ * Description:
+ * Initialize the NetLink connection structures. Called once and only
+ * from the networking layer.
+ *
+ ****************************************************************************/
+
+void can_initialize(void);
+
+/****************************************************************************
+ * Name: can_alloc()
+ *
+ * Description:
+ * Allocate a new, uninitialized NetLink connection structure. This is
+ * normally something done by the implementation of the socket() API
+ *
+ ****************************************************************************/
+
+FAR struct can_conn_s *can_alloc(void);
+
+/****************************************************************************
+ * Name: can_free()
+ *
+ * Description:
+ * Free a NetLink connection structure that is no longer in use. This should
+ * be done by the implementation of close().
+ *
+ ****************************************************************************/
+
+void can_free(FAR struct can_conn_s *conn);
+
+/****************************************************************************
+ * Name: can_nextconn()
+ *
+ * Description:
+ * Traverse the list of allocated NetLink connections
+ *
+ * Assumptions:
+ * This function is called from NetLink device logic.
+ *
+ ****************************************************************************/
+
+FAR struct can_conn_s *can_nextconn(FAR struct can_conn_s *conn);
+
+/****************************************************************************
+ * Name: can_active()
+ *
+ * Description:
+ * Find a connection structure that is the appropriate connection for the
+ * provided NetLink address
+ *
+ ****************************************************************************/
+
+FAR struct can_conn_s *can_active(FAR struct sockaddr_can *addr);
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CONFIG_NET_CAN */
+#endif /* __NET_CAN_CAN_H */
diff --git a/net/can/can_conn.c b/net/can/can_conn.c
new file mode 100644
index 0000000..77733b3
--- /dev/null
+++ b/net/can/can_conn.c
@@ -0,0 +1,225 @@
+/****************************************************************************
+ * net/can/can_conn.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <string.h>
+#include <queue.h>
+#include <assert.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <arch/irq.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/semaphore.h>
+#include <nuttx/net/netconfig.h>
+#include <nuttx/net/net.h>
+
+#include "utils/utils.h"
+#include "can/can.h"
+
+#ifdef CONFIG_NET_CAN
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* The array containing all NetLink connections. */
+
+static struct can_conn_s g_can_connections[CONFIG_CAN_CONNS];
+
+/* A list of all free NetLink connections */
+
+static dq_queue_t g_free_can_connections;
+static sem_t g_free_sem;
+
+/* A list of all allocated NetLink connections */
+
+static dq_queue_t g_active_can_connections;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: _can_semtake() and _can_semgive()
+ *
+ * Description:
+ * Take/give semaphore
+ *
+ ****************************************************************************/
+
+static void _can_semtake(FAR sem_t *sem)
+{
+ net_lockedwait_uninterruptible(sem);
+}
+
+static void _can_semgive(FAR sem_t *sem)
+{
+ nxsem_post(sem);
+}
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: can_initialize()
+ *
+ * Description:
+ * Initialize the User Socket connection structures. Called once and only
+ * from the networking layer.
+ *
+ ****************************************************************************/
+
+void can_initialize(void)
+{
+ int i;
+
+ /* Initialize the queues */
+
+ dq_init(&g_free_can_connections);
+ dq_init(&g_active_can_connections);
+ nxsem_init(&g_free_sem, 0, 1);
+
+ for (i = 0; i < CONFIG_CAN_CONNS; i++)
+ {
+ FAR struct can_conn_s *conn = &g_can_connections[i];
+
+ /* Mark the connection closed and move it to the free list */
+
+ memset(conn, 0, sizeof(*conn));
+ dq_addlast(&conn->node, &g_free_can_connections);
+ }
+}
+
+/****************************************************************************
+ * Name: can_alloc()
+ *
+ * Description:
+ * Allocate a new, uninitialized NetLink connection structure. This is
+ * normally something done by the implementation of the socket() API
+ *
+ ****************************************************************************/
+
+FAR struct can_conn_s *can_alloc(void)
+{
+ FAR struct can_conn_s *conn;
+
+ /* The free list is protected by a semaphore (that behaves like a mutex). */
+
+ _can_semtake(&g_free_sem);
+ conn = (FAR struct can_conn_s *)dq_remfirst(&g_free_can_connections);
+ if (conn != NULL)
+ {
+ /* Make sure that the connection is marked as uninitialized */
+
+ memset(conn, 0, sizeof(*conn));
+
+ /* Enqueue the connection into the active list */
+
+ dq_addlast(&conn->node, &g_active_can_connections);
+ }
+
+ _can_semgive(&g_free_sem);
+ return conn;
+}
+
+/****************************************************************************
+ * Name: can_free()
+ *
+ * Description:
+ * Free a NetLink connection structure that is no longer in use. This should
+ * be done by the implementation of close().
+ *
+ ****************************************************************************/
+
+void can_free(FAR struct can_conn_s *conn)
+{
+ /* The free list is protected by a semaphore (that behaves like a mutex). */
+
+ DEBUGASSERT(conn->crefs == 0);
+
+ _can_semtake(&g_free_sem);
+
+ /* Remove the connection from the active list */
+
+ dq_rem(&conn->node, &g_active_can_connections);
+
+ /* Reset structure */
+
+ memset(conn, 0, sizeof(*conn));
+
+ /* Free the connection */
+
+ dq_addlast(&conn->node, &g_free_can_connections);
+ _can_semgive(&g_free_sem);
+}
+
+/****************************************************************************
+ * Name: can_nextconn()
+ *
+ * Description:
+ * Traverse the list of allocated NetLink connections
+ *
+ * Assumptions:
+ * This function is called from NetLink device logic.
+ *
+ ****************************************************************************/
+
+FAR struct can_conn_s *can_nextconn(FAR struct can_conn_s *conn)
+{
+ if (conn == NULL)
+ {
+ return (FAR struct can_conn_s *)g_active_can_connections.head;
+ }
+ else
+ {
+ return (FAR struct can_conn_s *)conn->node.flink;
+ }
+}
+
+/****************************************************************************
+ * Name: can_active
+ *
+ * Description:
+ * Find a connection structure that is the appropriate connection for the
+ * provided NetLink address
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+FAR struct can_conn_s *can_active(FAR struct sockaddr_can *addr)
+{
+ /* This function is used to handle routing of incoming messages to sockets
+ * connected to the address. There is no such use case for NetLink
+ * sockets.
+ */
+
+ return NULL;
+}
+
+#endif /* CONFIG_NET_CAN */
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
new file mode 100644
index 0000000..b7e3fe6
--- /dev/null
+++ b/net/can/can_sockif.c
@@ -0,0 +1,810 @@
+/****************************************************************************
+ * net/can/can_sockif.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdbool.h>
+#include <string.h>
+#include <poll.h>
+#include <sched.h>
+#include <assert.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/kmalloc.h>
+#include <nuttx/semaphore.h>
+#include <nuttx/wqueue.h>
+#include <nuttx/net/net.h>
+
+#include "can/can.h"
+
+#ifdef CONFIG_NET_CAN
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int can_setup(FAR struct socket *psock, int protocol);
+static sockcaps_t can_sockcaps(FAR struct socket *psock);
+static void can_addref(FAR struct socket *psock);
+static int can_bind(FAR struct socket *psock,
+ FAR const struct sockaddr *addr, socklen_t addrlen);
+static int can_getsockname(FAR struct socket *psock,
+ FAR struct sockaddr *addr, FAR socklen_t *addrlen);
+static int can_getpeername(FAR struct socket *psock,
+ FAR struct sockaddr *addr, FAR socklen_t *addrlen);
+static int can_listen(FAR struct socket *psock, int backlog);
+static int can_connect(FAR struct socket *psock,
+ FAR const struct sockaddr *addr, socklen_t addrlen);
+static int can_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
+ FAR socklen_t *addrlen, FAR struct socket *newsock);
+static int can_poll(FAR struct socket *psock, FAR struct pollfd *fds,
+ bool setup);
+static ssize_t can_send(FAR struct socket *psock,
+ FAR const void *buf, size_t len, int flags);
+static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
+ size_t len, int flags, FAR const struct sockaddr *to,
+ socklen_t tolen);
+static ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
+ size_t len, int flags, FAR struct sockaddr *from,
+ FAR socklen_t *fromlen);
+static int can_close(FAR struct socket *psock);
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+const struct sock_intf_s g_can_sockif =
+{
+ can_setup, /* si_setup */
+ can_sockcaps, /* si_sockcaps */
+ can_addref, /* si_addref */
+ can_bind, /* si_bind */
+ can_getsockname, /* si_getsockname */
+ can_getpeername, /* si_getpeername */
+ can_listen, /* si_listen */
+ can_connect, /* si_connect */
+ can_accept, /* si_accept */
+ can_poll, /* si_poll */
+ can_send, /* si_send */
+ can_sendto, /* si_sendto */
+#ifdef CONFIG_NET_SENDFILE
+ NULL, /* si_sendfile */
+#endif
+ can_recvfrom, /* si_recvfrom */
+ can_close /* si_close */
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: inet_setup
+ *
+ * Description:
+ * Called for socket() to verify that the provided socket type and
+ * protocol are usable by this address family. Perform any family-
+ * specific socket fields.
+ *
+ * Input Parameters:
+ * psock - A pointer to a user allocated socket structure to be
+ * initialized.
+ * protocol - NetLink socket protocol (see sys/socket.h)
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success. Otherwise, a negated errno value is
+ * returned.
+ *
+ ****************************************************************************/
+
+static int can_setup(FAR struct socket *psock, int protocol)
+{
+ int domain = psock->s_domain;
+ int type = psock->s_type;
+
+ /* Verify that the protocol is supported */
+
+ DEBUGASSERT((unsigned int)protocol <= UINT8_MAX);
+
+ switch (protocol)
+ {
+ case CAN_RAW: /* RAW sockets */
+ case CAN_BCM: /* Broadcast Manager */
+ case CAN_TP16: /* VAG Transport Protocol v1.6 */
+ case CAN_TP20: /* VAG Transport Protocol v2.0 */
+ case CAN_MCNET: /* Bosch MCNet */
+ case CAN_ISOTP: /* ISO 15765-2 Transport Protocol */
+ case CAN_J1939: /* SAE J1939 */
+ break;
+
+ default:
+ return -EPROTONOSUPPORT;
+ }
+
+ /* Verify the socket type (domain should always be PF_CAN here) */
+
+ if (domain == PF_CAN && (type == SOCK_RAW || type == SOCK_DGRAM))
+ {
+ /* Allocate the NetLink socket connection structure and save it in the
+ * new socket instance.
+ */
+
+ FAR struct can_conn_s *conn = can_alloc();
+ if (conn == NULL)
+ {
+ /* Failed to reserve a connection structure */
+
+ return -ENOMEM;
+ }
+
+ /* Initialize the connection instance */
+
+ conn->protocol = (uint8_t)protocol;
+
+ /* Set the reference count on the connection structure. This
+ * reference count will be incremented only if the socket is
+ * dup'ed
+ */
+
+ conn->crefs = 1;
+
+ /* Attach the connection instance to the socket */
+
+ psock->s_conn = conn;
+ return OK;
+ }
+
+ return -EPROTONOSUPPORT;
+}
+
+/****************************************************************************
+ * Name: can_sockcaps
+ *
+ * Description:
+ * Return the bit encoded capabilities of this socket.
+ *
+ * Input Parameters:
+ * psock - Socket structure of the socket whose capabilities are being
+ * queried.
+ *
+ * Returned Value:
+ * The non-negative set of socket capabilities is returned.
+ *
+ ****************************************************************************/
+
+static sockcaps_t can_sockcaps(FAR struct socket *psock)
+{
+ /* Permit vfcntl to set socket to non-blocking */
+
+ return SOCKCAP_NONBLOCKING;
+}
+
+/****************************************************************************
+ * Name: can_addref
+ *
+ * Description:
+ * Increment the reference count on the underlying connection structure.
+ *
+ * Input Parameters:
+ * psock - Socket structure of the socket whose reference count will be
+ * incremented.
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+static void can_addref(FAR struct socket *psock)
+{
+ FAR struct can_conn_s *conn;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL);
+
+ conn = psock->s_conn;
+ DEBUGASSERT(conn->crefs > 0 && conn->crefs < 255);
+ conn->crefs++;
+}
+
+/****************************************************************************
+ * Name: can_bind
+ *
+ * Description:
+ * can_bind() gives the socket 'conn' the local address 'addr'. 'addr'
+ * is 'addrlen' bytes long. Traditionally, this is called "assigning a name
+ * to a socket." When a socket is created with socket, it exists in a name
+ * space (address family) but has no name assigned.
+ *
+ * Input Parameters:
+ * conn NetLink socket connection structure
+ * addr Socket local address
+ * addrlen Length of 'addr'
+ *
+ * Returned Value:
+ * 0 on success; -1 on error with errno set appropriately
+ *
+ * EACCES
+ * The address is protected, and the user is not the superuser.
+ * EADDRINUSE
+ * The given address is already in use.
+ * EINVAL
+ * The socket is already bound to an address.
+ * ENOTSOCK
+ * psock is a descriptor for a file, not a socket.
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static int can_bind(FAR struct socket *psock,
+ FAR const struct sockaddr *addr, socklen_t addrlen)
+{
+ FAR struct sockaddr_can *canaddr;
+ FAR struct can_conn_s *conn;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL && addr != NULL &&
+ addrlen >= sizeof(struct sockaddr_can));
+
+ /* Save the address information in the connection structure */
+
+ canaddr = (FAR struct sockaddr_can *)addr;
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+#warning Missing logic
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: can_getsockname
+ *
+ * Description:
+ * The getsockname() function retrieves the locally-bound name of the
+ * specified socket, stores this address in the sockaddr structure pointed
+ * to by the 'addr' argument, and stores the length of this address in the
+ * object pointed to by the 'addrlen' argument.
+ *
+ * If the actual length of the address is greater than the length of the
+ * supplied sockaddr structure, the stored address will be truncated.
+ *
+ * If the socket has not been bound to a local name, the value stored in
+ * the object pointed to by address is unspecified.
+ *
+ * Input Parameters:
+ * conn NetLink socket connection structure
+ * addr sockaddr structure to receive data [out]
+ * addrlen Length of sockaddr structure [in/out]
+ *
+ ****************************************************************************/
+
+static int can_getsockname(FAR struct socket *psock,
+ FAR struct sockaddr *addr,
+ FAR socklen_t *addrlen)
+{
+ FAR struct sockaddr_can *canaddr;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL && addr != NULL &&
+ addrlen != NULL && *addrlen >= sizeof(struct sockaddr_can));
+
+ /* Return the address information in the address structure */
+
+ canaddr = (FAR struct sockaddr_can *)addr;
+ memset(canaddr, 0, sizeof(struct sockaddr_can));
+
+ canaddr->can_family = AF_CAN;
+
+ if (_SS_ISBOUND(psock->s_flags))
+ {
+ FAR struct can_conn_s *conn;
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+#warning Missing logic
+ }
+
+ *addrlen = sizeof(struct sockaddr_can);
+ return OK;
+}
+
+/****************************************************************************
+ * Name: can_getpeername
+ *
+ * Description:
+ * The can_getpeername() function retrieves the remote-connected name
+ * of the specified packet socket, stores this address in the sockaddr
+ * structure pointed to by the 'addr' argument, and stores the length of
+ * this address in the object pointed to by the 'addrlen' argument.
+ *
+ * If the actual length of the address is greater than the length of the
+ * supplied sockaddr structure, the stored address will be truncated.
+ *
+ * If the socket has not been bound to a local name, the value stored in
+ * the object pointed to by address is unspecified.
+ *
+ * Parameters:
+ * psock Socket structure of the socket to be queried
+ * addr sockaddr structure to receive data [out]
+ * addrlen Length of sockaddr structure [in/out]
+ *
+ * Returned Value:
+ * On success, 0 is returned, the 'addr' argument points to the address
+ * of the socket, and the 'addrlen' argument points to the length of the
+ * address. Otherwise, a negated errno value is returned. See
+ * getpeername() for the list of appropriate error numbers.
+ *
+ ****************************************************************************/
+
+static int can_getpeername(FAR struct socket *psock,
+ FAR struct sockaddr *addr,
+ FAR socklen_t *addrlen)
+{
+#warning Missing logic
+ return -EOPNOTSUPP; /* Or maybe return -EAFNOSUPPORT; */
+}
+
+/****************************************************************************
+ * Name: can_listen
+ *
+ * Description:
+ * To accept connections, a socket is first created with psock_socket(), a
+ * willingness to accept incoming connections and a queue limit for
+ * incoming connections are specified with psock_listen(), and then the
+ * connections are accepted with psock_accept(). For the case of AFINET
+ * and AFINET6 sockets, psock_listen() calls this function. The
+ * psock_listen() call applies only to sockets of type SOCK_STREAM or
+ * SOCK_SEQPACKET.
+ *
+ * Input Parameters:
+ * psock Reference to an internal, bound socket structure.
+ * backlog The maximum length the queue of pending connections may grow.
+ * If a connection request arrives with the queue full, the client
+ * may receive an error with an indication of ECONNREFUSED or,
+ * if the underlying protocol supports retransmission, the request
+ * may be ignored so that retries succeed.
+ *
+ * Returned Value:
+ * On success, zero is returned. On error, a negated errno value is
+ * returned. See list() for the set of appropriate error values.
+ *
+ ****************************************************************************/
+
+static int can_listen(FAR struct socket *psock, int backlog)
+{
+#warning Missing logic
+ return -EOPNOTSUPP;
+}
+
+/****************************************************************************
+ * Name: can_connect
+ *
+ * Description:
+ * Perform a can connection
+ *
+ * Input Parameters:
+ * psock A reference to the socket structure of the socket to be connected
+ * addr The address of the remote server to connect to
+ * addrlen Length of address buffer
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static int can_connect(FAR struct socket *psock,
+ FAR const struct sockaddr *addr,
+ socklen_t addrlen)
+{
+#warning Missing logic
+ return -EOPNOTSUPP;
+}
+
+/****************************************************************************
+ * Name: can_accept
+ *
+ * Description:
+ * The can_accept function is used with connection-based socket
+ * types (SOCK_STREAM, SOCK_SEQPACKET and SOCK_RDM). It extracts the first
+ * connection request on the queue of pending connections, creates a new
+ * connected socket with mostly the same properties as 'sockfd', and
+ * allocates a new socket descriptor for the socket, which is returned. The
+ * newly created socket is no longer in the listening state. The original
+ * socket 'sockfd' is unaffected by this call. Per file descriptor flags
+ * are not inherited across an inet_accept.
+ *
+ * The 'sockfd' argument is a socket descriptor that has been created with
+ * socket(), bound to a local address with bind(), and is listening for
+ * connections after a call to listen().
+ *
+ * On return, the 'addr' structure is filled in with the address of the
+ * connecting entity. The 'addrlen' argument initially contains the size
+ * of the structure pointed to by 'addr'; on return it will contain the
+ * actual length of the address returned.
+ *
+ * If no pending connections are present on the queue, and the socket is
+ * not marked as non-blocking, inet_accept blocks the caller until a
+ * connection is present. If the socket is marked non-blocking and no
+ * pending connections are present on the queue, inet_accept returns
+ * EAGAIN.
+ *
+ * Input Parameters:
+ * psock Reference to the listening socket structure
+ * addr Receives the address of the connecting client
+ * addrlen Input: Allocated size of 'addr'
+ * Return: Actual size returned size of 'addr'
+ * newsock Location to return the accepted socket information.
+ *
+ * Returned Value:
+ * Returns 0 (OK) on success. On failure, it returns a negated errno
+ * value. See accept() for a description of the appropriate error value.
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+static int can_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
+ FAR socklen_t *addrlen, FAR struct socket *newsock)
+{
+#warning Missing logic
+ return -EOPNOTSUPP;
+}
+
+/****************************************************************************
+ * Name: can_poll
+ *
+ * Description:
+ * The standard poll() operation redirects operations on socket descriptors
+ * to this function.
+ *
+ * POLLUP: Will never be reported
+ * POLLERR: Reported in the event of any failure.
+ * POLLOUT: Always reported if requested.
+ * POLLIN: Reported if requested but only when pending response data is
+ * available
+ *
+ * Input Parameters:
+ * psock - An instance of the internal socket structure.
+ * fds - The structure describing the events to be monitored.
+ * setup - true: Setup up the poll; false: Tear down the poll
+ *
+ * Returned Value:
+ * 0: Success; Negated errno on failure
+ *
+ ****************************************************************************/
+
+static int can_poll(FAR struct socket *psock, FAR struct pollfd *fds,
+ bool setup)
+{
+ FAR struct can_conn_s *conn;
+ int ret;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL);
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+
+ /* Check if we are setting up or tearing down the poll */
+
+ if (setup)
+ {
+ /* If POLLOUT is selected, return immediately (maybe) */
+
+ pollevent_t revents = POLLOUT;
+
+ /* If POLLIN is selected and a response is available, return
+ * immediately if POLLIN and/or POLLIN are included in the
+ * requested event set.
+ */
+
+ net_lock();
+
+#warning Missing logic
+
+ revents &= fds->events;
+ if (revents != 0)
+ {
+ fds->revents = revents;
+ nxsem_post(fds->sem);
+ net_unlock();
+ return OK;
+ }
+
+ /* Set up to be notified when a response is available if POLLIN is
+ * requested.
+ */
+
+ if ((fds->events & POLLIN) != 0)
+ {
+ /* Some limitations: There can be only a single outstanding POLLIN
+ * on the CAN connection.
+ */
+
+ if (conn->pollsem != NULL || conn->pollevent != NULL)
+ {
+ nerr("ERROR: Multiple polls() on socket not supported.\n");
+ net_unlock();
+ return -EBUSY;
+ }
+
+ /* Set up the notification */
+
+ conn->pollsem = fds->sem;
+ conn->pollevent = &fds->revents;
+
+#warning Missing logic
+
+ if (ret < 0)
+ {
+ /* Failed to set up notification */
+
+ conn->pollsem = NULL;
+ conn->pollevent = NULL;
+ }
+ else
+ {
+ /* Setup to receive a notification when CAN data is available */
+
+#warning Missing logic
+
+ ret = OK;
+ }
+ }
+
+ /* Set up to be notified when we are able to send CAN data without
+ * waiting.
+ */
+
+ else if ((fds->events & POLLOUT) != 0)
+ {
+ }
+ else
+ {
+ /* There will not be any wakeups coming? Probably an error? */
+
+ ret = OK;
+ }
+
+ net_unlock();
+ }
+ else
+ {
+ /* Cancel any response notifications */
+
+ conn->pollsem = NULL;
+ conn->pollevent = NULL;
+ }
+
+ return ret;
+}
+
+/****************************************************************************
+ * Name: can_send
+ *
+ * Description:
+ * The can_send() call may be used only when the socket is in
+ * a connected state (so that the intended recipient is known).
+ *
+ * Input Parameters:
+ * psock - An instance of the internal socket structure.
+ * buf - Data to send
+ * len - Length of data to send
+ * flags - Send flags (ignored)
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. On error, a negated
+ * errno value is returned (see send() for the list of appropriate error
+ * values.
+ *
+ ****************************************************************************/
+
+static ssize_t can_send(FAR struct socket *psock, FAR const void *buf,
+ size_t len, int flags)
+{
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL && buf != NULL);
+
+ /* The socket must be connected in order to use send */
+
+ if (_SS_ISBOUND(psock->s_flags))
+ {
+ FAR struct can_conn_s *conn;
+ struct sockaddr_can canaddr;
+
+ /* Get the underlying connection structure */
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+
+ /* Format the address */
+
+ canaddr.can_family = AF_CAN;
+#warning Missing logic
+
+ /* Then let sendto() perform the actual send operation */
+
+ return can_sendto(psock, buf, len, flags,
+ (FAR const struct sockaddr *)&canaddr,
+ sizeof(struct sockaddr_can));
+ }
+
+ /* EDESTADDRREQ. Signifies that the socket is not connection-mode and no
+ * peer address is set.
+ */
+
+ return -EDESTADDRREQ;
+}
+
+/****************************************************************************
+ * Name: can_sendto
+ *
+ * Description:
+ * If sendto() is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET)
+ * socket, the parameters to and 'tolen' are ignored (and the error EISCONN
+ * may be returned when they are not NULL and 0), and the error ENOTCONN is
+ * returned when the socket was not actually connected.
+ *
+ * Input Parameters:
+ * psock A reference to the socket structure of the socket to be connected
+ * buf Data to send
+ * len Length of data to send
+ * flags Send flags (ignored)
+ * to Address of recipient
+ * tolen The length of the address structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
+ size_t len, int flags,
+ FAR const struct sockaddr *to, socklen_t tolen)
+{
+ FAR struct can_conn_s *conn;
+ int ret;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL && buf != NULL &&
+ to != NULL && tolen >= sizeof(struct sockaddr_can));
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+#warning Missing logic
+
+ switch (conn->protocol)
+ {
+#warning Missing logic
+
+ default:
+ ret = -EOPNOTSUPP;
+ break;
+ }
+
+ return ret;
+}
+
+/****************************************************************************
+ * Name: can_recvfrom
+ *
+ * Description:
+ * recvfrom() receives messages from a socket, and may be used to receive
+ * data on a socket whether or not it is connection-oriented.
+ *
+ * If from is not NULL, and the underlying protocol provides the source
+ * address, this source address is filled in. The argument 'fromlen'
+ * initialized to the size of the buffer associated with from, and modified
+ * on return to indicate the actual size of the address stored there.
+ *
+ * Input Parameters:
+ * psock A pointer to a NuttX-specific, internal socket structure
+ * buf Buffer to receive data
+ * len Length of buffer
+ * flags Receive flags (ignored)
+ * from Address of source (may be NULL)
+ * fromlen The length of the address structure
+ *
+ ****************************************************************************/
+
+static ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
+ size_t len, int flags,
+ FAR struct sockaddr *from,
+ FAR socklen_t *fromlen)
+{
+ FAR struct can_conn_s *conn;
+ int ret;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL && buf != NULL);
+ DEBUGASSERT(from == NULL ||
+ (fromlen != NULL && *fromlen >= sizeof(struct sockaddr_can)));
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+#warning Missing logic
+
+ switch (conn->protocol)
+ {
+#warning Missing logic
+
+ default:
+ ret = -EOPNOTSUPP;
+ break;
+ }
+
+ return ret;
+}
+
+/****************************************************************************
+ * Name: can_close
+ *
+ * Description:
+ * Performs the close operation on a NetLink socket instance
+ *
+ * Input Parameters:
+ * psock Socket instance
+ *
+ * Returned Value:
+ * 0 on success; -1 on error with errno set appropriately.
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static int can_close(FAR struct socket *psock)
+{
+ FAR struct can_conn_s *conn = psock->s_conn;
+ int ret = OK;
+
+ /* Perform some pre-close operations for the CAN socket type. */
+
+ /* Is this the last reference to the connection structure (there
+ * could be more if the socket was dup'ed).
+ */
+
+ if (conn->crefs <= 1)
+ {
+ /* Yes... inform user-space daemon of socket close. */
+
+#warning Missing logic
+
+ /* Free the connection structure */
+
+ conn->crefs = 0;
+ can_free(psock->s_conn);
+
+ if (ret < 0)
+ {
+ /* Return with error code, but free resources. */
+
+ nerr("ERROR: can_close failed: %d\n", ret);
+ return ret;
+ }
+ }
+ else
+ {
+ /* No.. Just decrement the reference count */
+
+ conn->crefs--;
+ }
+
+ return ret;
+}
+
+#endif /* CONFIG_NET_CAN */
diff --git a/net/net_initialize.c b/net/net_initialize.c
index eb82777..bedc4e3 100644
--- a/net/net_initialize.c
+++ b/net/net_initialize.c
@@ -59,6 +59,7 @@
#include "bluetooth/bluetooth.h"
#include "ieee802154/ieee802154.h"
#include "local/local.h"
+#include "can/can.h"
#include "netlink/netlink.h"
#include "igmp/igmp.h"
#include "route/route.h"
@@ -158,6 +159,12 @@ void net_initialize(void)
local_initialize();
#endif
+#ifdef CONFIG_NET_CAN
+ /* Initialize SocketCAN support */
+
+ can_initialize();
+#endif
+
#ifdef CONFIG_NET_NETLINK
/* Initialize the Netlink IPC support */
diff --git a/net/socket/net_sockif.c b/net/socket/net_sockif.c
index 01e8368..cc956d8 100644
--- a/net/socket/net_sockif.c
+++ b/net/socket/net_sockif.c
@@ -47,6 +47,7 @@
#include "inet/inet.h"
#include "local/local.h"
+#include "can/can.h"
#include "netlink/netlink.h"
#include "pkt/pkt.h"
#include "bluetooth/bluetooth.h"
@@ -104,6 +105,12 @@ net_sockif(sa_family_t family, int type, int protocol)
break;
#endif
+#ifdef CONFIG_NET_CAN
+ case PF_CAN:
+ sockif = &g_can_sockif;
+ break;
+#endif
+
#ifdef CONFIG_NET_NETLINK
case PF_NETLINK:
sockif = &g_netlink_sockif;
[incubator-nuttx] 11/31: Added CAN_RAW_FD_FRAMES sockopt support
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 1fa53edb62ae731af44ef7677f7b422fad547d95
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Feb 26 13:36:24 2020 +0100
Added CAN_RAW_FD_FRAMES sockopt support
Also CAN FD is disabled on startup, which is default behaviour for SocketCAN
---
net/can/can.h | 10 ++++++++++
net/can/can_conn.c | 3 +++
net/can/can_getsockopt.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++
net/can/can_recvfrom.c | 28 +++++++++++++++++++++++----
net/can/can_send.c | 50 ++++++++++++++++++++++++++++++------------------
net/can/can_setsockopt.c | 21 +++++++++++++++++---
net/socket/getsockopt.c | 4 ++--
net/socket/setsockopt.c | 6 ++++++
8 files changed, 142 insertions(+), 28 deletions(-)
diff --git a/net/can/can.h b/net/can/can.h
index 67c8d6f..5992deb 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -104,6 +104,16 @@ struct can_conn_s
*/
struct can_poll_s pollinfo[4]; /* FIXME make dynamic */
+
+#ifdef CONFIG_NET_CANPROTO_OPTIONS
+ int32_t loopback;
+ int32_t recv_own_msgs;
+ int32_t fd_frames;
+
+ /* TODO add filter support */
+#endif
+
+
};
/****************************************************************************
diff --git a/net/can/can_conn.c b/net/can/can_conn.c
index 4969f6d..21622b5 100644
--- a/net/can/can_conn.c
+++ b/net/can/can_conn.c
@@ -138,6 +138,9 @@ FAR struct can_conn_s *can_alloc(void)
/* Make sure that the connection is marked as uninitialized */
memset(conn, 0, sizeof(*conn));
+
+ /* FIXME SocketCAN default behavior enables loopback */
+
/* Enqueue the connection into the active list */
diff --git a/net/can/can_getsockopt.c b/net/can/can_getsockopt.c
index 1fe8218..91720ad 100644
--- a/net/can/can_getsockopt.c
+++ b/net/can/can_getsockopt.c
@@ -114,12 +114,60 @@ int can_getsockopt(FAR struct socket *psock, int option,
break;
case CAN_RAW_LOOPBACK:
+ if (*value_len < sizeof(conn->loopback))
+ {
+ /* REVISIT: POSIX says that we should truncate the value if it
+ * is larger than value_len. That just doesn't make sense
+ * to me in this case.
+ */
+
+ ret = -EINVAL;
+ }
+ else
+ {
+ FAR int *loopback = (FAR int32_t *)value;
+ *loopback = conn->loopback;
+ *value_len = sizeof(conn->loopback);
+ ret = OK;
+ }
break;
case CAN_RAW_RECV_OWN_MSGS:
+ if (*value_len < sizeof(conn->recv_own_msgs))
+ {
+ /* REVISIT: POSIX says that we should truncate the value if it
+ * is larger than value_len. That just doesn't make sense
+ * to me in this case.
+ */
+
+ ret = -EINVAL;
+ }
+ else
+ {
+ FAR int *recv_own_msgs = (FAR int32_t *)value;
+ *recv_own_msgs = conn->recv_own_msgs;
+ *value_len = sizeof(conn->recv_own_msgs);
+ ret = OK;
+ }
break;
case CAN_RAW_FD_FRAMES:
+ if (*value_len < sizeof(conn->fd_frames))
+ {
+ /* REVISIT: POSIX says that we should truncate the value if it
+ * is larger than value_len. That just doesn't make sense
+ * to me in this case.
+ */
+
+ ret = -EINVAL;
+ }
+ else
+ {
+ FAR int *fd_frames = (FAR int32_t *)value;
+ *fd_frames = conn->fd_frames;
+ *value_len = sizeof(conn->fd_frames);
+ ret = OK;
+ }
break;
case CAN_RAW_JOIN_FILTERS:
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index d2f71a6..f83d07c 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -276,6 +276,16 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
IOBUSER_NET_CAN_READAHEAD);
}
+ /* do not pass frames with DLC > 8 to a legacy socket */
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame *)pstate->pr_buffer;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ return 0;
+ }
+ }
+
return recvlen;
}
@@ -287,6 +297,7 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
FAR void *pvpriv, uint16_t flags)
{
struct can_recvfrom_s *pstate = (struct can_recvfrom_s *)pvpriv;
+ struct can_conn_s *conn = (struct can_conn_s *)pstate->pr_sock->s_conn;
/* 'priv' might be null in some race conditions (?) */
@@ -296,6 +307,18 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
if ((flags & CAN_NEWDATA) != 0)
{
+ /* do not pass frames with DLC > 8 to a legacy socket */
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame *)dev->d_appdata;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ /* DO WE NEED TO CLEAR FLAGS?? */
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
+ }
+
/* Copy the packet */
can_newdata(dev, pstate);
@@ -355,10 +378,7 @@ static ssize_t can_recvfrom_result(int result,
if (pstate->pr_result < 0)
{
- /* This might return EAGAIN on a timeout or ENOTCONN on loss of
- * connection (CAN only)
- */
-
+ /* This might return EAGAIN on a timeout */
return pstate->pr_result;
}
diff --git a/net/can/can_send.c b/net/can/can_send.c
index 6b7a609..1d8677d 100644
--- a/net/can/can_send.c
+++ b/net/can/can_send.c
@@ -184,6 +184,21 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
{
return -ENODEV;
}
+
+ if(conn->fd_frames)
+ {
+ if(len != CANFD_MTU && len != CAN_MTU)
+ {
+ return -EINVAL;
+ }
+ }
+ else
+ {
+ if(len != CAN_MTU)
+ {
+ return -EINVAL;
+ }
+ }
/* Perform the send operation */
@@ -205,33 +220,30 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
state.snd_buflen = len; /* Number of bytes to send */
state.snd_buffer = buf; /* Buffer to send from */
- if (len > 0)
- {
- /* Allocate resource to receive a callback */
+ /* Allocate resource to receive a callback */
- state.snd_cb = can_callback_alloc(dev, conn);
- if (state.snd_cb)
- {
- /* Set up the callback in the connection */
+ state.snd_cb = can_callback_alloc(dev, conn);
+ if (state.snd_cb)
+ {
+ /* Set up the callback in the connection */
- state.snd_cb->flags = CAN_POLL;
- state.snd_cb->priv = (FAR void *)&state;
- state.snd_cb->event = psock_send_eventhandler;
+ state.snd_cb->flags = CAN_POLL;
+ state.snd_cb->priv = (FAR void *)&state;
+ state.snd_cb->event = psock_send_eventhandler;
- /* Notify the device driver that new TX data is available. */
+ /* Notify the device driver that new TX data is available. */
- netdev_txnotify_dev(dev);
+ netdev_txnotify_dev(dev);
- /* Wait for the send to complete or an error to occur.
- * net_lockedwait will also terminate if a signal is received.
- */
+ /* Wait for the send to complete or an error to occur.
+ * net_lockedwait will also terminate if a signal is received.
+ */
- ret = net_lockedwait(&state.snd_sem);
+ ret = net_lockedwait(&state.snd_sem);
- /* Make sure that no further events are processed */
+ /* Make sure that no further events are processed */
- can_callback_free(dev, conn, state.snd_cb);
- }
+ can_callback_free(dev, conn, state.snd_cb);
}
nxsem_destroy(&state.snd_sem);
diff --git a/net/can/can_setsockopt.c b/net/can/can_setsockopt.c
index 2d117a8..3bad6e0 100644
--- a/net/can/can_setsockopt.c
+++ b/net/can/can_setsockopt.c
@@ -108,13 +108,28 @@ int can_setsockopt(FAR struct socket *psock, int option,
break;
case CAN_RAW_LOOPBACK:
- break;
+ if (value_len != sizeof(conn->loopback))
+ return -EINVAL;
+
+ conn->loopback = *(FAR int32_t *)value;
+
+ break;
case CAN_RAW_RECV_OWN_MSGS:
- break;
+ if (value_len != sizeof(conn->recv_own_msgs))
+ return -EINVAL;
+
+ conn->recv_own_msgs = *(FAR int32_t *)value;
+
+ break;
case CAN_RAW_FD_FRAMES:
- break;
+ if (value_len != sizeof(conn->fd_frames))
+ return -EINVAL;
+
+ conn->fd_frames = *(FAR int32_t *)value;
+
+ break;
case CAN_RAW_JOIN_FILTERS:
break;
diff --git a/net/socket/getsockopt.c b/net/socket/getsockopt.c
index 6d71106..fa58e6d 100644
--- a/net/socket/getsockopt.c
+++ b/net/socket/getsockopt.c
@@ -371,8 +371,8 @@ int psock_getsockopt(FAR struct socket *psock, int level, int option,
break;
#endif
- case SOL_CAN_RAW:
-#ifdef CONFIG_NET_TCPPROTO_OPTIONS
+ case SOL_CAN_RAW:/* CAN protocol socket options (see include/netpacket/can.h) */
+#ifdef CONFIG_NET_CANPROTO_OPTIONS
ret = can_getsockopt(psock, option, value, value_len);
#endif
break;
diff --git a/net/socket/setsockopt.c b/net/socket/setsockopt.c
index 211a1df..46e1b6e 100644
--- a/net/socket/setsockopt.c
+++ b/net/socket/setsockopt.c
@@ -399,6 +399,12 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option,
break;
#endif
+#ifdef CONFIG_NET_CAN
+ case SOL_CAN_RAW: /* CAN protocol socket options (see include/netpacket/can.h) */
+ ret = can_setsockopt(psock, option, value, value_len);
+ break;
+#endif
+
default: /* The provided level is invalid */
ret = -EINVAL;
break;
[incubator-nuttx] 02/31: include/netpacket/can.h: Add CAN socket
family definitions
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 9ec0f58018abc18c2a00cec2a68ce7945e824dbe
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Thu Feb 13 09:58:12 2020 -0600
include/netpacket/can.h: Add CAN socket family definitions
---
include/netpacket/can.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 120 insertions(+)
diff --git a/include/netpacket/can.h b/include/netpacket/can.h
new file mode 100644
index 0000000..b93bb21
--- /dev/null
+++ b/include/netpacket/can.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+ * include/netpacket/can.h
+ * Definitions for use with AF_PACKET sockets
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NETPACKET_CAN_H
+#define __INCLUDE_NETPACKET_CAN_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Special address description flags for the CAN_ID */
+
+#define CAN_EFF_FLAG 0x80000000 /* EFF/SFF is set in the MSB */
+#define CAN_RTR_FLAG 0x40000000 /* Remote transmission request */
+#define CAN_ERR_FLAG 0x20000000 /* Error message frame */
+
+/* Valid bits in CAN ID for frame formats */
+
+#define CAN_SFF_MASK 0x000007ff /* Standard frame format (SFF) */
+#define CAN_EFF_MASK 0x1fffffff /* Extended frame format (EFF) */
+#define CAN_ERR_MASK 0x1fffffff /* Omit EFF, RTR, ERR flags */
+
+/* PF_CAN protocols */
+
+#define CAN_RAW 1 /* RAW sockets */
+#define CAN_BCM 2 /* Broadcast Manager */
+#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
+#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
+#define CAN_MCNET 5 /* Bosch MCNet */
+#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
+#define CAN_J1939 7 /* SAE J1939 */
+#define CAN_NPROTO 8
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* Controller Area Network Identifier structure
+ *
+ * Bit 0-28: CAN identifier (11/29 bit)
+ * Bit 29: Error message frame flag (0 = data frame, 1 = error message)
+ * Bit 30: Remote transmission request flag (1 = rtr frame)
+ * Bit 31: Frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
+ */
+
+typedef uint32_t canid_t;
+
+/* The sockaddr structure for CAN sockets
+ *
+ * can_family: Address family number AF_CAN.
+ * can_ifindex: CAN network interface index.
+ * can_addr: Protocol specific address information
+ */
+
+struct sockaddr_can
+{
+ sa_family_t can_family;
+ int16_t can_ifindex;
+ union
+ {
+ /* Transport protocol class address information */
+
+ struct
+ {
+ canid_t rx_id;
+ canid_t tx_id;
+ } tp;
+
+ /* J1939 address information */
+
+ struct
+ {
+ /* 8 byte name when using dynamic addressing */
+
+ uint64_t name;
+
+ /* pgn:
+ * 8 bit: PS in PDU2 case, else 0
+ * 8 bit: PF
+ * 1 bit: DP
+ * 1 bit: reserved
+ */
+
+ uint32_t pgn;
+
+ /* 1 byte address */
+
+ uint8_t addr;
+ } j1939;
+ } can_addr;
+};
+
+#endif /* __INCLUDE_NETPACKET_CAN_H */
[incubator-nuttx] 25/31: Socket: Control message addded initial
stubs for sendmsg()
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit b37b61614d4a843568bbac4dc4a0f92f5738224b
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Fri Mar 13 18:12:29 2020 +0100
Socket: Control message addded initial stubs for sendmsg()
---
arch/arm/src/s32k1xx/Kconfig | 1 +
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 9 +-
include/netpacket/can.h | 2 +
include/nuttx/net/net.h | 8 +-
libs/libc/net/lib_recvmsg.c | 4 +-
libs/libc/net/lib_sendmsg.c | 4 +-
net/bluetooth/bluetooth_sockif.c | 3 +-
net/can/Kconfig | 20 ++++
net/can/can.h | 16 +--
net/can/can_getsockopt.c | 21 ++++
net/can/can_recvfrom.c | 191 +++++++++++++++------------------
net/can/can_send.c | 4 +
net/can/can_setsockopt.c | 10 ++
net/can/can_sockif.c | 51 ++++++++-
net/icmp/icmp_sockif.c | 3 +-
net/icmpv6/icmpv6_sockif.c | 3 +-
net/ieee802154/ieee802154_sockif.c | 3 +-
net/inet/inet_sockif.c | 3 +-
net/local/local_sockif.c | 3 +-
net/netlink/netlink_sockif.c | 3 +-
net/pkt/pkt_sockif.c | 3 +-
net/socket/Kconfig | 14 +--
net/socket/Make.defs | 5 +-
net/socket/recvmsg.c | 4 +-
net/socket/{recvmsg.c => sendmsg.c} | 68 ++++++------
25 files changed, 280 insertions(+), 176 deletions(-)
diff --git a/arch/arm/src/s32k1xx/Kconfig b/arch/arm/src/s32k1xx/Kconfig
index 68f9bb6..41638d0 100644
--- a/arch/arm/src/s32k1xx/Kconfig
+++ b/arch/arm/src/s32k1xx/Kconfig
@@ -152,6 +152,7 @@ config S32K1XX_ENET
config S32K1XX_FLEXCAN
bool "FLEXCAN"
+ select NET_CAN_HAVE_TX_DEADLINE
default n
menuconfig S32K1XX_LPI2C0
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 15e5b62..5c02aa0 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -433,10 +433,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mb->id.std = frame->can_id & MASKSTDID;
}
- #if 0
- /* cs.rtr = frame.isRemoteTransmissionRequest(); */
- #endif
-
+ cs.rtr = frame->can_id & FLAGRTR ? 1 : 0;
cs.dlc = frame->can_dlc;
mb->data[0].w00 = __builtin_bswap32(*(uint32_t *)&frame->data[0]);
@@ -458,9 +455,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mb->id.std = frame->can_id & MASKSTDID;
}
-#if 0
- /* cs.rtr = frame.isRemoteTransmissionRequest(); */
-#endif
+ cs.rtr = frame->can_id & FLAGRTR ? 1 : 0;
if (frame->len < 9)
{
diff --git a/include/netpacket/can.h b/include/netpacket/can.h
index 4ea2104..bd0442d 100644
--- a/include/netpacket/can.h
+++ b/include/netpacket/can.h
@@ -75,6 +75,8 @@
/* allow CAN FD frames (default:off) */
#define CAN_RAW_JOIN_FILTERS (__SO_PROTOCOL + 5)
/* all filters must match to trigger */
+#define CAN_RAW_TX_DEADLINE (__SO_PROTOCOL + 6)
+ /* Abort frame when deadline has been passed */
/****************************************************************************
* Public Types
diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 27c5fe9..055c865 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -217,7 +217,7 @@ struct sock_intf_s
FAR socklen_t *fromlen);
#ifdef CONFIG_NET_RECVMSG_CMSG
CODE ssize_t (*si_recvmsg)(FAR struct socket *psock,
- FAR struct msghdr *msg, int flags);
+ FAR struct msghdr *msg, int flags);
#endif
CODE int (*si_close)(FAR struct socket *psock);
#ifdef CONFIG_NET_USRSOCK
@@ -507,9 +507,9 @@ FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid);
* Description:
* Check if the socket descriptor is valid for the provided TCB and if it
* supports the requested access. This trivial operation is part of the
- * fdopen() operation when the fdopen() is performed on a socket
- * descriptor. It simply performs some sanity checking before permitting
- * the socket descriptor to be wrapped as a C FILE stream.
+ * fdopen() operation when the fdopen() is performed on a socket descriptor.
+ * It simply performs some sanity checking before permitting the socket
+ * descriptor to be wrapped as a C FILE stream.
*
****************************************************************************/
diff --git a/libs/libc/net/lib_recvmsg.c b/libs/libc/net/lib_recvmsg.c
index 5200acd..071c189 100644
--- a/libs/libc/net/lib_recvmsg.c
+++ b/libs/libc/net/lib_recvmsg.c
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
-#if defined(CONFIG_NET) && !defined(CONFIG_NET_RECVMSG_CMSG)
+#if defined(CONFIG_NET) && !defined(CONFIG_NET_CMSG)
#include <sys/types.h>
#include <sys/socket.h>
@@ -87,4 +87,4 @@ ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
}
}
-#endif /* CONFIG_NET && !CONFIG_NET_RECVMSG_CMSG */
+#endif /* CONFIG_NET && !CONFIG_NET_CMSG */
diff --git a/libs/libc/net/lib_sendmsg.c b/libs/libc/net/lib_sendmsg.c
index 0d09faa..9f98e51 100644
--- a/libs/libc/net/lib_sendmsg.c
+++ b/libs/libc/net/lib_sendmsg.c
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
-#ifdef CONFIG_NET
+#if defined(CONFIG_NET) && !defined(CONFIG_NET_CMSG)
#include <sys/types.h>
#include <sys/socket.h>
@@ -86,4 +86,4 @@ ssize_t sendmsg(int sockfd, FAR struct msghdr *msg, int flags)
}
}
-#endif /* CONFIG_NET */
+#endif /* CONFIG_NET && !CONFIG_NET_CMSG */
diff --git a/net/bluetooth/bluetooth_sockif.c b/net/bluetooth/bluetooth_sockif.c
index fd6d95f..4057d93 100644
--- a/net/bluetooth/bluetooth_sockif.c
+++ b/net/bluetooth/bluetooth_sockif.c
@@ -109,8 +109,9 @@ const struct sock_intf_s g_bluetooth_sockif =
NULL, /* si_sendfile */
#endif
bluetooth_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
bluetooth_close /* si_close */
};
diff --git a/net/can/Kconfig b/net/can/Kconfig
index 3b2e450..ac94021 100644
--- a/net/can/Kconfig
+++ b/net/can/Kconfig
@@ -18,6 +18,10 @@ config NET_CAN
if NET_CAN
+config NET_CAN_HAVE_TX_DEADLINE
+ bool
+ default n
+
config CAN_CONNS
int "Number of CAN connections"
default 4
@@ -27,9 +31,25 @@ config CAN_CONNS
config NET_CAN_SOCK_OPTS
bool "sockopt support"
default n
+ select NET_SOCKOPTS
select NET_CANPROTO_OPTIONS
---help---
Enable support for the CAN socket options
+
+config NET_CAN_RAW_TX_DEADLINE
+ bool "TX deadline sockopt"
+ default n
+ depends on NET_CAN_SOCK_OPTS && NET_CAN_HAVE_TX_DEADLINE
+ select NET_CMSG
+ ---help---
+ Note: Non-standard SocketCAN sockopt, but this options helps us in
+ real-time use cases.
+
+ When the CAN_RAW_TX_DEADLINE sockopt is enabled. The user can send
+ CAN frames using sendmsg() function and add a deadline timespec
+ value in the CMSG data. When the deadline has been passed and the
+ CAN frame is still in the HW TX mailbox then the CAN driver will
+ discard the CAN frame automatically.
config NET_CAN_RAW_FILTER_MAX
int "CAN_RAW_FILTER max filter count"
diff --git a/net/can/can.h b/net/can/can.h
index 7c6b614..00c297d 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -104,20 +104,23 @@ struct can_conn_s
*/
struct can_poll_s pollinfo[4]; /* FIXME make dynamic */
-
+
#ifdef CONFIG_NET_CANPROTO_OPTIONS
int32_t loopback;
int32_t recv_own_msgs;
int32_t fd_frames;
struct can_filter filters[CONFIG_NET_CAN_RAW_FILTER_MAX];
int32_t filter_count;
-
- /* TODO add filter support */
+# ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+ int32_t tx_deadline;
+# endif
#endif
-
+
#ifdef CONFIG_NET_TIMESTAMP
FAR struct socket *psock; /* Needed to get SO_TIMESTAMP value */
#endif
+
+
};
/****************************************************************************
@@ -166,8 +169,8 @@ FAR struct can_conn_s *can_alloc(void);
* Name: can_free()
*
* Description:
- * Free a NetLink connection structure that is no longer in use. This
- * should be done by the implementation of close().
+ * Free a NetLink connection structure that is no longer in use. This should
+ * be done by the implementation of close().
*
****************************************************************************/
@@ -256,6 +259,7 @@ uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
*
****************************************************************************/
+
ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
int flags, FAR struct sockaddr *from,
FAR socklen_t *fromlen);
diff --git a/net/can/can_getsockopt.c b/net/can/can_getsockopt.c
index 238695c..17184e2 100644
--- a/net/can/can_getsockopt.c
+++ b/net/can/can_getsockopt.c
@@ -188,6 +188,27 @@ int can_getsockopt(FAR struct socket *psock, int option,
case CAN_RAW_JOIN_FILTERS:
break;
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+ case CAN_RAW_TX_DEADLINE:
+ if (*value_len < sizeof(conn->tx_deadline))
+ {
+ /* REVISIT: POSIX says that we should truncate the value if it
+ * is larger than value_len. That just doesn't make sense
+ * to me in this case.
+ */
+
+ ret = -EINVAL;
+ }
+ else
+ {
+ FAR int *tx_deadline = (FAR int32_t *)value;
+ *tx_deadline = conn->tx_deadline;
+ *value_len = sizeof(conn->tx_deadline);
+ ret = OK;
+ }
+ break;
+#endif
+
default:
nerr("ERROR: Unrecognized RAW CAN socket option: %d\n", option);
ret = -ENOPROTOOPT;
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index 2211ed0..d9ed8cb 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -50,19 +50,20 @@
#include <sys/time.h>
#endif
+
/****************************************************************************
* Private Types
****************************************************************************/
struct can_recvfrom_s
{
- FAR struct socket *pr_sock; /* The parent socket structure */
+ FAR struct socket *pr_sock; /* The parent socket structure */
FAR struct devif_callback_s *pr_cb; /* Reference to callback instance */
sem_t pr_sem; /* Semaphore signals recv completion */
size_t pr_buflen; /* Length of receive buffer */
FAR uint8_t *pr_buffer; /* Pointer to receive buffer */
ssize_t pr_recvlen; /* The received length */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
size_t pr_msglen; /* Length of msg buffer */
FAR uint8_t *pr_msgbuf; /* Pointer to msg buffer */
#endif
@@ -232,15 +233,14 @@ static inline void can_newdata(FAR struct net_driver_s *dev,
static inline int can_readahead(struct can_recvfrom_s *pstate)
{
- FAR struct can_conn_s *conn =
- (FAR struct can_conn_s *) pstate->pr_sock->s_conn;
+ FAR struct can_conn_s *conn = (FAR struct can_conn_s *)pstate->pr_sock->s_conn;
FAR struct iob_s *iob;
int recvlen;
/* Check there is any CAN data already buffered in a read-ahead
* buffer.
*/
-
+
pstate->pr_recvlen = -1;
if ((iob = iob_peek_queue(&conn->readahead)) != NULL &&
@@ -287,16 +287,15 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
IOBUSER_NET_CAN_READAHEAD);
}
- /* do not pass frames with DLC > 8 to a legacy socket */
-
- if (!conn->fd_frames)
- {
- struct canfd_frame *cfd = (struct canfd_frame *)pstate->pr_buffer;
- if (cfd->len > CAN_MAX_DLEN)
- {
- return 0;
- }
- }
+ /* do not pass frames with DLC > 8 to a legacy socket */
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame *)pstate->pr_buffer;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ return 0;
+ }
+ }
return recvlen;
}
@@ -320,14 +319,13 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
* The network is locked.
*
****************************************************************************/
-
#ifdef CONFIG_NET_TIMESTAMP
-static inline int can_readahead_timestamp(struct can_conn_s *conn,
- FAR uint8_t *buffer)
+static inline int can_readahead_timestamp(struct can_conn_s *conn, FAR uint8_t *buffer)
{
FAR struct iob_s *iob;
int recvlen;
+
if ((iob = iob_peek_queue(&conn->readahead)) != NULL)
{
DEBUGASSERT(iob->io_pktlen > 0);
@@ -381,27 +379,26 @@ static inline int can_readahead_timestamp(struct can_conn_s *conn,
#ifdef CONFIG_NET_CANPROTO_OPTIONS
static int can_recv_filter(struct can_conn_s *conn, canid_t id)
{
- for (int i = 0; i < conn->filter_count; i++)
+ for(int i = 0; i < conn->filter_count; i++)
{
- if (conn->filters[i].can_id & CAN_INV_FILTER)
- {
- if ((id & conn->filters[i].can_mask) !=
- ((conn->filters[i].can_id & ~CAN_INV_FILTER) &
- conn->filters[i].can_mask))
- {
- return 1;
- }
- }
- else
- {
- if ((id & conn->filters[i].can_mask) ==
- (conn->filters[i].can_id & conn->filters[i].can_mask))
- {
- return 1;
- }
- }
+ if (conn->filters[i].can_id & CAN_INV_FILTER)
+ {
+ if((id & conn->filters[i].can_mask) !=
+ ((conn->filters[i].can_id & ~CAN_INV_FILTER)
+ & conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
+ else
+ {
+ if((id & conn->filters[i].can_mask) ==
+ (conn->filters[i].can_id & conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
}
-
return 0;
}
#endif
@@ -419,50 +416,46 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
{
if ((flags & CAN_NEWDATA) != 0)
{
- /* If a new packet is available, check receive filters
- * when is valid then complete the read action.
- */
+ /* If a new packet is available, check receive filters
+ * when is valid then complete the read action. */
#ifdef CONFIG_NET_CANPROTO_OPTIONS
- if (can_recv_filter(conn, (canid_t) *dev->d_appdata) == 0)
- {
- flags &= ~CAN_NEWDATA;
- return flags;
- }
+ if(can_recv_filter(conn,(canid_t)*dev->d_appdata) == 0)
+ {
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
#endif
- /* do not pass frames with DLC > 8 to a legacy socket */
-
- if (!conn->fd_frames)
- {
- struct canfd_frame *cfd = (struct canfd_frame *)dev->d_appdata;
- if (cfd->len > CAN_MAX_DLEN)
- {
- /* DO WE NEED TO CLEAR FLAGS?? */
-
- flags &= ~CAN_NEWDATA;
- return flags;
- }
- }
+ /* do not pass frames with DLC > 8 to a legacy socket */
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame*)dev->d_appdata;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ /* DO WE NEED TO CLEAR FLAGS?? */
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
+ }
/* Copy the packet */
can_newdata(dev, pstate);
#ifdef CONFIG_NET_TIMESTAMP
- if (pstate->pr_sock->s_timestamp)
- {
- if (pstate->pr_msglen == sizeof(struct timeval))
- {
- can_readahead_timestamp(conn, pstate->pr_msgbuf);
- }
- else
- {
- /* We still have to consume the data otherwise IOB gets full */
-
- uint8_t dummy_buf[sizeof(struct timeval)];
- can_readahead_timestamp(conn, &dummy_buf);
- }
- }
+ if(pstate->pr_sock->s_timestamp)
+ {
+ if(pstate->pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, pstate->pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
#endif
/* We are finished. */
@@ -515,7 +508,6 @@ static ssize_t can_recvfrom_result(int result,
if (pstate->pr_result < 0)
{
/* This might return EAGAIN on a timeout */
-
return pstate->pr_result;
}
@@ -600,10 +592,10 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
ret = can_readahead(&state);
if (ret > 0)
- {
+ {
goto errout_with_state;
}
-
+
ret = state.pr_recvlen;
/* Handle non-blocking CAN sockets */
@@ -618,7 +610,7 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
{
/* Nothing was received */
- ret = -EAGAIN;
+ ret = -EAGAIN;
goto errout_with_state;
}
}
@@ -683,7 +675,6 @@ errout_with_state:
* flags Receive flags (ignored)
*
****************************************************************************/
-
#ifdef CONFIG_NET_RECVMSG_CMSG
ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
size_t len, int flags)
@@ -716,22 +707,20 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
nxsem_init(&state.pr_sem, 0, 0); /* Doesn't really fail */
nxsem_setprotocol(&state.pr_sem, SEM_PRIO_NONE);
+
state.pr_buflen = msg->msg_iov->iov_len;
state.pr_buffer = msg->msg_iov->iov_base;
-
#ifdef CONFIG_NET_TIMESTAMP
- if (psock->s_timestamp && msg->msg_controllen ==
- (sizeof(struct cmsghdr) + sizeof(struct timeval)))
+ if(psock->s_timestamp && msg->msg_controllen == (sizeof(struct cmsghdr) + sizeof(struct timeval)))
{
- struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
- state.pr_msglen = sizeof(struct timeval);
- state.pr_msgbuf = CMSG_DATA(cmsg);
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SO_TIMESTAMP;
- cmsg->cmsg_len = state.pr_msglen;
+ struct cmsghdr* cmsg = CMSG_FIRSTHDR(msg);
+ state.pr_msglen = sizeof(struct timeval);
+ state.pr_msgbuf = CMSG_DATA(cmsg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SO_TIMESTAMP;
+ cmsg->cmsg_len = state.pr_msglen;
}
#endif
-
state.pr_sock = psock;
/* Handle any any CAN data already buffered in a read-ahead buffer. NOTE
@@ -743,22 +732,20 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
if (ret > 0)
{
#ifdef CONFIG_NET_TIMESTAMP
- if (psock->s_timestamp)
- {
- if (state.pr_msglen == sizeof(struct timeval))
- {
- can_readahead_timestamp(conn, state.pr_msgbuf);
- }
- else
- {
- /* We still have to consume the data otherwise IOB gets full */
-
- uint8_t dummy_buf[sizeof(struct timeval)];
- can_readahead_timestamp(conn, &dummy_buf);
- }
- }
+ if(psock->s_timestamp)
+ {
+ if(state.pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, state.pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
#endif
-
goto errout_with_state;
}
diff --git a/net/can/can_send.c b/net/can/can_send.c
index 644adc3..dfb03d0 100644
--- a/net/can/can_send.c
+++ b/net/can/can_send.c
@@ -76,6 +76,10 @@ struct send_s
sem_t snd_sem; /* Used to wake up the waiting thread */
FAR const uint8_t *snd_buffer; /* Points to the buffer of data to send */
size_t snd_buflen; /* Number of bytes in the buffer to send */
+#ifdef CONFIG_NET_CMSG
+ size_t pr_msglen; /* Length of msg buffer */
+ FAR uint8_t *pr_msgbuf; /* Pointer to msg buffer */
+#endif
ssize_t snd_sent; /* The number of bytes sent */
};
diff --git a/net/can/can_setsockopt.c b/net/can/can_setsockopt.c
index 6858c1a..ac9f912 100644
--- a/net/can/can_setsockopt.c
+++ b/net/can/can_setsockopt.c
@@ -147,6 +147,16 @@ int can_setsockopt(FAR struct socket *psock, int option,
case CAN_RAW_JOIN_FILTERS:
break;
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+ case CAN_RAW_TX_DEADLINE:
+ if (value_len != sizeof(conn->tx_deadline))
+ return -EINVAL;
+
+ conn->tx_deadline = *(FAR int32_t *)value;
+
+ break;
+#endif
+
default:
nerr("ERROR: Unrecognized CAN option: %d\n", option);
ret = -ENOPROTOOPT;
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 737788e..09a61d0 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -69,6 +69,10 @@ static ssize_t can_send(FAR struct socket *psock,
static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
size_t len, int flags, FAR const struct sockaddr *to,
socklen_t tolen);
+#ifdef CONFIG_NET_CMSG
+static ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ size_t len, int flags);
+#endif
static int can_close(FAR struct socket *psock);
/****************************************************************************
@@ -93,8 +97,9 @@ const struct sock_intf_s g_can_sockif =
NULL, /* si_sendfile */
#endif
can_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
can_recvmsg, /* si_recvmsg */
+ can_sendmsg, /* si_sendmsg */
#endif
can_close /* si_close */
};
@@ -774,6 +779,50 @@ static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
}
/****************************************************************************
+ * Name: can_sendmsg
+ *
+ * Description:
+ * The can_sendmsg() send a CAN frame to psock
+ *
+ * Input Parameters:
+ * psock - An instance of the internal socket structure.
+ * msg - CAN frame and optional CMSG
+ * flags - Send flags (ignored)
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. On error, a negated
+ * errno value is returned (see send() for the list of appropriate error
+ * values.
+ *
+ ****************************************************************************/
+#ifdef CONFIG_NET_CMSG
+static ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ size_t len, int flags);
+{
+ ssize_t ret;
+
+ /* Only SOCK_RAW is supported */
+
+ if (psock->s_type == SOCK_RAW)
+ {
+ /* Raw packet send */
+
+ ret = psock_can_send(psock, buf, len);
+ }
+ else
+ {
+ /* EDESTADDRREQ. Signifies that the socket is not connection-mode and
+ * no peer address is set.
+ */
+
+ ret = -EDESTADDRREQ;
+ }
+
+ return ret;
+}
+#endif
+
+/****************************************************************************
* Name: can_close
*
* Description:
diff --git a/net/icmp/icmp_sockif.c b/net/icmp/icmp_sockif.c
index c81592e..ebe2bab 100644
--- a/net/icmp/icmp_sockif.c
+++ b/net/icmp/icmp_sockif.c
@@ -102,8 +102,9 @@ const struct sock_intf_s g_icmp_sockif =
NULL, /* si_sendfile */
#endif
icmp_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
icmp_close /* si_close */
};
diff --git a/net/icmpv6/icmpv6_sockif.c b/net/icmpv6/icmpv6_sockif.c
index 29e5e47..5adae60 100644
--- a/net/icmpv6/icmpv6_sockif.c
+++ b/net/icmpv6/icmpv6_sockif.c
@@ -102,8 +102,9 @@ const struct sock_intf_s g_icmpv6_sockif =
NULL, /* si_sendfile */
#endif
icmpv6_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
icmpv6_close /* si_close */
};
diff --git a/net/ieee802154/ieee802154_sockif.c b/net/ieee802154/ieee802154_sockif.c
index d1ac29b..6c0f88a 100644
--- a/net/ieee802154/ieee802154_sockif.c
+++ b/net/ieee802154/ieee802154_sockif.c
@@ -107,8 +107,9 @@ const struct sock_intf_s g_ieee802154_sockif =
NULL, /* si_sendfile */
#endif
ieee802154_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
ieee802154_close /* si_close */
};
diff --git a/net/inet/inet_sockif.c b/net/inet/inet_sockif.c
index 2a09c45..488f2d1 100644
--- a/net/inet/inet_sockif.c
+++ b/net/inet/inet_sockif.c
@@ -117,8 +117,9 @@ static const struct sock_intf_s g_inet_sockif =
inet_sendfile, /* si_sendfile */
#endif
inet_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
inet_close /* si_close */
};
diff --git a/net/local/local_sockif.c b/net/local/local_sockif.c
index 62d56b5..cd9bd66 100644
--- a/net/local/local_sockif.c
+++ b/net/local/local_sockif.c
@@ -110,8 +110,9 @@ const struct sock_intf_s g_local_sockif =
NULL, /* si_sendfile */
#endif
local_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
local_close /* si_close */
};
diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c
index 970aed4..34b011a 100644
--- a/net/netlink/netlink_sockif.c
+++ b/net/netlink/netlink_sockif.c
@@ -111,8 +111,9 @@ const struct sock_intf_s g_netlink_sockif =
NULL, /* si_sendfile */
#endif
netlink_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
netlink_close /* si_close */
};
diff --git a/net/pkt/pkt_sockif.c b/net/pkt/pkt_sockif.c
index bbabf42..dbf3e3c 100644
--- a/net/pkt/pkt_sockif.c
+++ b/net/pkt/pkt_sockif.c
@@ -108,8 +108,9 @@ const struct sock_intf_s g_pkt_sockif =
NULL, /* si_sendfile */
#endif
pkt_recvfrom, /* si_recvfrom */
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
NULL, /* si_recvmsg */
+ NULL, /* si_sendmsg */
#endif
pkt_close /* si_close */
};
diff --git a/net/socket/Kconfig b/net/socket/Kconfig
index f4c9408..f13e22d 100644
--- a/net/socket/Kconfig
+++ b/net/socket/Kconfig
@@ -58,18 +58,20 @@ config NET_SOLINGER
config NET_TIMESTAMP
bool "SO_TIMESTAMP socket option"
default n
- depends on NET_CAN && NET_RECVMSG_CMSG
+ depends on NET_CAN
+ select NET_CMSG
---help---
Enable or disable support for the SO_TIMESTAMP socket option. Currently only tested & implemented in SocketCAN but should work on all sockets
endif # NET_SOCKOPTS
-config NET_RECVMSG_CMSG
- bool "recvmsg() control messages (CMSG) support"
+config NET_CMSG
+ bool "Control messages (CMSG) support"
default n
---help---
- Enable or disable support for control messages in the recvmsg function.
- Control messages (also defined in POSIX 1003.1g as ancillary data object information).
- Includes additional information on the packet received.
+ Enable or disable support for control messages in the recvmsg() and
+ sendmsg() function. Control messages (also defined in POSIX 1003.1g
+ as ancillary data object information). Includes additional
+ information on the packet received or to be transmitted.
endmenu # Socket Support
diff --git a/net/socket/Make.defs b/net/socket/Make.defs
index 2be9dbf..6bf79ed 100644
--- a/net/socket/Make.defs
+++ b/net/socket/Make.defs
@@ -75,7 +75,8 @@ endif
DEPPATH += --dep-path socket
VPATH += :socket
-# Support for recvmsg() with control messages (CMSG)
-ifeq ($(CONFIG_NET_RECVMSG_CMSG),y)
+# Support for control messages (CMSG)
+ifeq ($(CONFIG_NET_CMSG),y)
SOCK_CSRCS += recvmsg.c
+SOCK_CSRCS += sendmsg.c
endif
diff --git a/net/socket/recvmsg.c b/net/socket/recvmsg.c
index 17d4dfe..800eeb1 100644
--- a/net/socket/recvmsg.c
+++ b/net/socket/recvmsg.c
@@ -47,7 +47,7 @@
#include "socket/socket.h"
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
/****************************************************************************
* Public Functions
@@ -235,4 +235,4 @@ ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
return ret;
}
-#endif /* CONFIG_NET_RECVMSG_CMSG */
+#endif /* CONFIG_NET_CMSG */
diff --git a/net/socket/recvmsg.c b/net/socket/sendmsg.c
similarity index 78%
copy from net/socket/recvmsg.c
copy to net/socket/sendmsg.c
index 17d4dfe..3bc32e8 100644
--- a/net/socket/recvmsg.c
+++ b/net/socket/sendmsg.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/socket/recvmsg.c
+ * net/socket/sendmsg.c
*
* Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
@@ -47,20 +47,20 @@
#include "socket/socket.h"
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
- * Name: psock_recvmsg
+ * Name: psock_sendmsg
*
* Description:
- * psock_recvfrom() receives messages from a socket, and may be used to
- * receive data on a socket whether or not it is connection-oriented.
+ * psock_sendfrom() sends messages to a socket, and may be used to
+ * send data on a socket whether or not it is connection-oriented.
* This is an internal OS interface. It is functionally equivalent to
- * recvfrom() except that:
+ * sendfrom() except that:
*
* - It is not a cancellation point,
* - It does not modify the errno variable, and
@@ -69,20 +69,20 @@
*
* Input Parameters:
* psock - A pointer to a NuttX-specific, internal socket structure
- * msg Buffer to receive msg
+ * msg - Buffer to of the msg
* len - Length of buffer
* flags - Receive flags
*
* Returned Value:
* On success, returns the number of characters sent. If no data is
* available to be received and the peer has performed an orderly shutdown,
- * recv() will return 0. Otherwise, on any failure, a negated errno value
+ * send() will return 0. Otherwise, on any failure, a negated errno value
* is returned (see comments with send() for a list of appropriate errno
* values).
*
****************************************************************************/
-ssize_t psock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ssize_t psock_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
int flags)
{
/* Verify that non-NULL pointers were passed */
@@ -103,38 +103,38 @@ ssize_t psock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
return -EBADF;
}
- /* Let logic specific to this address family handle the recvfrom()
+ /* Let logic specific to this address family handle the sendfrom()
* operation.
*/
DEBUGASSERT(psock->s_sockif != NULL &&
- (psock->s_sockif->si_recvmsg != NULL ||
- psock->s_sockif->si_recvfrom != NULL));
+ (psock->s_sockif->si_sendmsg != NULL ||
+ psock->s_sockif->si_sendto != NULL));
- if(psock->s_sockif->si_recvmsg != NULL)
+ if(psock->s_sockif->si_sendmsg != NULL)
{
- return psock->s_sockif->si_recvmsg(psock, msg, flags);
+ return psock->s_sockif->si_sendmsg(psock, msg, flags);
}
else
{
- /* Socket doesn't implement si_recvmsg fallback to si_recvfrom */
- FAR void *buf = msg->msg_iov->iov_base;
- FAR struct sockaddr *from = msg->msg_name;
- FAR socklen_t *fromlen = (FAR socklen_t *)&msg->msg_namelen;
- size_t len = msg->msg_iov->iov_len;
- return psock->s_sockif->si_recvfrom(psock, buf, len, flags, from, fromlen);
+ /* Socket doesn't implement si_sendmsg fallback to si_sendto */
+ FAR void *buf = msg->msg_iov->iov_base;
+ FAR struct sockaddr *to = msg->msg_name;
+ socklen_t tolen = msg->msg_namelen;
+ size_t len = msg->msg_iov->iov_len;
+ return psock->s_sockif->si_sendto(psock, buf, len, flags, to, tolen);
}
}
/****************************************************************************
- * Name: nx_recvfrom
+ * Name: nx_sendfrom
*
* Description:
- * nx_recvfrom() receives messages from a socket, and may be used to
+ * nx_sendfrom() receives messages from a socket, and may be used to
* receive data on a socket whether or not it is connection-oriented.
* This is an internal OS interface. It is functionally equivalent to
- * recvfrom() except that:
+ * sendfrom() except that:
*
* - It is not a cancellation point, and
* - It does not modify the errno variable.
@@ -148,13 +148,13 @@ ssize_t psock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
* Returned Value:
* On success, returns the number of characters sent. If no data is
* available to be received and the peer has performed an orderly shutdown,
- * recv() will return 0. Otherwise, on any failure, a negated errno value
+ * send() will return 0. Otherwise, on any failure, a negated errno value
* is returned (see comments with send() for a list of appropriate errno
* values).
*
****************************************************************************/
-ssize_t nx_recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
+ssize_t nx_sendmsg(int sockfd, FAR struct msghdr *msg, int flags)
{
FAR struct socket *psock;
@@ -162,16 +162,16 @@ ssize_t nx_recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
psock = sockfd_socket(sockfd);
- /* Then let psock_recvmsg() do all of the work */
+ /* Then let psock_sendmsg() do all of the work */
- return psock_recvmsg(psock, msg, flags);
+ return psock_sendmsg(psock, msg, flags);
}
/****************************************************************************
- * Function: recvmsg
+ * Function: sendmsg
*
* Description:
- * The recvmsg() call is identical to recvfrom() with a NULL from parameter.
+ * The sendmsg() call is identical to sendfrom() with a NULL from parameter.
*
* Parameters:
* sockfd Socket descriptor of socket
@@ -209,12 +209,12 @@ ssize_t nx_recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
*
****************************************************************************/
-ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
+ssize_t sendmsg(int sockfd, FAR struct msghdr *msg, int flags)
{
FAR struct socket *psock;
ssize_t ret;
- /* recvfrom() is a cancellation point */
+ /* sendfrom() is a cancellation point */
enter_cancellation_point();
@@ -222,9 +222,9 @@ ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
psock = sockfd_socket(sockfd);
- /* Let psock_recvfrom() do all of the work */
+ /* Let psock_sendfrom() do all of the work */
- ret = psock_recvmsg(psock, msg, flags);
+ ret = psock_sendmsg(psock, msg, flags);
if (ret < 0)
{
_SO_SETERRNO(psock, -ret);
@@ -235,4 +235,4 @@ ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
return ret;
}
-#endif /* CONFIG_NET_RECVMSG_CMSG */
+#endif /* CONFIG_NET_CMSG */
[incubator-nuttx] 12/31: Fixed SocketCAN IOB default config and IOB
typos
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit e67d2cbee8c485344b487aab3700fc4690aa4984
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Thu Mar 5 09:49:41 2020 +0100
Fixed SocketCAN IOB default config and IOB typos
---
net/can/Kconfig | 2 ++
net/can/can_callback.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/can/Kconfig b/net/can/Kconfig
index 2272db7..d5b6dbd 100644
--- a/net/can/Kconfig
+++ b/net/can/Kconfig
@@ -8,6 +8,8 @@ menu "SocketCAN Support"
config NET_CAN
bool "SocketCAN support"
default n
+ select NET_READAHEAD
+ depends on NET
---help---
Enable support for SocketCAN sockets that will permit.
diff --git a/net/can/can_callback.c b/net/can/can_callback.c
index 0f60b6a..7b923d3 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_callback.c
@@ -196,7 +196,7 @@ uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
if (ret < 0)
{
nerr("ERROR: Failed to queue the I/O buffer chain: %d\n", ret);
- iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD);
+ iob_free_chain(iob, IOBUSER_NET_CAN_READAHEAD);
return 0;
}
[incubator-nuttx] 17/31: Added devif_cansend.c (forgotten in commit
e485581)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 785ef9d12fe47c82965d2a6023d1dd5627e343a4
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Mon Mar 9 13:51:28 2020 +0100
Added devif_cansend.c (forgotten in commit e485581)
---
net/devif/devif_cansend.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
diff --git a/net/devif/devif_cansend.c b/net/devif/devif_cansend.c
new file mode 100644
index 0000000..60fdf38
--- /dev/null
+++ b/net/devif/devif_cansend.c
@@ -0,0 +1,113 @@
+/****************************************************************************
+ * net/devif/devif_cansend.c
+ *
+ * Copyright (C) 2014 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * 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 <nuttx/config.h>
+
+#include <string.h>
+#include <assert.h>
+#include <debug.h>
+
+#include <nuttx/net/netdev.h>
+
+#if defined(CONFIG_NET_CAN)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Type Declarations
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Constant Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: devif_pkt_send
+ *
+ * Description:
+ * Called from socket logic in order to send a raw packet in response to
+ * an xmit or poll request from the network interface driver.
+ *
+ * This is almost identical to calling devif_send() except that the data to
+ * be sent is copied into dev->d_buf (vs. dev->d_appdata), since there is
+ * no header on the data.
+ *
+ * Assumptions:
+ * Called with the network locked.
+ *
+ ****************************************************************************/
+
+void devif_can_send(FAR struct net_driver_s *dev, FAR const void *buf,
+ unsigned int len)
+{
+ DEBUGASSERT(dev && len > 0 && len < NETDEV_PKTSIZE(dev));
+
+ /* Copy the data into the device packet buffer */
+
+ memcpy(dev->d_buf, buf, len);
+
+ /* Set the number of bytes to send */
+
+ dev->d_len = len;
+ dev->d_sndlen = len;
+}
+
+#endif /* CONFIG_NET_CAN */
[incubator-nuttx] 15/31: Added functional support for
CAN_RAW_FILTER sockopt
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 1f32cf314ade6950b8066b58375f9648ed302d0e
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Mon Mar 9 12:47:26 2020 +0100
Added functional support for CAN_RAW_FILTER sockopt
---
include/nuttx/can.h | 1 -
net/can/Kconfig | 7 +++++++
net/can/can.h | 2 ++
net/can/can_conn.c | 17 +++++++++++++++++
net/can/can_getsockopt.c | 27 ++++++++++++++++++++-------
net/can/can_input.c | 2 +-
net/can/can_recvfrom.c | 47 ++++++++++++++++++++++++++++++++++++++---------
net/can/can_setsockopt.c | 22 +++++++++++++++++-----
8 files changed, 102 insertions(+), 23 deletions(-)
diff --git a/include/nuttx/can.h b/include/nuttx/can.h
index 7a66a65..c681b32 100644
--- a/include/nuttx/can.h
+++ b/include/nuttx/can.h
@@ -214,7 +214,6 @@
#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
-#define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */
/************************************************************************************
* Public Types
diff --git a/net/can/Kconfig b/net/can/Kconfig
index d5b6dbd..3b2e450 100644
--- a/net/can/Kconfig
+++ b/net/can/Kconfig
@@ -31,6 +31,13 @@ config NET_CAN_SOCK_OPTS
---help---
Enable support for the CAN socket options
+config NET_CAN_RAW_FILTER_MAX
+ int "CAN_RAW_FILTER max filter count"
+ default 32
+ depends on NET_CAN_SOCK_OPTS
+ ---help---
+ Maximum number of CAN_RAW filters that can be set per CAN connection.
+
config NET_CAN_NOTIFIER
bool "Support CAN notifications"
default n
diff --git a/net/can/can.h b/net/can/can.h
index 5992deb..e5d45f0 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -109,6 +109,8 @@ struct can_conn_s
int32_t loopback;
int32_t recv_own_msgs;
int32_t fd_frames;
+ struct can_filter filters[CONFIG_NET_CAN_RAW_FILTER_MAX];
+ int32_t filter_count;
/* TODO add filter support */
#endif
diff --git a/net/can/can_conn.c b/net/can/can_conn.c
index 21622b5..74f2d9b 100644
--- a/net/can/can_conn.c
+++ b/net/can/can_conn.c
@@ -142,6 +142,23 @@ FAR struct can_conn_s *can_alloc(void)
/* FIXME SocketCAN default behavior enables loopback */
+#ifdef CONFIG_NET_CANPROTO_OPTIONS
+ /* By default the filter is configured to catch all,
+ * this is done in commented filter code below:
+ *
+ * struct can_filter_t catchall_filter;
+ * filter.can_id = 0;
+ * filter.can_mask = 0;
+ * conn->filters[0] = catchall_filter;
+ *
+ * However memset already sets the filter to 0
+ * therefore we only have to set the filter count to 1
+ */
+
+ conn->filter_count = 1;
+#endif
+
+
/* Enqueue the connection into the active list */
dq_addlast(&conn->node, &g_active_can_connections);
diff --git a/net/can/can_getsockopt.c b/net/can/can_getsockopt.c
index 91720ad..e4149b6 100644
--- a/net/can/can_getsockopt.c
+++ b/net/can/can_getsockopt.c
@@ -98,16 +98,29 @@ int can_getsockopt(FAR struct socket *psock, int option,
{
ret = -EINVAL;
}
-
- if (value_len > CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
+ else if (*value_len > CONFIG_NET_CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
{
ret = -EINVAL;
}
-
- count = *value_len / sizeof(struct can_filter);
-
- /* FIXME pass filter to driver */
-
+ else
+ {
+ int count = conn->filter_count;
+
+ if (*value_len < count * sizeof(struct can_filter))
+ {
+ count = *value_len / sizeof(struct can_filter);
+ }
+ else
+ {
+ *value_len = count * sizeof(struct can_filter);
+ }
+
+ for(int i = 0; i < count; i++)
+ {
+ ((struct can_filter *)value)[i] = conn->filters[i];
+ }
+ ret = OK;
+ }
break;
case CAN_RAW_ERR_FILTER:
diff --git a/net/can/can_input.c b/net/can/can_input.c
index 30e2507..52d6c50 100644
--- a/net/can/can_input.c
+++ b/net/can/can_input.c
@@ -64,7 +64,7 @@ int can_input(struct net_driver_s *dev)
FAR struct can_conn_s *conn;
int ret = OK;
- conn = can_nextconn(NULL); /* FIXME */
+ conn = can_nextconn(NULL); /* FIXME Support for multiple sockets??? */
if (conn)
{
uint16_t flags;
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index c23af93..06b133c 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -294,6 +294,33 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
return 0;
}
+#ifdef CONFIG_NET_CANPROTO_OPTIONS
+static int can_recv_filter(struct can_conn_s *conn, canid_t id)
+{
+ for(int i = 0; i < conn->filter_count; i++)
+ {
+ if (conn->filters[i].can_id & CAN_INV_FILTER)
+ {
+ if((id & conn->filters[i].can_mask) !=
+ ((conn->filters[i].can_id & ~CAN_INV_FILTER)
+ & conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
+ else
+ {
+ if((id & conn->filters[i].can_mask) ==
+ (conn->filters[i].can_id & conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+#endif
+
static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
FAR void *pvconn,
FAR void *pvpriv, uint16_t flags)
@@ -305,14 +332,22 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
if (pstate)
{
- /* If a new packet is available, then complete the read action. */
-
if ((flags & CAN_NEWDATA) != 0)
{
+ /* If a new packet is available, check receive filters
+ * when is valid then complete the read action. */
+#ifdef CONFIG_NET_CANPROTO_OPTIONS
+ if(can_recv_filter(conn,(canid_t)*dev->d_appdata) == 0)
+ {
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
+#endif
+
/* do not pass frames with DLC > 8 to a legacy socket */
if (!conn->fd_frames)
{
- struct canfd_frame *cfd = (struct canfd_frame *)dev->d_appdata;
+ struct canfd_frame *cfd = (struct canfd_frame*)dev->d_appdata;
if (cfd->len > CAN_MAX_DLEN)
{
/* DO WE NEED TO CLEAR FLAGS?? */
@@ -333,12 +368,6 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
pstate->pr_cb->priv = NULL;
pstate->pr_cb->event = NULL;
-#if 0
- /* Save the sender's address in the caller's 'from' location */
-
- pkt_recvfrom_sender(dev, pstate);
-#endif
-
/* indicate that the data has been consumed */
flags &= ~CAN_NEWDATA;
diff --git a/net/can/can_setsockopt.c b/net/can/can_setsockopt.c
index 3bad6e0..659d84b 100644
--- a/net/can/can_setsockopt.c
+++ b/net/can/can_setsockopt.c
@@ -88,20 +88,32 @@ int can_setsockopt(FAR struct socket *psock, int option,
switch (option)
{
case CAN_RAW_FILTER:
- if (value_len % sizeof(struct can_filter) != 0)
+ if (value_len == 0)
+ {
+ conn->filter_count = 0;
+ ret = OK;
+ }
+ else if (value_len % sizeof(struct can_filter) != 0)
{
ret = -EINVAL;
}
-
- if (value_len > CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
+ else if (value_len > CONFIG_NET_CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
{
ret = -EINVAL;
}
+ else
+ {
+ count = value_len / sizeof(struct can_filter);
- count = value_len / sizeof(struct can_filter);
+ for(int i = 0; i < count; i++)
+ {
+ conn->filters[i] = ((struct can_filter *)value)[i];
+ }
- /* FIXME pass filter to driver */
+ conn->filter_count = count;
+ ret = OK;
+ }
break;
case CAN_RAW_ERR_FILTER:
[incubator-nuttx] 07/31: Added basic poll()/select support
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit b76d6099a570a5ff08893155e79d61c3ffb66d7c
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Fri Feb 21 16:24:54 2020 +0100
Added basic poll()/select support
Futhermore addded stubs for SocketCAN sockopts
---
include/netpacket/can.h | 18 +++
include/nuttx/can.h | 41 +++++
include/nuttx/mm/iob.h | 3 +
include/nuttx/wqueue.h | 3 +-
include/sys/socket.h | 10 ++
net/can/Kconfig | 19 +++
net/can/Make.defs | 8 +
net/can/can.h | 96 ++++++++++--
net/can/can_callback.c | 145 +++++++++++++++++-
net/can/can_conn.c | 22 +--
net/can/can_getsockopt.c | 154 +++++++++++++++++++
net/can/{can_callback.c => can_notifier.c} | 50 +++----
net/can/can_poll.c | 2 +-
net/can/can_recvfrom.c | 166 +++++++++++++++++++-
net/can/{can_callback.c => can_setsockopt.c} | 102 ++++++++++---
net/can/can_sockif.c | 216 ++++++++++++++++++---------
net/socket/Kconfig | 6 +
net/socket/getsockopt.c | 6 +
18 files changed, 909 insertions(+), 158 deletions(-)
diff --git a/include/netpacket/can.h b/include/netpacket/can.h
index b93bb21..45edab5 100644
--- a/include/netpacket/can.h
+++ b/include/netpacket/can.h
@@ -47,6 +47,9 @@
#define CAN_EFF_MASK 0x1fffffff /* Extended frame format (EFF) */
#define CAN_ERR_MASK 0x1fffffff /* Omit EFF, RTR, ERR flags */
+#define CAN_MTU (sizeof(struct can_frame))
+#define CANFD_MTU (sizeof(struct canfd_frame))
+
/* PF_CAN protocols */
#define CAN_RAW 1 /* RAW sockets */
@@ -58,6 +61,21 @@
#define CAN_J1939 7 /* SAE J1939 */
#define CAN_NPROTO 8
+/* CAN_RAW socket options */
+
+#define CAN_RAW_FILTER (__SO_PROTOCOL + 0)
+ /* set 0 .. n can_filter(s) */
+#define CAN_RAW_ERR_FILTER (__SO_PROTOCOL + 1)
+ /* set filter for error frames */
+#define CAN_RAW_LOOPBACK (__SO_PROTOCOL + 2)
+ /* local loopback (default:on) */
+#define CAN_RAW_RECV_OWN_MSGS (__SO_PROTOCOL + 3)
+ /* receive my own msgs (default:off) */
+#define CAN_RAW_FD_FRAMES (__SO_PROTOCOL + 4)
+ /* allow CAN FD frames (default:off) */
+#define CAN_RAW_JOIN_FILTERS (__SO_PROTOCOL + 5)
+ /* all filters must match to trigger */
+
/****************************************************************************
* Public Types
****************************************************************************/
diff --git a/include/nuttx/can.h b/include/nuttx/can.h
index fd86b74..02f80a8 100644
--- a/include/nuttx/can.h
+++ b/include/nuttx/can.h
@@ -45,6 +45,8 @@
# include <nuttx/wqueue.h>
#endif
+#include <queue.h>
+
#ifdef CONFIG_NET_CAN
/************************************************************************************
@@ -187,8 +189,26 @@
* Public Types
************************************************************************************/
+typedef FAR void *CAN_HANDLE;
+
+struct can_response_s
+{
+ sq_entry_t flink;
+
+ /* Message-specific data may follow */
+}; //FIXME remvoe
+
+
typedef uint32_t canid_t;
+/*
+ * Controller Area Network Error Message Frame Mask structure
+ *
+ * bit 0-28 : error class mask (see include/uapi/linux/can/error.h)
+ * bit 29-31 : set to zero
+ */
+typedef uint32_t can_err_mask_t;
+
/* CAN payload length and DLC definitions according to ISO 11898-1 */
#define CAN_MAX_DLC 8
#define CAN_MAX_DLEN 8
@@ -256,6 +276,27 @@ struct canfd_frame {
};
+/**
+ * struct can_filter - CAN ID based filter in can_register().
+ * @can_id: relevant bits of CAN ID which are not masked out.
+ * @can_mask: CAN mask (see description)
+ *
+ * Description:
+ * A filter matches, when
+ *
+ * <received_can_id> & mask == can_id & mask
+ *
+ * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
+ * filter for error message frames (CAN_ERR_FLAG bit set in mask).
+ */
+struct can_filter {
+ canid_t can_id;
+ canid_t can_mask;
+};
+
+#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
+#define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */
+
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index 8984af6..cabd2ff 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -220,6 +220,9 @@ enum iob_user_e
#ifdef CONFIG_WIRELESS_BLUETOOTH
IOBUSER_WIRELESS_BLUETOOTH,
#endif
+#if defined(CONFIG_NET_CAN)
+ IOBUSER_NET_CAN_READAHEAD,
+#endif
IOBUSER_GLOBAL,
IOBUSER_NENTRIES /* MUST BE LAST ENTRY */
};
diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h
index d353772..5ea8dfc 100644
--- a/include/nuttx/wqueue.h
+++ b/include/nuttx/wqueue.h
@@ -280,7 +280,8 @@ enum work_evtype_e
WORK_TCP_DISCONNECT, /* Notify loss of TCP connection */
WORK_UDP_READAHEAD, /* Notify that UDP read-ahead data is available */
WORK_UDP_WRITEBUFFER, /* Notify that UDP write buffer is empty */
- WORK_NETLINK_RESPONSE /* Notify that Netlink response is available */
+ WORK_NETLINK_RESPONSE, /* Notify thtat Netlink response is available */
+ WORK_CAN_READAHEAD /* Notify that CAN read-ahead data is available */
};
/* This structure describes one notification and is provided as input to
diff --git a/include/sys/socket.h b/include/sys/socket.h
index e85242e..bc7cd26 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -202,6 +202,15 @@
* return: int
*/
+
+/* The options are unsupported but included for compatibility
+ * and portability
+ */
+#define SO_TIMESTAMP 29
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
+#define SO_RXQ_OVFL 40
+
/* Protocol-level socket operations. */
#define SOL_IP 1 /* See options in include/netinet/ip.h */
@@ -212,6 +221,7 @@
#define SOL_L2CAP 6 /* See options in include/netpacket/bluetooth.h */
#define SOL_SCO 7 /* See options in include/netpacket/bluetooth.h */
#define SOL_RFCOMM 8 /* See options in include/netpacket/bluetooth.h */
+#define SOL_CAN_RAW 9 /* See options in include/netpacket/can.h */
/* Protocol-level socket options may begin with this value */
diff --git a/net/can/Kconfig b/net/can/Kconfig
index 2ae1f7b..2272db7 100644
--- a/net/can/Kconfig
+++ b/net/can/Kconfig
@@ -21,6 +21,25 @@ config CAN_CONNS
default 4
---help---
Maximum number of CAN connections (all tasks).
+
+config NET_CAN_SOCK_OPTS
+ bool "sockopt support"
+ default n
+ select NET_CANPROTO_OPTIONS
+ ---help---
+ Enable support for the CAN socket options
+
+config NET_CAN_NOTIFIER
+ bool "Support CAN notifications"
+ default n
+ depends on SCHED_WORKQUEUE
+ select WQUEUE_NOTIFIER
+ ---help---
+ Enable building of CAN notifier logic that will execute a worker
+ function on the low priority work queue when read-ahead data
+ is available or when a CAN connection is lost. This is is a general
+ purpose notifier, but was developed specifically to support poll()
+ logic where the poll must wait for these events.
endif # NET_CAN
endmenu # CAN Socket Support
diff --git a/net/can/Make.defs b/net/can/Make.defs
index d078a05..3204b3b 100644
--- a/net/can/Make.defs
+++ b/net/can/Make.defs
@@ -28,6 +28,14 @@ SOCK_CSRCS += can_sockif.c
SOCK_CSRCS += can_send.c
SOCK_CSRCS += can_recvfrom.c
+ifeq ($(CONFIG_NET_CAN_NOTIFIER),y)
+SOCK_CSRCS += can_notifier.c
+endif
+
+ifeq ($(CONFIG_NET_CANPROTO_OPTIONS),y)
+SOCK_CSRCS += can_setsockopt.c can_getsockopt.c
+endif
+
NET_CSRCS += can_conn.c
NET_CSRCS += can_input.c
NET_CSRCS += can_callback.c
diff --git a/net/can/can.h b/net/can/can.h
index c2b6857..46c7425 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -32,11 +32,16 @@
#include <netpacket/can.h>
#include <nuttx/semaphore.h>
+#include <nuttx/can.h>
#include <nuttx/net/netdev.h>
#include "devif/devif.h"
#include "socket/socket.h"
+#ifdef CONFIG_NET_CAN_NOTIFIER
+# include <nuttx/wqueue.h>
+#endif
+
#ifdef CONFIG_NET_CAN
/****************************************************************************
@@ -54,6 +59,16 @@
* Public Type Definitions
****************************************************************************/
+/* This is a container that holds the poll-related information */
+
+struct can_poll_s
+{
+ FAR struct socket *psock; /* Needed to handle loss of connection */
+ FAR struct net_driver_s *dev; /* Needed to free the callback structure */
+ struct pollfd *fds; /* Needed to handle poll events */
+ FAR struct devif_callback_s *cb; /* Needed to teardown the poll */
+};
+
/* This "connection" structure describes the underlying state of the socket. */
struct can_conn_s
@@ -70,16 +85,26 @@ struct can_conn_s
FAR struct devif_callback_s *list; /* NetLink callbacks */
FAR struct net_driver_s *dev; /* Reference to CAN device */
+
+ /* Read-ahead buffering.
+ *
+ * readahead - A singly linked list of type struct iob_qentry_s
+ * where the CAN/IP read-ahead data is retained.
+ */
+
+ struct iob_queue_s readahead; /* remove Read-ahead buffering */
/* CAN-specific content follows */
uint8_t protocol; /* Selected CAN protocol */
int16_t crefs; /* Reference count */
+
- /* poll() support */
+ /* The following is a list of poll structures of threads waiting for
+ * socket events.
+ */
- FAR sem_t *pollsem; /* Used to wakeup poll() */
- FAR pollevent_t *pollevent; /* poll() wakeup event */
+ struct can_poll_s pollinfo[4]; //FIXME make dynamic
};
/****************************************************************************
@@ -166,6 +191,35 @@ uint16_t can_callback(FAR struct net_driver_s *dev,
FAR struct can_conn_s *conn, uint16_t flags);
/****************************************************************************
+ * Name: can_datahandler
+ *
+ * Description:
+ * Handle data that is not accepted by the application. This may be called
+ * either (1) from the data receive logic if it cannot buffer the data, or
+ * (2) from the CAN event logic is there is no listener in place ready to
+ * receive the data.
+ *
+ * Input Parameters:
+ * conn - A pointer to the CAN connection structure
+ * buffer - A pointer to the buffer to be copied to the read-ahead
+ * buffers
+ * buflen - The number of bytes to copy to the read-ahead buffer.
+ *
+ * Returned Value:
+ * The number of bytes actually buffered is returned. This will be either
+ * zero or equal to buflen; partial packets are not buffered.
+ *
+ * Assumptions:
+ * - The caller has checked that CAN_NEWDATA is set in flags and that is no
+ * other handler available to process the incoming data.
+ * - Called from network stack logic with the network stack locked
+ *
+ ****************************************************************************/
+
+uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
+ uint16_t buflen);
+
+/****************************************************************************
* Name: can_recvfrom
*
* Description:
@@ -214,17 +268,6 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
void can_poll(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn);
/****************************************************************************
- * Name: can_active()
- *
- * Description:
- * Find a connection structure that is the appropriate connection for the
- * provided NetLink address
- *
- ****************************************************************************/
-
-FAR struct can_conn_s *can_active(FAR struct sockaddr_can *addr);
-
-/****************************************************************************
* Name: psock_can_send
*
* Description:
@@ -247,6 +290,31 @@ struct socket;
ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
size_t len);
+/****************************************************************************
+ * Name: can_readahead_signal
+ *
+ * Description:
+ * Read-ahead data has been buffered. Signal all threads waiting for
+ * read-ahead data to become available.
+ *
+ * When read-ahead data becomes available, *all* of the workers waiting
+ * for read-ahead data will be executed. If there are multiple workers
+ * waiting for read-ahead data then only the first to execute will get the
+ * data. Others will need to call can_readahead_notifier_setup() once
+ * again.
+ *
+ * Input Parameters:
+ * conn - The CAN connection where read-ahead data was just buffered.
+ *
+ * Returned Value:
+ * None.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NET_CAN_NOTIFIER
+void can_readahead_signal(FAR struct can_conn_s *conn);
+#endif
+
#undef EXTERN
#ifdef __cplusplus
diff --git a/net/can/can_callback.c b/net/can/can_callback.c
index 2fad951..6f3ae93 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_callback.c
@@ -50,6 +50,61 @@
#include "can/can.h"
/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: can_data_event
+ *
+ * Description:
+ * Handle data that is not accepted by the application because there is no
+ * listener in place ready to receive the data.
+ *
+ * Assumptions:
+ * - The caller has checked that CAN_NEWDATA is set in flags and that is no
+ * other handler available to process the incoming data.
+ * - This function must be called with the network locked.
+ *
+ ****************************************************************************/
+
+static inline uint16_t
+can_data_event(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn,
+ uint16_t flags)
+{
+ uint16_t ret;
+ uint8_t *buffer = dev->d_appdata;
+ int buflen = dev->d_len;
+ uint16_t recvlen;
+
+ ret = (flags & ~CAN_NEWDATA);
+
+ //ninfo("No listener on connection\n");
+
+ /* Save as the packet data as in the read-ahead buffer. NOTE that
+ * partial packets will not be buffered.
+ */
+
+ recvlen = can_datahandler(conn, buffer, buflen);
+ if (recvlen < buflen)
+ {
+ /* There is no handler to receive new data and there are no free
+ * read-ahead buffers to retain the data -- drop the packet.
+ */
+
+ ninfo("Dropped %d bytes\n", dev->d_len);
+
+#ifdef CONFIG_NET_STATISTICS
+ //g_netstats.tcp.drop++;
+#endif
+ }
+
+ /* In any event, the new data has now been handled */
+
+ dev->d_len = 0;
+ return ret;
+}
+
+/****************************************************************************
* Public Functions
****************************************************************************/
@@ -77,9 +132,97 @@ uint16_t can_callback(FAR struct net_driver_s *dev,
/* Perform the callback */
flags = devif_conn_event(dev, conn, flags, conn->list);
- }
+
+ if ((flags & CAN_NEWDATA) != 0)
+ {
+ /* Data was not handled.. dispose of it appropriately */
+ flags = can_data_event(dev, conn, flags);
+ }
+ }
+
return flags;
}
+/****************************************************************************
+ * Name: can_datahandler
+ *
+ * Description:
+ * Handle data that is not accepted by the application. This may be called
+ * either (1) from the data receive logic if it cannot buffer the data, or
+ * (2) from the CAN event logic is there is no listener in place ready to
+ * receive the data.
+ *
+ * Input Parameters:
+ * conn - A pointer to the CAN connection structure
+ * buffer - A pointer to the buffer to be copied to the read-ahead
+ * buffers
+ * buflen - The number of bytes to copy to the read-ahead buffer.
+ *
+ * Returned Value:
+ * The number of bytes actually buffered is returned. This will be either
+ * zero or equal to buflen; partial packets are not buffered.
+ *
+ * Assumptions:
+ * - The caller has checked that CAN_NEWDATA is set in flags and that is no
+ * other handler available to process the incoming data.
+ * - This function must be called with the network locked.
+ *
+ ****************************************************************************/
+
+uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
+ uint16_t buflen)
+{
+ FAR struct iob_s *iob;
+ int ret;
+
+ /* Try to allocate on I/O buffer to start the chain without waiting (and
+ * throttling as necessary). If we would have to wait, then drop the
+ * packet.
+ */
+
+ iob = iob_tryalloc(true, IOBUSER_NET_CAN_READAHEAD);
+ if (iob == NULL)
+ {
+ nerr("ERROR: Failed to create new I/O buffer chain\n");
+ return 0;
+ }
+
+ /* Copy the new appdata into the I/O buffer chain (without waiting) */
+
+ ret = iob_trycopyin(iob, buffer, buflen, 0, true,
+ IOBUSER_NET_CAN_READAHEAD);
+ if (ret < 0)
+ {
+ /* On a failure, iob_copyin return a negated error value but does
+ * not free any I/O buffers.
+ */
+
+ nerr("ERROR: Failed to add data to the I/O buffer chain: %d\n", ret);
+ iob_free_chain(iob, IOBUSER_NET_CAN_READAHEAD);
+ return 0;
+ }
+
+ /* Add the new I/O buffer chain to the tail of the read-ahead queue (again
+ * without waiting).
+ */
+
+ ret = iob_tryadd_queue(iob, &conn->readahead);
+ if (ret < 0)
+ {
+ nerr("ERROR: Failed to queue the I/O buffer chain: %d\n", ret);
+ iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD);
+ return 0;
+ }
+
+#ifdef CONFIG_NET_CAN_NOTIFIER
+ /* Provide notification(s) that additional CAN read-ahead data is
+ * available.
+ */
+
+ can_readahead_signal(conn);
+#endif
+ return buflen;
+}
+
#endif /* CONFIG_NET && CONFIG_NET_CAN */
diff --git a/net/can/can_conn.c b/net/can/can_conn.c
index 77733b3..4969f6d 100644
--- a/net/can/can_conn.c
+++ b/net/can/can_conn.c
@@ -81,6 +81,7 @@ static void _can_semgive(FAR sem_t *sem)
{
nxsem_post(sem);
}
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -201,25 +202,4 @@ FAR struct can_conn_s *can_nextconn(FAR struct can_conn_s *conn)
}
}
-/****************************************************************************
- * Name: can_active
- *
- * Description:
- * Find a connection structure that is the appropriate connection for the
- * provided NetLink address
- *
- * Assumptions:
- *
- ****************************************************************************/
-
-FAR struct can_conn_s *can_active(FAR struct sockaddr_can *addr)
-{
- /* This function is used to handle routing of incoming messages to sockets
- * connected to the address. There is no such use case for NetLink
- * sockets.
- */
-
- return NULL;
-}
-
#endif /* CONFIG_NET_CAN */
diff --git a/net/can/can_getsockopt.c b/net/can/can_getsockopt.c
new file mode 100644
index 0000000..d9e19f8
--- /dev/null
+++ b/net/can/can_getsockopt.c
@@ -0,0 +1,154 @@
+/****************************************************************************
+ * net/can/can_setsockopt.c
+ *
+ * Copyright (C) 2018 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * 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 <nuttx/config.h>
+
+#include <sys/time.h>
+#include <stdint.h>
+#include <errno.h>
+#include <assert.h>
+#include <debug.h>
+
+#include <netpacket/can.h>
+
+#include <nuttx/net/net.h>
+#include <nuttx/net/can.h>
+
+#include "socket/socket.h"
+#include "utils/utils.h"
+#include "can/can.h"
+
+#ifdef CONFIG_NET_CANPROTO_OPTIONS
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: can_getsockopt
+ *
+ * Description:
+ * can_getsockopt() retrieves the value for the option specified by the
+ * 'option' argument for the socket specified by the 'psock' argument. If
+ * the size of the option value is greater than 'value_len', the value
+ * stored in the object pointed to by the 'value' argument will be silently
+ * truncated. Otherwise, the length pointed to by the 'value_len' argument
+ * will be modified to indicate the actual length of the 'value'.
+ *
+ * See <sys/socket.h> a complete list of values for the socket-level
+ * 'option' argument. Protocol-specific options are are protocol specific
+ * header files (such as netpacket/can.h for the case of the CAN protocol).
+ *
+ * Input Parameters:
+ * psock Socket structure of the socket to query
+ * level Protocol level to set the option
+ * option identifies the option to get
+ * value Points to the argument value
+ * value_len The length of the argument value
+ *
+ * Returned Value:
+ * Returns zero (OK) on success. On failure, it returns a negated errno
+ * value to indicate the nature of the error. See psock_getsockopt() for
+ * the complete list of appropriate return error codes.
+ *
+ ****************************************************************************/
+
+int can_getsockopt (FAR struct socket *psock, int option,
+ FAR void *value, FAR socklen_t *value_len)
+{
+
+ FAR struct can_conn_s *conn;
+ int ret;
+ int count = 0;
+
+ DEBUGASSERT(psock != NULL && value != NULL && value_len != NULL &&
+ psock->s_conn != NULL);
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+
+ if (psock->s_type != SOCK_RAW)
+ {
+ nerr("ERROR: Not a RAW CAN socket\n");
+ return -ENOTCONN;
+ }
+
+
+ switch (option)
+ {
+
+ case CAN_RAW_FILTER:
+ if (*value_len % sizeof(struct can_filter) != 0)
+ {
+ ret = -EINVAL;
+ }
+
+ if (value_len > CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
+ {
+ ret = -EINVAL;
+ }
+
+ count = *value_len / sizeof(struct can_filter);
+
+ /* FIXME pass filter to driver */
+ break;
+
+ case CAN_RAW_ERR_FILTER:
+ break;
+
+ case CAN_RAW_LOOPBACK:
+ break;
+
+ case CAN_RAW_RECV_OWN_MSGS:
+ break;
+
+ case CAN_RAW_FD_FRAMES:
+ break;
+
+ case CAN_RAW_JOIN_FILTERS:
+ break;
+
+ default:
+ nerr("ERROR: Unrecognized RAW CAN socket option: %d\n", option);
+ ret = -ENOPROTOOPT;
+ break;
+ }
+
+ return ret;
+}
+
+#endif /* CONFIG_NET_CANPROTO_OPTIONS */
diff --git a/net/can/can_callback.c b/net/can/can_notifier.c
similarity index 70%
copy from net/can/can_callback.c
copy to net/can/can_notifier.c
index 2fad951..ffb4878 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_notifier.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/pkt/pkt_callback.c
+ * net/can/can_notifier.c
*
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,48 +38,46 @@
****************************************************************************/
#include <nuttx/config.h>
-#if defined(CONFIG_NET) && defined(CONFIG_NET_CAN)
-#include <stdint.h>
-#include <debug.h>
+#include <sys/types.h>
+#include <assert.h>
-#include <nuttx/net/netconfig.h>
-#include <nuttx/net/netdev.h>
+#include <nuttx/wqueue.h>
-#include "devif/devif.h"
#include "can/can.h"
+#ifdef CONFIG_NET_CAN_NOTIFIER
+
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
- * Name: can_callback
+ * Name: can_readahead_signal
*
* Description:
- * Inform the application holding the packet socket of a change in state.
+ * Read-ahead data has been buffered. Signal all threads waiting for
+ * read-ahead data to become available.
*
- * Returned Value:
- * OK if packet has been processed, otherwise ERROR.
+ * When read-ahead data becomes available, *all* of the workers waiting
+ * for read-ahead data will be executed. If there are multiple workers
+ * waiting for read-ahead data then only the first to execute will get the
+ * data. Others will need to call can_readahead_notifier_setup() once
+ * again.
+ *
+ * Input Parameters:
+ * conn - The CAN connection where read-ahead data was just buffered.
*
- * Assumptions:
- * This function is called with the network locked.
+ * Returned Value:
+ * None.
*
****************************************************************************/
-uint16_t can_callback(FAR struct net_driver_s *dev,
- FAR struct can_conn_s *conn, uint16_t flags)
+void can_readahead_signal(FAR struct can_conn_s *conn)
{
- /* Some sanity checking */
-
- if (conn)
- {
- /* Perform the callback */
-
- flags = devif_conn_event(dev, conn, flags, conn->list);
- }
+ /* This is just a simple wrapper around work_notifier_signal(). */
- return flags;
+ work_notifier_signal(WORK_CAN_READAHEAD, conn);
}
-#endif /* CONFIG_NET && CONFIG_NET_CAN */
+#endif /* CONFIG_NET_TCP_NOTIFIER */
diff --git a/net/can/can_poll.c b/net/can/can_poll.c
index 84aeeab..80e59a2 100644
--- a/net/can/can_poll.c
+++ b/net/can/can_poll.c
@@ -88,13 +88,13 @@ void can_poll(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn)
dev->d_sndlen = 0;
/* Perform the application callback */
-
can_callback(dev, conn, CAN_POLL);
/* Check if the application has data to send */
if (dev->d_sndlen > 0)
{
+ //FIXME missing logic
return;
}
}
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index 4062ed3..990786d 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -68,6 +68,7 @@
struct can_recvfrom_s
{
+ FAR struct socket *pr_sock; /* The parent socket structure */
FAR struct devif_callback_s *pr_cb; /* Reference to callback instance */
sem_t pr_sem; /* Semaphore signals recv completion */
size_t pr_buflen; /* Length of receive buffer */
@@ -128,7 +129,7 @@ static inline void can_add_recvlen(FAR struct can_recvfrom_s *pstate,
*
****************************************************************************/
-static void can_recvfrom_newdata(FAR struct net_driver_s *dev,
+static size_t can_recvfrom_newdata(FAR struct net_driver_s *dev,
FAR struct can_recvfrom_s *pstate)
{
size_t recvlen;
@@ -150,6 +151,150 @@ static void can_recvfrom_newdata(FAR struct net_driver_s *dev,
/* Update the accumulated size of the data read */
can_add_recvlen(pstate, recvlen);
+
+ return recvlen;
+}
+
+
+/****************************************************************************
+ * Name: can_newdata
+ *
+ * Description:
+ * Copy the read data from the packet
+ *
+ * Input Parameters:
+ * dev The structure of the network driver that generated the event
+ * pstate recvfrom state structure
+ *
+ * Returned Value:
+ * None.
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+static inline void can_newdata(FAR struct net_driver_s *dev,
+ FAR struct can_recvfrom_s *pstate)
+{
+ /* Take as much data from the packet as we can */
+
+ size_t recvlen = can_recvfrom_newdata(dev, pstate);
+
+ /* If there is more data left in the packet that we could not buffer, then
+ * add it to the read-ahead buffers.
+ */
+
+ if (recvlen < dev->d_len)
+ {
+ FAR struct can_conn_s *conn = (FAR struct can_conn_s *)pstate->pr_sock->s_conn;
+ FAR uint8_t *buffer = (FAR uint8_t *)dev->d_appdata + recvlen;
+ uint16_t buflen = dev->d_len - recvlen;
+#ifdef CONFIG_DEBUG_NET
+ uint16_t nsaved;
+
+ nsaved = can_datahandler(conn, buffer, buflen);
+#else
+ can_datahandler(conn, buffer, buflen);
+#endif
+
+ /* There are complicated buffering issues that are not addressed fully
+ * here. For example, what if up_datahandler() cannot buffer the
+ * remainder of the packet? In that case, the data will be dropped but
+ * still ACKed. Therefore it would not be resent.
+ *
+ * This is probably not an issue here because we only get here if the
+ * read-ahead buffers are empty and there would have to be something
+ * serioulsy wrong with the configuration not to be able to buffer a
+ * partial packet in this context.
+ */
+
+#ifdef CONFIG_DEBUG_NET
+ if (nsaved < buflen)
+ {
+ nerr("ERROR: packet data not saved (%d bytes)\n", buflen - nsaved);
+ }
+#endif
+ }
+
+ /* Indicate no data in the buffer */
+
+ dev->d_len = 0;
+}
+
+/****************************************************************************
+ * Name: can_readahead
+ *
+ * Description:
+ * Copy the read-ahead data from the packet
+ *
+ * Input Parameters:
+ * pstate recvfrom state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+static inline int can_readahead(struct can_recvfrom_s *pstate)
+{
+ FAR struct can_conn_s *conn = (FAR struct can_conn_s *)pstate->pr_sock->s_conn;
+ FAR struct iob_s *iob;
+ int recvlen;
+
+ /* Check there is any CAN data already buffered in a read-ahead
+ * buffer.
+ */
+
+ if((iob = iob_peek_queue(&conn->readahead)) != NULL &&
+ pstate->pr_buflen > 0)
+ {
+ DEBUGASSERT(iob->io_pktlen > 0);
+
+ /* Transfer that buffered data from the I/O buffer chain into
+ * the user buffer.
+ */
+
+ recvlen = iob_copyout(pstate->pr_buffer, iob, pstate->pr_buflen, 0);
+
+ /* If we took all of the data from the I/O buffer chain is empty, then
+ * release it. If there is still data available in the I/O buffer
+ * chain, then just trim the data that we have taken from the
+ * beginning of the I/O buffer chain.
+ */
+
+ if (recvlen >= iob->io_pktlen)
+ {
+ FAR struct iob_s *tmp;
+
+ /* Remove the I/O buffer chain from the head of the read-ahead
+ * buffer queue.
+ */
+
+ tmp = iob_remove_queue(&conn->readahead);
+ DEBUGASSERT(tmp == iob);
+ UNUSED(tmp);
+
+ /* And free the I/O buffer chain */
+
+ iob_free_chain(iob, IOBUSER_NET_CAN_READAHEAD);
+ }
+ else
+ {
+ /* The bytes that we have received from the head of the I/O
+ * buffer chain (probably changing the head of the I/O
+ * buffer queue).
+ */
+
+ iob_trimhead_queue(&conn->readahead, recvlen,
+ IOBUSER_NET_CAN_READAHEAD);
+ }
+ return recvlen;
+ }
+ return 0;
}
static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
@@ -170,7 +315,7 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
{
/* Copy the packet */
- can_recvfrom_newdata(dev, pstate);
+ can_newdata(dev, pstate);
/* We are finished. */
@@ -228,7 +373,7 @@ static ssize_t can_recvfrom_result(int result,
if (pstate->pr_result < 0)
{
/* This might return EAGAIN on a timeout or ENOTCONN on loss of
- * connection (TCP only)
+ * connection (CAN only)
*/
return pstate->pr_result;
@@ -307,6 +452,19 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
state.pr_buflen = len;
state.pr_buffer = buf;
+ state.pr_sock = psock;
+
+ /* Handle any any CAN data already buffered in a read-ahead buffer. NOTE
+ * that there may be read-ahead data to be retrieved even after the
+ * socket has been disconnected.
+ */
+ ret = can_readahead(&state);
+ if(ret > 0)
+ {
+ net_unlock();
+ nxsem_destroy(&state.pr_sem);
+ return ret;
+ }
/* Get the device driver that will service this transfer */
@@ -317,7 +475,7 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
goto errout_with_state;
}
- /* Set up the callback in the connection */
+ /* Set up the callback in the connection */
state.pr_cb = can_callback_alloc(dev, conn);
if (state.pr_cb)
diff --git a/net/can/can_callback.c b/net/can/can_setsockopt.c
similarity index 51%
copy from net/can/can_callback.c
copy to net/can/can_setsockopt.c
index 2fad951..db4cb76 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_setsockopt.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * net/pkt/pkt_callback.c
+ * net/can/can_setsockopt.c
*
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2018, 2020 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,48 +38,110 @@
****************************************************************************/
#include <nuttx/config.h>
-#if defined(CONFIG_NET) && defined(CONFIG_NET_CAN)
+#include <sys/time.h>
#include <stdint.h>
+#include <errno.h>
+#include <assert.h>
#include <debug.h>
-#include <nuttx/net/netconfig.h>
-#include <nuttx/net/netdev.h>
+#include <netpacket/can.h>
-#include "devif/devif.h"
+#include <nuttx/net/net.h>
+#include <nuttx/net/can.h>
+
+#include "socket/socket.h"
+#include "utils/utils.h"
#include "can/can.h"
+#ifdef CONFIG_NET_CANPROTO_OPTIONS
+
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
- * Name: can_callback
+ * Name: can_setsockopt
*
* Description:
- * Inform the application holding the packet socket of a change in state.
+ * can_setsockopt() sets the CAN-protocol option specified by the
+ * 'option' argument to the value pointed to by the 'value' argument for
+ * the socket specified by the 'psock' argument.
*
- * Returned Value:
- * OK if packet has been processed, otherwise ERROR.
+ * See <netinet/can.h> for the a complete list of values of CAN protocol
+ * options.
*
- * Assumptions:
- * This function is called with the network locked.
+ * Input Parameters:
+ * psock Socket structure of socket to operate on
+ * option identifies the option to set
+ * value Points to the argument value
+ * value_len The length of the argument value
+ *
+ * Returned Value:
+ * Returns zero (OK) on success. On failure, it returns a negated errno
+ * value to indicate the nature of the error. See psock_setcockopt() for
+ * the list of possible error values.
*
****************************************************************************/
-uint16_t can_callback(FAR struct net_driver_s *dev,
- FAR struct can_conn_s *conn, uint16_t flags)
+int can_setsockopt(FAR struct socket *psock, int option,
+ FAR const void *value, socklen_t value_len)
{
- /* Some sanity checking */
+
+ FAR struct can_conn_s *conn;
+ int ret;
+ int count = 0;
+
+ DEBUGASSERT(psock != NULL && value != NULL && psock->s_conn != NULL);
+ conn = (FAR struct can_conn_s *)psock->s_conn;
- if (conn)
+ if (psock->s_type != SOCK_RAW)
{
- /* Perform the callback */
+ nerr("ERROR: Not a RAW CAN socket\n");
+ return -ENOTCONN;
+ }
+
+
+ switch (option)
+ {
+ case CAN_RAW_FILTER:
+ if (value_len % sizeof(struct can_filter) != 0)
+ {
+ ret = -EINVAL;
+ }
+
+ if (value_len > CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
+ {
+ ret = -EINVAL;
+ }
+
+ count = value_len / sizeof(struct can_filter);
+
+ /* FIXME pass filter to driver */
+ break;
+
+ case CAN_RAW_ERR_FILTER:
+ break;
+
+ case CAN_RAW_LOOPBACK:
+ break;
+
+ case CAN_RAW_RECV_OWN_MSGS:
+ break;
+
+ case CAN_RAW_FD_FRAMES:
+ break;
+
+ case CAN_RAW_JOIN_FILTERS:
+ break;
- flags = devif_conn_event(dev, conn, flags, conn->list);
+ default:
+ nerr("ERROR: Unrecognized CAN option: %d\n", option);
+ ret = -ENOPROTOOPT;
+ break;
}
- return flags;
+ return ret;
}
-#endif /* CONFIG_NET && CONFIG_NET_CAN */
+#endif /* CONFIG_NET_CANPROTO_OPTIONS */
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 0cd389a..5c8415e 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -86,7 +86,7 @@ const struct sock_intf_s g_can_sockif =
can_listen, /* si_listen */
can_connect, /* si_connect */
can_accept, /* si_accept */
- can_poll_local, /* si_poll */
+ can_poll_local, /* si_poll */
can_send, /* si_send */
can_sendto, /* si_sendto */
#ifdef CONFIG_NET_SENDFILE
@@ -102,6 +102,73 @@ const struct sock_intf_s g_can_sockif =
****************************************************************************/
/****************************************************************************
+ * Name: can_poll_eventhandler
+ *
+ * Description:
+ * This function is called to perform the actual CAN receive operation
+ * via the device interface layer.
+ *
+ * Input Parameters:
+ * dev The structure of the network driver that caused the event
+ * conn The connection structure associated with the socket
+ * flags Set of events describing why the callback was invoked
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * This function must be called with the network locked.
+ *
+ ****************************************************************************/
+
+static uint16_t can_poll_eventhandler(FAR struct net_driver_s *dev,
+ FAR void *conn,
+ FAR void *pvpriv, uint16_t flags)
+{
+ FAR struct can_poll_s *info = (FAR struct can_poll_s *)pvpriv;
+
+ DEBUGASSERT(!info || (info->psock && info->fds));
+
+ /* 'priv' might be null in some race conditions (?) */
+
+ if (info)
+ {
+ pollevent_t eventset = 0;
+
+ /* Check for data or connection availability events. */
+
+ if ((flags & CAN_NEWDATA) != 0)
+ {
+ eventset |= (POLLIN & info->fds->events);
+ }
+
+ /* Check for loss of connection events. */
+
+ if ((flags & NETDEV_DOWN) != 0)
+ {
+ eventset |= (POLLHUP | POLLERR);
+ }
+
+ /* A poll is a sign that we are free to send data. */
+
+ /* else if ((flags & CAN_POLL) != 0 && psock_udp_cansend(info->psock) >= 0)
+ {
+ eventset |= (POLLOUT & info->fds->events);
+ }*/
+
+ /* Awaken the caller of poll() is requested event occurred. */
+
+ if (eventset)
+ {
+ info->fds->revents |= eventset;
+ nxsem_post(info->fds->sem);
+ }
+ }
+
+ return flags;
+}
+
+/****************************************************************************
* Name: can_setup
*
* Description:
@@ -506,100 +573,109 @@ static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
bool setup)
{
FAR struct can_conn_s *conn;
- int ret;
+ FAR struct can_poll_s *info;
+ FAR struct devif_callback_s *cb;
+ int ret = OK;
DEBUGASSERT(psock != NULL && psock->s_conn != NULL);
conn = (FAR struct can_conn_s *)psock->s_conn;
+ info = conn->pollinfo;
+
+ //FIXME add NETDEV_DOWN support
/* Check if we are setting up or tearing down the poll */
if (setup)
{
- /* If POLLOUT is selected, return immediately (maybe) */
-
- pollevent_t revents = POLLOUT;
-
- /* If POLLIN is selected and a response is available, return
- * immediately if POLLIN and/or POLLIN are included in the
- * requested event set.
- */
-
+
net_lock();
-
-#warning Missing logic
-
- revents &= fds->events;
- if (revents != 0)
+
+ info->dev = conn->dev;
+
+ cb = can_callback_alloc(info->dev, conn);
+ if (cb == NULL)
{
- fds->revents = revents;
- nxsem_post(fds->sem);
- net_unlock();
- return OK;
+ ret = -EBUSY;
+ goto errout_with_lock;
}
- /* Set up to be notified when a response is available if POLLIN is
- * requested.
+ /* Initialize the poll info container */
+
+ info->psock = psock;
+ info->fds = fds;
+ info->cb = cb;
+
+ /* Initialize the callback structure. Save the reference to the info
+ * structure as callback private data so that it will be available during
+ * callback processing.
*/
-
+
+ cb->flags = NETDEV_DOWN;
+ cb->priv = (FAR void *)info;
+ cb->event = can_poll_eventhandler;
+
+ if ((fds->events & POLLOUT) != 0)
+ {
+ cb->flags |= CAN_POLL;
+ }
+
if ((fds->events & POLLIN) != 0)
{
- /* Some limitations: There can be only a single outstanding POLLIN
- * on the CAN connection.
- */
-
- if (conn->pollsem != NULL || conn->pollevent != NULL)
- {
- nerr("ERROR: Multiple polls() on socket not supported.\n");
- net_unlock();
- return -EBUSY;
- }
-
- /* Set up the notification */
-
- conn->pollsem = fds->sem;
- conn->pollevent = &fds->revents;
-
-#warning Missing logic
-
- if (ret < 0)
- {
- /* Failed to set up notification */
-
- conn->pollsem = NULL;
- conn->pollevent = NULL;
- }
- else
- {
- /* Setup to receive a notification when CAN data is available */
-
-#warning Missing logic
-
- ret = OK;
- }
+ cb->flags |= CAN_NEWDATA;
}
-
- /* Set up to be notified when we are able to send CAN data without
- * waiting.
+
+ /* Save the reference in the poll info structure as fds private as well
+ * for use during poll teardown as well.
*/
-
- else if ((fds->events & POLLOUT) != 0)
+
+ fds->priv = (FAR void *)info;
+
+ /* Check for read data availability now */
+
+ if (!IOB_QEMPTY(&conn->readahead))
{
+ /* Normal data may be read without blocking. */
+
+ fds->revents |= (POLLRDNORM & fds->events);
}
- else
+
+ #if 0
+ if (psock_udp_cansend(psock) >= 0)
{
- /* There will not be any wakeups coming? Probably an error? */
-
- ret = OK;
+ /* Normal data may be sent without blocking (at least one byte). */
+
+ fds->revents |= (POLLWRNORM & fds->events);
}
-
+ #endif
+
+ /* Check if any requested events are already in effect */
+
+ if (fds->revents != 0)
+ {
+ /* Yes.. then signal the poll logic */
+ nxsem_post(fds->sem);
+ }
+
+errout_with_lock:
net_unlock();
}
- else
+ else
{
- /* Cancel any response notifications */
+ info = (FAR struct can_poll_s *)fds->priv;
+
+ if (info != NULL)
+ {
+ /* Cancel any response notifications */
+ can_callback_free(info->dev, conn, info->cb);
+
+ /* Release the poll/select data slot */
+
+ info->fds->priv = NULL;
+
+ /* Then free the poll info container */
- conn->pollsem = NULL;
- conn->pollevent = NULL;
+ info->psock = NULL;
+ }
}
return ret;
diff --git a/net/socket/Kconfig b/net/socket/Kconfig
index c627ea5..8b71ade 100644
--- a/net/socket/Kconfig
+++ b/net/socket/Kconfig
@@ -37,6 +37,12 @@ config NET_UDPPROTO_OPTIONS
---help---
Enable or disable support for UDP protocol level socket options.
+config NET_CANPROTO_OPTIONS
+ bool
+ default n
+ ---help---
+ Enable or disable support for CAN protocol level socket option
+
if NET_SOCKOPTS
config NET_SOLINGER
diff --git a/net/socket/getsockopt.c b/net/socket/getsockopt.c
index e7474ad..bc07a03 100644
--- a/net/socket/getsockopt.c
+++ b/net/socket/getsockopt.c
@@ -371,6 +371,12 @@ int psock_getsockopt(FAR struct socket *psock, int level, int option,
break;
#endif
+ case SOL_CAN_RAW:
+#ifdef CONFIG_NET_TCPPROTO_OPTIONS
+ ret = can_getsockopt(psock, option, value, value_len);
+#endif
+ break;
+
/* These levels are defined in sys/socket.h, but are not yet
* implemented.
*/
[incubator-nuttx] 21/31: S32K1XX SocketCAN style fixes
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 5f13717f56e276ef5d7a79aca50d8fea5759ccfd
Author: Jari van Ewijk <ja...@nxp.com>
AuthorDate: Fri Mar 13 12:29:56 2020 +0100
S32K1XX SocketCAN style fixes
---
arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h | 49 ++--
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 362 +++++++++++++-----------
arch/arm/src/s32k1xx/s32k1xx_flexcan.h | 4 +-
arch/arm/src/s32k1xx/s32k1xx_rtc.c | 14 +-
4 files changed, 224 insertions(+), 205 deletions(-)
diff --git a/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h b/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
index 03d3d90..14f337b 100644
--- a/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
+++ b/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
@@ -70,7 +70,7 @@
#define S32K1XX_CAN_MB_OFFSET 0x0080 /* CAN MB register */
-#define S32K1XX_CAN_RXIMR_OFFSET(n) (0x0880 + ((n) << 2)) /* Rn Individual Mask Registers */
+#define S32K1XX_CAN_RXIMR_OFFSET(n) (0x0880 + ((n) << 2))
# define S32K1XX_CAN_RXIMR0_OFFSET 0x0880 /* R0 Individual Mask Registers */
# define S32K1XX_CAN_RXIMR1_OFFSET 0x0884 /* R1 Individual Mask Registers */
# define S32K1XX_CAN_RXIMR2_OFFSET 0x0888 /* R2 Individual Mask Registers */
@@ -144,7 +144,7 @@
#define S32K1XX_CAN_FDCTRL_OFFSET 0x0c00 /* CAN FD Control register */
#define S32K1XX_CAN_FDCBT_OFFSET 0x0c04 /* CAN FD Bit Timing register */
-#define S32K1XX_CAN_FDCRC_OFFSET 0x0c08 /* CAN FD CRC register */
+#define S32K1XX_CAN_FDCRC_OFFSET 0x0c08 /* CAN FD CRC register */
/* Register Addresses ***************************************************************************************/
@@ -343,11 +343,13 @@
#define CAN_MCR_MAXMB_MASK (0x7f << CAN_MCR_MAXMB_SHIFT)
/* Bit 7: Reserved */
#define CAN_MCR_IDAM_SHIFT (8) /* Bits 8-9: ID Acceptance Mode */
+
#define CAN_MCR_IDAM_MASK (3 << CAN_MCR_IDAM_SHIFT)
# define CAN_MCR_IDAM_FMTA (0 << CAN_MCR_IDAM_SHIFT) /* Format A: One full ID */
# define CAN_MCR_IDAM_FMTB (1 << CAN_MCR_IDAM_SHIFT) /* Format B: Two full (or partial) IDs */
# define CAN_MCR_IDAM_FMTC (2 << CAN_MCR_IDAM_SHIFT) /* Format C: Four partial IDs */
# define CAN_MCR_IDAM_FMTD (3 << CAN_MCR_IDAM_SHIFT) /* Format D: All frames rejected */
+
/* Bit 10: Reserved */
#define CAN_MCR_FDEN (1 << 11) /* Bit 11: CAN FD operation enable */
#define CAN_MCR_AEN (1 << 12) /* Bit 12: Abort Enable */
@@ -386,13 +388,13 @@
#define CAN_CTRL1_CLKSRC (1 << 13) /* Bit 13: CAN Engine Clock Source */
#define CAN_CTRL1_ERRMSK (1 << 14) /* Bit 14: Error Mask */
#define CAN_CTRL1_BOFFMSK (1 << 15) /* Bit 15: Bus Off Mask */
-#define CAN_CTRL1_PSEG2_SHIFT (16) /* Bits 16-18: Phase Segment 2 */
+#define CAN_CTRL1_PSEG2_SHIFT (16) /* Bits 16-18: Phase Segment 2 */
#define CAN_CTRL1_PSEG2_MASK (7 << CAN_CTRL1_PSEG2_SHIFT)
-#define CAN_CTRL1_PSEG1_SHIFT (19) /* Bits 19-21: Phase Segment 1 */
+#define CAN_CTRL1_PSEG1_SHIFT (19) /* Bits 19-21: Phase Segment 1 */
#define CAN_CTRL1_PSEG1_MASK (7 << CAN_CTRL1_PSEG1_SHIFT)
-#define CAN_CTRL1_RJW_SHIFT (22) /* Bits 22-23: Resync Jump Width */
+#define CAN_CTRL1_RJW_SHIFT (22) /* Bits 22-23: Resync Jump Width */
#define CAN_CTRL1_RJW_MASK (3 << CAN_CTRL1_RJW_SHIFT)
-#define CAN_CTRL1_PRESDIV_SHIFT (24) /* Bits 24-31: Prescaler Division Factor */
+#define CAN_CTRL1_PRESDIV_SHIFT (24) /* Bits 24-31: Prescaler Division Factor */
#define CAN_CTRL1_PRESDIV_MASK (0xff << CAN_CTRL1_PRESDIV_SHIFT)
/* Free Running Timer */
@@ -418,8 +420,8 @@
#define CAN_ECR_TXERRCNT_SHIFT (0) /* Bits 0-7: Transmit Error Counter */
#define CAN_ECR_TXERRCNT_MASK (0xff << CAN_ECR_TXERRCNT_SHIFT)
#define CAN_ECR_RXERRCNT_SHIFT (8) /* Bits 8-15: Receive Error Counter */
-#define CAN_ECR_RXERRCNT_MASK (0xff << CAN_ECR_RXERRCNT_SHIFT)
- /* Bits 16-31: Reserved */
+#define CAN_ECR_RXERRCNT_MASK (0xff << CAN_ECR_RXERRCNT_SHIFT)
+ /* Bits 16-31: Reserved */
/* Error and Status 1 Register */
@@ -428,13 +430,15 @@
#define CAN_ESR1_BOFFINT (1 << 2) /* Bit 2: 'Bus Off' Interrupt */
#define CAN_ESR1_RX (1 << 3) /* Bit 3: FlexCAN in Reception */
#define CAN_ESR1_FLTCONF_SHIFT (4) /* Bits 4-5: Fault Confinement State */
+
#define CAN_ESR1_FLTCONF_MASK (3 << CAN_ESR1_FLTCONF_SHIFT)
# define CAN_ESR1_FLTCONF_ACTV (0 << CAN_ESR1_FLTCONF_SHIFT) /* Error Active */
# define CAN_ESR1_FLTCONF_PASV (1 << CAN_ESR1_FLTCONF_SHIFT) /* Error Passive */
# define CAN_ESR1_FLTCONF_OFF (2 << CAN_ESR1_FLTCONF_SHIFT) /* Bus Off */
+
#define CAN_ESR1_TX (1 << 6) /* Bit 6: FlexCAN in Transmission */
#define CAN_ESR1_IDLE (1 << 7) /* Bit 7: CAN bus is in IDLE state */
-#define CAN_ESR1_RXWRN (1 << 8) /* Bit 8: Rx Error Warning */
+#define CAN_ESR1_RXWRN (1 << 8) /* Bit 8: Rx Error Warning */
#define CAN_ESR1_TXWRN (1 << 9) /* Bit 9: TX Error Warning */
#define CAN_ESR1_STFERR (1 << 10) /* Bit 10: Stuffing Error */
#define CAN_ESR1_FRMERR (1 << 11) /* Bit 11: Form Error */
@@ -446,6 +450,7 @@
#define CAN_ESR1_TWRNINT (1 << 17) /* Bit 17: Tx Warning Interrupt Flag */
#define CAN_ESR1_SYNCH (1 << 18) /* Bit 18: CAN Synchronization Status */
/* Bits 19-31: Reserved */
+
/* Interrupt Masks 2 Register */
#define CAN_IMASK2(n) (1 << (n)) /* Bit n: Buffer MBn Mask */
@@ -463,6 +468,7 @@
#define CAN_IFLAG1(n) (1 << (n)) /* Bit n: Buffer MBn Interrupt, n=0..4,8..31 */
/* Control 2 Register */
+
/* Bits 0-10: Reserved */
#define CAN_CTRL2_EDFLTDIS (1 << 11) /* Bit 11: Edge Filter Disable */
#define CAN_CTRL2_ISOCANFDEN (1 << 12) /* Bit 12: ISO CAN FD Enable */
@@ -496,6 +502,7 @@
/* Bits 29-31: Reserved */
/* Error and Status 2 Register */
+
/* Bits 0-12: Reserved */
#define CAN_ESR2_IMB (1 << 13) /* Bit 13: Inactive Mailbox */
#define CAN_ESR2_VPS (1 << 14) /* Bit 14: Valid Priority Status */
@@ -516,6 +523,7 @@
/* Rx FIFO Global Mask Register (32 Rx FIFO Global Mask Bits) */
/* Rx FIFO Information Register */
+
/* Bits 9-31: Reserved */
#define CAN_RXFIR_IDHIT_SHIFT (0) /* Bits 0-8: Identifier Acceptance Filter Hit Indicator */
#define CAN_RXFIR_IDHIT_MASK (0x1ff << CAN_RXFIR_IDHIT_SHIFT)
@@ -531,12 +539,12 @@
#define CAN_CBT_BTF (1 << 31) /* Bit 31: Bit Timing Format Enable */
/* CAN MB TX codes */
-#define CAN_TXMB_INACTIVE 0x8 /* MB is not active.*/
-#define CAN_TXMB_ABORT 0x9 /* MB is aborted.*/
+#define CAN_TXMB_INACTIVE 0x8 /* MB is not active. */
+#define CAN_TXMB_ABORT 0x9 /* MB is aborted. */
#define CAN_TXMB_DATAORREMOTE 0xC /* MB is a TX Data Frame(when MB RTR = 0) or */
- /* MB is a TX Remote Request Frame (when MB RTR = 1).*/
+ /* MB is a TX Remote Request Frame (when MB RTR = 1). */
#define CAN_TXMB_TANSWER 0xE /* MB is a TX Response Request Frame from */
- /* an incoming Remote Request Frame.*/
+ /* an incoming Remote Request Frame. */
#define CAN_TXMB_NOTUSED 0xF /* Not used.*/
/* CAN FD Control register (FDCTRL) */
@@ -558,12 +566,11 @@
#define CAN_FDCRC_FD_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << 0)) & 0x1FFFFF)
#define CAN_FDCRC_FD_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << 24)) & 0x7F000000)
-
/* Rn Individual Mask Registers */
#define CAN_RXIMR(n) (1 << (n)) /* Bit n: Individual Mask Bits */
- /* Pretended Networking Control 1 register */
+/* Pretended Networking Control 1 register */
#define CAN_CTRL1_PN_
/* Pretended Networking Control 2 register */
@@ -614,16 +621,4 @@
/* CAN FD CRC register */
#define CAN_FDCRC_
-/****************************************************************************************************
- * Public Types
- ****************************************************************************************************/
-
-/****************************************************************************************************
- * Public Data
- ****************************************************************************************************/
-
-/****************************************************************************************************
- * Public Functions
- ****************************************************************************************************/
-
#endif /* __ARCH_ARM_SRC_S32K1XX_HARDWARE_S32K1XX_FLEXCAN_H */
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 2654c2e..15e5b62 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -63,14 +63,17 @@
* is required.
*/
-
/* FIXME A workqueue is required for enet but for FLEXCAN it increased the
* transmit latency by ~ 40us from 24 to 67us
* Therefore for now its configurable by the WORK_QUEUE define
* If we know for sure that a workqueue isn't required
- * Then all WORK_QUEUE related code will be removed */
+ * Then all WORK_QUEUE related code will be removed
+ */
+
#if !defined(CONFIG_SCHED_WORKQUEUE)
-//# error Work queue support is required
+
+/* # error Work queue support is required */
+
#else
/* Select work queue. Always use the LP work queue if available. If not,
@@ -81,12 +84,14 @@
* processing that never suspends. Suspending the high priority work queue
* may bring the system to its knees!
*/
-//# define WORK_QUEUE
+
+/* # define WORK_QUEUE */
+
# define CANWORK LPWORK
#endif
-/* CONFIG_S32K1XX_FLEXCAN_NETHIFS determines the number of physical interfaces
- * that will be supported.
+/* CONFIG_S32K1XX_FLEXCAN_NETHIFS determines the number of physical
+ * interfaces that will be supported.
*/
#define MASKSTDID 0x000007ff
@@ -214,8 +219,8 @@ struct s32k1xx_driver_s
struct canfd_frame *txdesc; /* A pointer to the list of TX descriptor */
struct canfd_frame *rxdesc; /* A pointer to the list of RX descriptors */
#else
- struct can_frame *txdesc; /* A pointer to the list of TX descriptor */
- struct can_frame *rxdesc; /* A pointer to the list of RX descriptors */
+ struct can_frame *txdesc; /* A pointer to the list of TX descriptor */
+ struct can_frame *rxdesc; /* A pointer to the list of RX descriptors */
#endif
/* This holds the information visible to the NuttX network */
@@ -242,7 +247,6 @@ static uint8_t g_rx_pool[sizeof(struct can_frame)*POOL_SIZE]
__attribute__((aligned(ARMV7M_DCACHE_LINESIZE)));
#endif
-
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
@@ -284,8 +288,10 @@ static uint32_t s32k1xx_waitmcr_change(uint32_t mask,
/* Interrupt handling */
-static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags);
-static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags);
+static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv,
+ uint32_t flags);
+static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv,
+ uint32_t flags);
static int s32k1xx_flexcan_interrupt(int irq, FAR void *context,
FAR void *arg);
@@ -338,13 +344,15 @@ static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv)
uint32_t mbi = 0;
while (mbi < TXMBCOUNT)
- {
- if (priv->tx[mbi].cs.code != CAN_TXMB_DATAORREMOTE)
- {
- return 0;
- }
- mbi++;
- }
+ {
+ if (priv->tx[mbi].cs.code != CAN_TXMB_DATAORREMOTE)
+ {
+ return 0;
+ }
+
+ mbi++;
+ }
+
return 1;
}
@@ -379,7 +387,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
(CAN_ESR2_IMB | CAN_ESR2_VPS))
{
mbi = ((getreg32(S32K1XX_CAN0_ESR2) &
- CAN_ESR2_LPTM_MASK) >> CAN_ESR2_LPTM_SHIFT);
+ CAN_ESR2_LPTM_MASK) >> CAN_ESR2_LPTM_SHIFT);
mbi -= RXMBCOUNT;
}
@@ -411,98 +419,96 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
struct mb_s *mb = &priv->tx[mbi];
mb->cs.code = CAN_TXMB_INACTIVE;
- if(priv->dev.d_len == sizeof(struct can_frame))
+ if (priv->dev.d_len == sizeof(struct can_frame))
{
- struct can_frame *frame = (struct can_frame *)priv->dev.d_buf;
-
- if (frame->can_id & CAN_EFF_FLAG)
- {
- cs.ide = 1;
- mb->id.ext = frame->can_id & MASKEXTID;
- }
- else
- {
- mb->id.std = frame->can_id & MASKSTDID;
- }
+ struct can_frame *frame = (struct can_frame *)priv->dev.d_buf;
- #if 0
- cs.rtr = frame.isRemoteTransmissionRequest();
- #endif
+ if (frame->can_id & CAN_EFF_FLAG)
+ {
+ cs.ide = 1;
+ mb->id.ext = frame->can_id & MASKEXTID;
+ }
+ else
+ {
+ mb->id.std = frame->can_id & MASKSTDID;
+ }
- cs.dlc = frame->can_dlc;
+ #if 0
+ /* cs.rtr = frame.isRemoteTransmissionRequest(); */
+ #endif
- mb->data[0].w00 = __builtin_bswap32(*(uint32_t*)&frame->data[0]);
- mb->data[1].w00 = __builtin_bswap32(*(uint32_t*)&frame->data[4]);
+ cs.dlc = frame->can_dlc;
+ mb->data[0].w00 = __builtin_bswap32(*(uint32_t *)&frame->data[0]);
+ mb->data[1].w00 = __builtin_bswap32(*(uint32_t *)&frame->data[4]);
}
else /* CAN FD frame */
{
- struct canfd_frame *frame = (struct canfd_frame *)priv->dev.d_buf;
-
- cs.edl = 1; /* CAN FD Frame */
-
- if (frame->can_id & CAN_EFF_FLAG)
- {
- cs.ide = 1;
- mb->id.ext = frame->can_id & MASKEXTID;
- }
- else
- {
- mb->id.std = frame->can_id & MASKSTDID;
- }
-
- #if 0
- cs.rtr = frame.isRemoteTransmissionRequest();
- #endif
-
- if(frame->len < 9)
- {
- cs.dlc = frame->len;
- }
- else
- {
- if (frame->len < 13)
- {
- cs.dlc = 9;
- }
- else if (frame->len < 17)
- {
- cs.dlc = 10;
- }
- else if (frame->len < 21)
- {
- cs.dlc = 11;
- }
- else if (frame->len < 25)
- {
- cs.dlc = 12;
- }
- else if (frame->len < 33)
- {
- cs.dlc = 13;
- }
- else if (frame->len < 49)
- {
- cs.dlc = 14;
- }
- else if (frame->len < 65)
- {
- cs.dlc = 15;
- }
- else
- {
- cs.dlc = 15; /* FIXME check CAN FD spec */
- }
- }
-
- uint32_t* frame_data_word = (uint32_t*)&frame->data[0];
-
- for(int i = 0; i < (frame->len + 4 - 1) / 4; i++)
- {
- mb->data[i].w00 = __builtin_bswap32(frame_data_word[i]);
- }
- }
+ struct canfd_frame *frame = (struct canfd_frame *)priv->dev.d_buf;
+
+ cs.edl = 1; /* CAN FD Frame */
+
+ if (frame->can_id & CAN_EFF_FLAG)
+ {
+ cs.ide = 1;
+ mb->id.ext = frame->can_id & MASKEXTID;
+ }
+ else
+ {
+ mb->id.std = frame->can_id & MASKSTDID;
+ }
+#if 0
+ /* cs.rtr = frame.isRemoteTransmissionRequest(); */
+#endif
+
+ if (frame->len < 9)
+ {
+ cs.dlc = frame->len;
+ }
+ else
+ {
+ if (frame->len < 13)
+ {
+ cs.dlc = 9;
+ }
+ else if (frame->len < 17)
+ {
+ cs.dlc = 10;
+ }
+ else if (frame->len < 21)
+ {
+ cs.dlc = 11;
+ }
+ else if (frame->len < 25)
+ {
+ cs.dlc = 12;
+ }
+ else if (frame->len < 33)
+ {
+ cs.dlc = 13;
+ }
+ else if (frame->len < 49)
+ {
+ cs.dlc = 14;
+ }
+ else if (frame->len < 65)
+ {
+ cs.dlc = 15;
+ }
+ else
+ {
+ cs.dlc = 15; /* FIXME check CAN FD spec */
+ }
+ }
+
+ uint32_t *frame_data_word = (uint32_t *)&frame->data[0];
+
+ for (int i = 0; i < (frame->len + 4 - 1) / 4; i++)
+ {
+ mb->data[i].w00 = __builtin_bswap32(frame_data_word[i]);
+ }
+ }
s32k1xx_gpiowrite(PIN_PORTD | PIN31, 0);
@@ -560,9 +566,13 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
s32k1xx_transmit(priv);
#if 0
- //FIXME implement ring buffer and increment pointer just like the enet driver??
+ /* FIXME implement ring buffer and increment pointer just like the
+ * enet driver??
+ */
+
priv->dev.d_buf =
- (uint8_t *)s32k1xx_swap32((uint32_t)priv->txdesc[priv->txhead].data);
+ (uint8_t *)s32k1xx_swap32(
+ (uint32_t)priv->txdesc[priv->txhead].data);
#endif
/* Check if there is room in the device to hold another packet. If
@@ -583,7 +593,6 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
return 0;
}
-
/****************************************************************************
* Function: s32k1xx_receive
*
@@ -601,15 +610,16 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
*
****************************************************************************/
-static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
+static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv,
+ uint32_t flags)
{
#warning Missing logic
uint32_t regval;
s32k1xx_gpiowrite(PIN_PORTD | PIN31, 1);
+ /* FIXME naive what if multiple flags are high?? */
- //FIXME naive what if multiple flags are high??
uint32_t mb_index = arm_clz(flags);
if (mb_index)
@@ -618,9 +628,9 @@ static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
/* Read the frame contents */
- if(rf->cs.edl) /* CAN FD frame */
+ if (rf->cs.edl) /* CAN FD frame */
{
- struct canfd_frame* frame = priv->rxdesc;
+ struct canfd_frame *frame = priv->rxdesc;
if (rf->cs.ide)
{
@@ -637,49 +647,53 @@ static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
frame->can_id |= FLAGRTR;
}
- if(rf->cs.dlc < 9){
+ if (rf->cs.dlc < 9)
+ {
frame->len = rf->cs.dlc;
- } else {
- switch(rf->cs.dlc)
- {
- case 9:
- frame->len = 12;
- break;
-
- case 10:
- frame->len = 16;
- break;
-
- case 11:
- frame->len = 20;
- break;
-
- case 12:
- frame->len = 24;
- break;
-
- case 13:
- frame->len = 32;
- break;
-
- case 14:
- frame->len = 48;
- break;
-
- case 15:
- frame->len = 64;
- break;
- }
- }
-
- uint32_t* frame_data_word = (uint32_t*)&frame->data[0];
-
- for(int i = 0; i < (frame->len + 4 - 1) / 4; i++)
+ }
+ else
{
- frame_data_word[i] = __builtin_bswap32(rf->data[i].w00);
+ switch (rf->cs.dlc)
+ {
+ case 9:
+ frame->len = 12;
+ break;
+
+ case 10:
+ frame->len = 16;
+ break;
+
+ case 11:
+ frame->len = 20;
+ break;
+
+ case 12:
+ frame->len = 24;
+ break;
+
+ case 13:
+ frame->len = 32;
+ break;
+
+ case 14:
+ frame->len = 48;
+ break;
+
+ case 15:
+ frame->len = 64;
+ break;
+ }
+ }
+
+ uint32_t *frame_data_word = (uint32_t *)&frame->data[0];
+
+ for (int i = 0; i < (frame->len + 4 - 1) / 4; i++)
+ {
+ frame_data_word[i] = __builtin_bswap32(rf->data[i].w00);
}
/* Clear MB interrupt flag */
+
regval = getreg32(S32K1XX_CAN0_IFLAG1);
regval |= (0x80000000 >> mb_index);
putreg32(regval, S32K1XX_CAN0_IFLAG1);
@@ -693,7 +707,7 @@ static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
}
else /* CAN 2.0 Frame */
{
- struct can_frame* frame = priv->rxdesc;
+ struct can_frame *frame = priv->rxdesc;
if (rf->cs.ide)
{
@@ -712,10 +726,11 @@ static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
frame->can_dlc = rf->cs.dlc;
- *(uint32_t*)&frame->data[0] = __builtin_bswap32(rf->data[0].w00);
- *(uint32_t*)&frame->data[4] = __builtin_bswap32(rf->data[1].w00);
+ *(uint32_t *)&frame->data[0] = __builtin_bswap32(rf->data[0].w00);
+ *(uint32_t *)&frame->data[4] = __builtin_bswap32(rf->data[1].w00);
/* Clear MB interrupt flag */
+
regval = getreg32(S32K1XX_CAN0_IFLAG1);
regval |= (1 << mb_index);
putreg32(regval, S32K1XX_CAN0_IFLAG1);
@@ -740,6 +755,7 @@ static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
* to. This is OK because devif_poll won't be called unless the
* queue is not full.
*/
+
priv->dev.d_buf = priv->txdesc;
}
}
@@ -785,9 +801,12 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
flags &= ~mb_bit;
-#if 0 //FIXME TB ABORT SUPPORT
- const bool txok = priv->tx[mbi].cs.code != CAN_TXMB_ABORT;
- handleTxMailboxInterrupt(mbi, txok, utc_usec);
+#if 0
+ /* FIXME TB ABORT SUPPORT */
+
+ /* const bool txok = priv->tx[mbi].cs.code != CAN_TXMB_ABORT;
+ * handleTxMailboxInterrupt(mbi, txok, utc_usec);
+ */
#endif
NETDEV_TXDONE(&priv->dev);
@@ -803,7 +822,6 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
devif_poll(&priv->dev, s32k1xx_txpoll);
}
-
/****************************************************************************
* Function: s32k1xx_flexcan_interrupt
*
@@ -824,7 +842,8 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
*
****************************************************************************/
-static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
+static int s32k1xx_flexcan_interrupt(int irq, FAR void *context,
+ FAR void *arg)
{
#warning Missing logic
FAR struct s32k1xx_driver_s *priv = &g_flexcan[0];
@@ -1018,6 +1037,7 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
#ifdef WORK_QUEUE
/* Set and activate a timer process */
+
wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, 1,
(wdparm_t)priv);
#endif
@@ -1232,13 +1252,13 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
return -1;
}
+ /* Based on 80 MHz BUS clock calc through S32DS */
- /* Based on 80Mhz BUS clock calc through S32DS */
regval = getreg32(S32K1XX_CAN0_CBT);
- regval |= CAN_CBT_BTF | /* Enable extended bit timing configurations
- * for CAN-FD for setting up separately
- * nominal and data phase */
- CAN_CBT_EPRESDIV(3) | /* Prescaler divisor factor of 3 */
+ regval |= CAN_CBT_BTF | /* Enable extended bit timing
+ * configurations for CAN-FD for setting up
+ * separately nominal and data phase */
+ CAN_CBT_EPRESDIV(3) | /* Prescaler divisor factor of 3 */
CAN_CBT_EPROPSEG(7) | /* Propagation segment of 7 time quantas */
CAN_CBT_EPSEG1(6) | /* Phase buffer segment 1 of 6 time quantas */
CAN_CBT_EPSEG2(3) | /* Phase buffer segment 2 of 3 time quantas */
@@ -1252,14 +1272,15 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
regval |= CAN_MCR_FDEN;
putreg32(regval, S32K1XX_CAN0_MCR);
- /* Based on 80Mhz BUS clock calc through S32DS */
+ /* Based on 80 MHz BUS clock calc through S32DS */
+
regval = getreg32(S32K1XX_CAN0_FDCBT);
- regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
- CAN_FDCBT_FPROPSEG(15) | /* Propagation semgment of 7 time quantas
- * (only register that doesn't add 1) */
- CAN_FDCBT_FPSEG1(1) | /* Phase buffer segment 1 of 7 time quantas */
- CAN_FDCBT_FPSEG2(1) | /* Phase buffer segment 2 of 5 time quantas */
- CAN_FDCBT_FRJW(1); /* Resynchorinzation jump width same as PSEG2 */
+ regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
+ CAN_FDCBT_FPROPSEG(15) | /* Propagation segment of 7 time quantas
+ * (only register that doesn't add 1) */
+ CAN_FDCBT_FPSEG1(1) | /* Phase buffer segment 1 of 7 time quantas */
+ CAN_FDCBT_FPSEG2(1) | /* Phase buffer segment 2 of 5 time quantas */
+ CAN_FDCBT_FRJW(1); /* Resynchorinzation jump width same as PSEG2 */
putreg32(regval, S32K1XX_CAN0_FDCBT);
/* Additional CAN-FD configurations */
@@ -1280,7 +1301,8 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
for (i = TXMBCOUNT; i < TOTALMBCOUNT; i++)
{
priv->rx[i].id.w = 0x0;
- //FIXME sometimes we get a hard fault here
+
+ /* FIXME sometimes we get a hard fault here */
}
putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
@@ -1369,7 +1391,8 @@ static void s32k1xx_reset(struct s32k1xx_driver_s *priv)
regval = getreg32(S32K1XX_CAN0_MCR);
regval |= CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS |
CAN_MCR_IRMQ | CAN_MCR_AEN |
- (((TOTALMBCOUNT - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
+ (((TOTALMBCOUNT - 1) << CAN_MCR_MAXMB_SHIFT) &
+ CAN_MCR_MAXMB_MASK);
putreg32(regval, S32K1XX_CAN0_MCR);
regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN; /* FIXME TASD */
@@ -1474,6 +1497,7 @@ int s32k1xx_netinitialize(int intf)
#ifdef WORK_QUEUE
/* Create a watchdog for timing polling for and timing of transmissions */
+
priv->txpoll = wd_create(); /* Create periodic poll timer */
priv->txtimeout = wd_create(); /* Create TX timeout timer */
#endif
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.h b/arch/arm/src/s32k1xx/s32k1xx_flexcan.h
index 9dfe681..4568e0f 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.h
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.h
@@ -50,9 +50,8 @@
* Pre-processor Definitions
************************************************************************************/
-
/************************************************************************************
- * Public Functions
+ * Public Function Prototypes
************************************************************************************/
#ifndef __ASSEMBLY__
@@ -106,7 +105,6 @@ void up_netinitialize(void);
*
************************************************************************************/
-
#undef EXTERN
#if defined(__cplusplus)
}
diff --git a/arch/arm/src/s32k1xx/s32k1xx_rtc.c b/arch/arm/src/s32k1xx/s32k1xx_rtc.c
index 7f84dcf..f407c8e 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_rtc.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_rtc.c
@@ -183,12 +183,14 @@ int up_rtc_initialize(void)
regval = getreg32(S32K1XX_RTC_SR);
- if(regval & RTC_SR_TIF)
+ if (regval & RTC_SR_TIF)
{
- regval &= ~RTC_SR_TCE;
- putreg32(regval, S32K1XX_RTC_SR);
+ regval &= ~RTC_SR_TCE;
+ putreg32(regval, S32K1XX_RTC_SR);
+
/* Write TSR register to clear invalid */
- putreg32(0x0, S32K1XX_RTC_TSR);
+
+ putreg32(0x0, S32K1XX_RTC_TSR);
}
/* Enable the rtc */
@@ -295,11 +297,11 @@ int up_rtc_gettime(FAR struct timespec *tp)
int up_rtc_settime(FAR const struct timespec *ts)
{
DEBUGASSERT(ts != NULL);
-
+
irqstate_t flags;
uint32_t seconds;
uint32_t prescaler;
-
+
seconds = ts->tv_sec;
prescaler = ts->tv_nsec * (CONFIG_RTC_FREQUENCY / 1000000000);
[incubator-nuttx] 20/31: S32K1XX Added High res timer support
FlexCAN allocate memory for timestamp
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit cd52a3f042dfdec9eaa2646da4bfad850ad277c8
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Thu Mar 12 13:59:33 2020 +0100
S32K1XX Added High res timer support
FlexCAN allocate memory for timestamp
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 14 +++++-
arch/arm/src/s32k1xx/s32k1xx_rtc.c | 79 ++++++++++++++++++++++++++++++++--
arch/arm/src/s32k1xx/s32k1xx_rtc.h | 8 ----
3 files changed, 87 insertions(+), 14 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 8e79833..2654c2e 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -49,6 +49,10 @@
#include "s32k1xx_pin.h"
#include "s32k1xx_flexcan.h"
+#ifdef CONFIG_NET_TIMESTAMP
+#include <sys/time.h>
+#endif
+
#ifdef CONFIG_S32K1XX_FLEXCAN
/****************************************************************************
@@ -108,6 +112,12 @@
#define POOL_SIZE 1
+#ifdef CONFIG_NET_TIMESTAMP
+#define MSG_DATA sizeof(struct timeval)
+#else
+#define MSG_DATA 0
+#endif
+
/* Interrupt flags for RX fifo */
#define IFLAG1_RXFIFO (CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV)
@@ -223,8 +233,8 @@ struct s32k1xx_driver_s
static struct s32k1xx_driver_s g_flexcan[CONFIG_S32K1XX_ENET_NETHIFS];
#ifdef CAN_FD
-static uint8_t g_tx_pool[sizeof(struct canfd_frame)*POOL_SIZE];
-static uint8_t g_rx_pool[sizeof(struct canfd_frame)*POOL_SIZE];
+static uint8_t g_tx_pool[(sizeof(struct canfd_frame)+MSG_DATA)*POOL_SIZE];
+static uint8_t g_rx_pool[(sizeof(struct canfd_frame)+MSG_DATA)*POOL_SIZE];
#else
static uint8_t g_tx_pool[sizeof(struct can_frame)*POOL_SIZE]
__attribute__((aligned(ARMV7M_DCACHE_LINESIZE)));
diff --git a/arch/arm/src/s32k1xx/s32k1xx_rtc.c b/arch/arm/src/s32k1xx/s32k1xx_rtc.c
index 7c70b76..7f84dcf 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_rtc.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_rtc.c
@@ -157,11 +157,11 @@ int up_rtc_initialize(void)
putreg32(regval, S32K1XX_RTC_CR);
- /* Set LPO_1KHZ clock source */
+ /* Increment on 32.768Khz clock */
regval = getreg32(S32K1XX_RTC_CR);
- regval |= RTC_CR_LPOS;
+ regval &= ~RTC_CR_LPOS;
putreg32(regval, S32K1XX_RTC_CR);
@@ -181,6 +181,16 @@ int up_rtc_initialize(void)
putreg32(regval, S32K1XX_RTC_CR);
+ regval = getreg32(S32K1XX_RTC_SR);
+
+ if(regval & RTC_SR_TIF)
+ {
+ regval &= ~RTC_SR_TCE;
+ putreg32(regval, S32K1XX_RTC_SR);
+ /* Write TSR register to clear invalid */
+ putreg32(0x0, S32K1XX_RTC_TSR);
+ }
+
/* Enable the rtc */
s32k1xx_rtc_enable();
@@ -207,7 +217,7 @@ int up_rtc_initialize(void)
* The current time in seconds
*
****************************************************************************/
-
+#ifndef CONFIG_RTC_HIRES
time_t up_rtc_time(void)
{
uint32_t regval;
@@ -217,6 +227,55 @@ time_t up_rtc_time(void)
return (uint32_t) (regval);
}
+#endif
+
+/****************************************************************************
+ * Name: up_rtc_gettime
+ *
+ * Description:
+ * Get the current time from the high resolution RTC clock/counter. This
+ * interface is only supported by the high-resolution RTC/counter hardware
+ * implementation. It is used to replace the system timer.
+ *
+ * Input Parameters:
+ * tp - The location to return the high resolution time value.
+ *
+ * Returned Value:
+ * Zero (OK) on success; a negated errno on failure
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_RTC_HIRES
+int up_rtc_gettime(FAR struct timespec *tp)
+{
+ irqstate_t flags;
+ uint32_t seconds;
+ uint32_t prescaler;
+ uint32_t prescaler2;
+
+ /* Get prescaler and seconds register. this is in a loop which ensures that
+ * registers will be re-read if during the reads the prescaler has
+ * wrapped-around.
+ */
+
+ flags = enter_critical_section();
+ do
+ {
+ prescaler = getreg32(S32K1XX_RTC_TPR);
+ seconds = getreg32(S32K1XX_RTC_TSR);
+ prescaler2 = getreg32(S32K1XX_RTC_TPR);
+ }
+ while (prescaler > prescaler2);
+
+ leave_critical_section(flags);
+
+ /* Build seconds + nanoseconds from seconds and prescaler register */
+
+ tp->tv_sec = seconds;
+ tp->tv_nsec = prescaler * (1000000000 / CONFIG_RTC_FREQUENCY);
+ return OK;
+}
+#endif
/****************************************************************************
* Name: up_rtc_settime
@@ -236,13 +295,25 @@ time_t up_rtc_time(void)
int up_rtc_settime(FAR const struct timespec *ts)
{
DEBUGASSERT(ts != NULL);
+
+ irqstate_t flags;
+ uint32_t seconds;
+ uint32_t prescaler;
+
+ seconds = ts->tv_sec;
+ prescaler = ts->tv_nsec * (CONFIG_RTC_FREQUENCY / 1000000000);
+
+ flags = enter_critical_section();
s32k1xx_rtc_disable();
- putreg32((uint32_t)ts->tv_sec, S32K1XX_RTC_TSR);
+ putreg32(prescaler, S32K1XX_RTC_TPR); /* Always write prescaler first */
+ putreg32(seconds, S32K1XX_RTC_TSR);
s32k1xx_rtc_enable();
+ leave_critical_section(flags);
+
return OK;
}
diff --git a/arch/arm/src/s32k1xx/s32k1xx_rtc.h b/arch/arm/src/s32k1xx/s32k1xx_rtc.h
index b00c3d3..35ce10d 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_rtc.h
+++ b/arch/arm/src/s32k1xx/s32k1xx_rtc.h
@@ -58,14 +58,6 @@
# error CONFIG_RTC_PERIODIC should not be selected with this driver
# endif
-/* REVISIT: This is probably supportable. The 47 bit timer does have
- * accuracy greater than 1 second.
- */
-
-# ifdef CONFIG_RTC_HIRES
-# error CONFIG_RTC_PERIODIC should not be selected with this driver
-# endif
-
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
[incubator-nuttx] 22/31: Code style fixes
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 80582342e991014f5026ba6638f8fde617f2cce0
Author: Jari van Ewijk <ja...@nxp.com>
AuthorDate: Fri Mar 13 13:48:10 2020 +0100
Code style fixes
---
fs/vfs/fs_write.c | 3 ++-
include/netpacket/can.h | 46 +++++++++++++++++++++++-----------------------
include/nuttx/can/error.h | 10 ++++++----
include/nuttx/mm/iob.h | 6 ++++--
include/nuttx/net/can.h | 10 ++++------
include/nuttx/net/net.h | 2 +-
6 files changed, 40 insertions(+), 37 deletions(-)
diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c
index ef5f137..b48812e 100644
--- a/fs/vfs/fs_write.c
+++ b/fs/vfs/fs_write.c
@@ -86,7 +86,8 @@
*
****************************************************************************/
-ssize_t file_write(FAR struct file *filep, FAR const void *buf, size_t nbytes)
+ssize_t file_write(FAR struct file *filep, FAR const void *buf,
+ size_t nbytes)
{
FAR struct inode *inode;
diff --git a/include/netpacket/can.h b/include/netpacket/can.h
index 0b4c7b9..4ea2104 100644
--- a/include/netpacket/can.h
+++ b/include/netpacket/can.h
@@ -102,37 +102,37 @@ struct sockaddr_can
sa_family_t can_family;
int16_t can_ifindex;
union
- {
- /* Transport protocol class address information */
+ {
+ /* Transport protocol class address information */
- struct
- {
- canid_t rx_id;
- canid_t tx_id;
- } tp;
+ struct
+ {
+ canid_t rx_id;
+ canid_t tx_id;
+ } tp;
- /* J1939 address information */
+ /* J1939 address information */
- struct
- {
- /* 8 byte name when using dynamic addressing */
+ struct
+ {
+ /* 8 byte name when using dynamic addressing */
- uint64_t name;
+ uint64_t name;
- /* pgn:
- * 8 bit: PS in PDU2 case, else 0
- * 8 bit: PF
- * 1 bit: DP
- * 1 bit: reserved
- */
+ /* pgn:
+ * 8 bit: PS in PDU2 case, else 0
+ * 8 bit: PF
+ * 1 bit: DP
+ * 1 bit: reserved
+ */
- uint32_t pgn;
+ uint32_t pgn;
- /* 1 byte address */
+ /* 1 byte address */
- uint8_t addr;
- } j1939;
- } can_addr;
+ uint8_t addr;
+ } j1939;
+ } can_addr;
};
#endif /* __INCLUDE_NETPACKET_CAN_H */
diff --git a/include/nuttx/can/error.h b/include/nuttx/can/error.h
index 3463328..d9c2396 100644
--- a/include/nuttx/can/error.h
+++ b/include/nuttx/can/error.h
@@ -60,7 +60,8 @@
/* arbitration lost in bit ... / data[0] */
#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
- /* else bit number in bitstream */
+
+/* else bit number in bitstream */
/* error status of CAN-controller / data[1] */
#define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */
@@ -70,8 +71,8 @@
#define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */
#define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */
#define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */
- /* (at least one error counter exceeds */
- /* the protocol-defined level of 127) */
+ /* (at least one error counter exceeds */
+ /* the protocol-defined level of 127) */
#define CAN_ERR_CRTL_ACTIVE 0x40 /* recovered to error active state */
/* error in CAN protocol (type) / data[2] */
@@ -108,7 +109,8 @@
#define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */
/* error status of CAN-transceiver / data[4] */
-/* CANH CANL */
+
+ /* CANH CANL */
#define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */
#define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */
#define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index e986105..32c0bfd 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -252,7 +252,8 @@ void iob_initialize(void);
* Name: iob_alloc
*
* Description:
- * Allocate an I/O buffer by taking the buffer at the head of the free list.
+ * Allocate an I/O buffer by taking the buffer at the head of the free
+ * list.
*
****************************************************************************/
@@ -590,7 +591,8 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
* Name: iob_getuserstats
*
* Description:
- * Return a reference to the IOB usage statistics for the IOB consumer/producer
+ * Return a reference to the IOB usage statistics for the IOB
+ * consumer/producer
*
* Input Parameters:
* userid - id representing the IOB producer/consumer
diff --git a/include/nuttx/net/can.h b/include/nuttx/net/can.h
index d426c7b..9cda480 100644
--- a/include/nuttx/net/can.h
+++ b/include/nuttx/net/can.h
@@ -53,15 +53,15 @@
* Pre-processor Definitions
****************************************************************************/
-#define CAN_HDRLEN 4 //FIXME standard id vs extended
-#define NET_CAN_PKTSIZE sizeof(struct canfd_frame) // max size we can send through socket
-//FIXME think about can & canfd support
+#define CAN_HDRLEN 4 /* FIXME standard id vs extended */
+#define NET_CAN_PKTSIZE sizeof(struct canfd_frame) /* max size we can send through socket*/
+
+/* FIXME think about can & canfd support */
/****************************************************************************
* Public Types
****************************************************************************/
-
/****************************************************************************
* Public Data
****************************************************************************/
@@ -74,8 +74,6 @@ extern "C"
#define EXTERN extern
#endif
-
-
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 30808b1..27c5fe9 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -217,7 +217,7 @@ struct sock_intf_s
FAR socklen_t *fromlen);
#ifdef CONFIG_NET_RECVMSG_CMSG
CODE ssize_t (*si_recvmsg)(FAR struct socket *psock,
- FAR struct msghdr *msg, int flags);
+ FAR struct msghdr *msg, int flags);
#endif
CODE int (*si_close)(FAR struct socket *psock);
#ifdef CONFIG_NET_USRSOCK
[incubator-nuttx] 08/31: PR350 Coding Standard Corrections
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit a84840881a26d431d43b004765649c948b8adfc0
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Fri Feb 21 11:17:10 2020 -0600
PR350 Coding Standard Corrections
Run all .c and .h files in PR350 through tools/nxstyle and correct all (relevant) errors reported by the tool. Somes files like arch/arm/src/s32k1xx/s32k1xx_flexcan.c did not following the coding standard and received substantial modification.
Nothing may enter the NuttX repositories that does not conform to the coding standard! See https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 1027 ++++++++++++++++----------------
include/netpacket/can.h | 10 +-
include/nuttx/can.h | 150 ++---
include/nuttx/mm/iob.h | 1 +
include/sys/socket.h | 8 +-
net/can/can.h | 14 +-
net/can/can_callback.c | 80 +--
net/can/can_getsockopt.c | 73 +--
net/can/can_input.c | 50 +-
net/can/can_poll.c | 47 +-
net/can/can_recvfrom.c | 88 ++-
net/can/can_setsockopt.c | 70 +--
net/can/can_sockif.c | 135 +++--
net/socket/getsockopt.c | 2 +-
14 files changed, 829 insertions(+), 926 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 9c7a7d7..50a5c18 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -1,35 +1,20 @@
/****************************************************************************
* arch/arm/src/s32k1xx/s32k1xx_flexcan.c
*
- * Copyright (C) 2019 Gregory Nutt. All rights reserved.
- * Authors: Gregory Nutt <gn...@nuttx.org>
- *
- * 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
*
****************************************************************************/
@@ -102,7 +87,8 @@
/* CONFIG_S32K1XX_FLEXCAN_NETHIFS determines the number of physical interfaces
* that will be supported.
*/
-/*
+
+#if 0
#if CONFIG_S32K1XX_FLEXCAN_NETHIFS != 1
# error "CONFIG_S32K1XX_FLEXCAN_NETHIFS must be one for now"
#endif
@@ -113,20 +99,22 @@
#if CONFIG_S32K1XX_FLEXCAN_NRXBUFFERS < 1
# error "Need at least one RX buffer"
-#endif*/
+#endif
+#endif
+
+#define MASKSTDID 0x000007ff
+#define MASKEXTID 0x1fffffff
+#define FLAGEFF (1 << 31) /* Extended frame format */
+#define FLAGRTR (1 << 30) /* Remote transmission request */
-#define MaskStdID 0x000007FF
-#define MaskExtID 0x1FFFFFFF
-#define FlagEFF (1 << 31) /* Extended frame format */
-#define FlagRTR (1 << 30) /* Remote transmission request */
+/* Fixme nice variables/constants */
-//Fixme nice variables/constants
-#define RxMBCount 6
-#define FilterCount 0
-#define RxandFilterMBCount (RxMBCount + FilterCount)
-#define TxMBCount 12 //???????????? why 12 idk it works
-#define TotalMBcount RxandFilterMBCount + TxMBCount
-#define TXMBMask (((1 << TxMBCount)-1) << RxandFilterMBCount)
+#define RXMBCOUNT 6
+#define FILTERCOUNT 0
+#define RXANDFILTERMBCOUNT (RXMBCOUNT + FILTERCOUNT)
+#define TXMBCOUNT 12 //???????????? why 12 idk it works
+#define TOTALMBCOUNT RXANDFILTERMBCOUNT + TXMBCOUNT
+#define TXMBMASK (((1 << TXMBCOUNT)-1) << RXANDFILTERMBCOUNT)
#define CAN_FIFO_NE (1 << 5)
#define CAN_FIFO_OV (1 << 6)
@@ -135,9 +123,6 @@
static int peak_tx_mailbox_index_ = 0;
-
-
-
/* Normally you would clean the cache after writing new values to the DMA
* memory so assure that the dirty cache lines are flushed to memory
* before the DMA occurs. And you would invalid the cache after a data is
@@ -208,82 +193,81 @@ static int peak_tx_mailbox_index_ = 0;
* Private Types
****************************************************************************/
-
-union TXcsType
+union txcs_e
{
- volatile uint32_t w;
- struct
- {
- volatile uint32_t time_stamp : 16;
- volatile uint32_t dlc : 4;
- volatile uint32_t rtr : 1;
- volatile uint32_t ide : 1;
- volatile uint32_t srr : 1;
- volatile uint32_t res : 1;
- volatile uint32_t code : 4;
- volatile uint32_t res2 : 4;
- };
+ volatile uint32_t w;
+ struct
+ {
+ volatile uint32_t time_stamp : 16;
+ volatile uint32_t dlc : 4;
+ volatile uint32_t rtr : 1;
+ volatile uint32_t ide : 1;
+ volatile uint32_t srr : 1;
+ volatile uint32_t res : 1;
+ volatile uint32_t code : 4;
+ volatile uint32_t res2 : 4;
+ };
};
-union RXcsType
+union rxcs_e
{
- volatile uint32_t cs;
- struct
- {
- volatile uint32_t time_stamp : 16;
- volatile uint32_t dlc : 4;
- volatile uint32_t rtr : 1;
- volatile uint32_t ide : 1;
- volatile uint32_t srr : 1;
- volatile uint32_t res : 9;
- };
+ volatile uint32_t cs;
+ struct
+ {
+ volatile uint32_t time_stamp : 16;
+ volatile uint32_t dlc : 4;
+ volatile uint32_t rtr : 1;
+ volatile uint32_t ide : 1;
+ volatile uint32_t srr : 1;
+ volatile uint32_t res : 9;
+ };
};
-union IDType
+union id_e
{
- volatile uint32_t w;
- struct
- {
- volatile uint32_t ext : 29;
- volatile uint32_t resex : 3;
- };
- struct
- {
- volatile uint32_t res : 18;
- volatile uint32_t std : 11;
- volatile uint32_t resstd : 3;
- };
+ volatile uint32_t w;
+ struct
+ {
+ volatile uint32_t ext : 29;
+ volatile uint32_t resex : 3;
+ };
+ struct
+ {
+ volatile uint32_t res : 18;
+ volatile uint32_t std : 11;
+ volatile uint32_t resstd : 3;
+ };
};
-union DataType
+union data_e
{
- volatile uint32_t l;
- volatile uint32_t h;
- struct
- {
- volatile uint32_t b3 : 8;
- volatile uint32_t b2 : 8;
- volatile uint32_t b1 : 8;
- volatile uint32_t b0 : 8;
- volatile uint32_t b7 : 8;
- volatile uint32_t b6 : 8;
- volatile uint32_t b5 : 8;
- volatile uint32_t b4 : 8;
- };
+ volatile uint32_t l;
+ volatile uint32_t h;
+ struct
+ {
+ volatile uint32_t b3 : 8;
+ volatile uint32_t b2 : 8;
+ volatile uint32_t b1 : 8;
+ volatile uint32_t b0 : 8;
+ volatile uint32_t b7 : 8;
+ volatile uint32_t b6 : 8;
+ volatile uint32_t b5 : 8;
+ volatile uint32_t b4 : 8;
+ };
};
-struct MbTx
+struct mbtx_s
{
- union TXcsType CS;
- union IDType ID;
- union DataType data;
+ union txcs_e cs;
+ union id_e id;
+ union data_e data;
};
-struct MbRx
+struct mbrx_s
{
- union RXcsType CS;
- union IDType ID;
- union DataType data;
+ union rxcs_e cs;
+ union id_e id;
+ union data_e data;
};
/* The s32k1xx_driver_s encapsulates all state information for a single
@@ -308,12 +292,10 @@ struct s32k1xx_driver_s
struct net_driver_s dev; /* Interface understood by the network */
- struct MbRx *rx;
- struct MbTx *tx;
-
+ struct mbrx_s *rx;
+ struct mbtx_s *tx;
};
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -323,7 +305,6 @@ static struct s32k1xx_driver_s g_flexcan[CONFIG_S32K1XX_ENET_NETHIFS];
static uint8_t g_desc_pool[2000]
__attribute__((aligned(ARMV7M_DCACHE_LINESIZE)));
-
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
@@ -350,10 +331,11 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv);
static int s32k1xx_txpoll(struct net_driver_s *dev);
/* Helper functions */
+
static void s32k1xx_setenable(uint32_t enable);
static void s32k1xx_setfreeze(uint32_t freeze);
static uint32_t s32k1xx_waitmcr_change(uint32_t mask,
- uint32_t target_state);
+ uint32_t target_state);
/* Interrupt handling */
@@ -363,7 +345,7 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv);
static void s32k1xx_flexcan_interrupt_work(FAR void *arg);
static int s32k1xx_flexcan_interrupt(int irq, FAR void *context,
- FAR void *arg);
+ FAR void *arg);
/* Watchdog timer expirations */
@@ -383,13 +365,13 @@ static int s32k1xx_txavail(struct net_driver_s *dev);
#ifdef CONFIG_NET_MCASTGROUP
static int s32k1xx_addmac(struct net_driver_s *dev,
- FAR const uint8_t *mac);
+ FAR const uint8_t *mac);
static int s32k1xx_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
#endif
#ifdef CONFIG_NETDEV_IOCTL
static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
- unsigned long arg);
+ unsigned long arg);
#endif
/* Initialization */
@@ -402,7 +384,6 @@ static void s32k1xx_reset(struct s32k1xx_driver_s *priv);
* Private Functions
****************************************************************************/
-
/****************************************************************************
* Function: s32k1xx_txringfull
*
@@ -428,7 +409,7 @@ static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv)
*/
txnext = priv->txhead + 1;
-
+
return priv->txtail == txnext;
}
@@ -452,69 +433,79 @@ static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv)
*
****************************************************************************/
-
static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
{
#warning Missing logic
- struct can_frame *frame = (struct can_frame*)priv->dev.d_buf;
+ struct can_frame *frame = (struct can_frame *)priv->dev.d_buf;
- /*ninfo("CAN id: %i dlc: %i", frame->can_id, frame->can_dlc);
+#if 0
+ ninfo("CAN id: %i dlc: %i", frame->can_id, frame->can_dlc);
- for(int i = 0; i < frame->can_dlc; i++){
- ninfo(" %02X", frame->data[i]);
- }
- ninfo("\r\n");*/
+ for (int i = 0; i < frame->can_dlc; i++)
+ {
+ ninfo(" %02X", frame->data[i]);
+ }
+
+ ninfo("\r\n");
+#endif
/* Attempt to write frame */
+
uint32_t mbi = 0;
- if ((getreg32(S32K1XX_CAN0_ESR2) & (CAN_ESR2_IMB | CAN_ESR2_VPS)) == (CAN_ESR2_IMB | CAN_ESR2_VPS))
- {
- mbi = (getreg32(S32K1XX_CAN0_ESR2) & CAN_ESR2_LPTM_MASK) >> CAN_ESR2_LPTM_SHIFT;
- }
+ if ((getreg32(S32K1XX_CAN0_ESR2) & (CAN_ESR2_IMB | CAN_ESR2_VPS)) ==
+ (CAN_ESR2_IMB | CAN_ESR2_VPS))
+ {
+ mbi = (getreg32(S32K1XX_CAN0_ESR2) & CAN_ESR2_LPTM_MASK) >>
+ CAN_ESR2_LPTM_SHIFT;
+ }
- uint32_t mb_bit = 1 << (RxandFilterMBCount + mbi);
+ uint32_t mb_bit = 1 << (RXANDFILTERMBCOUNT + mbi);
- while (mbi < TxMBCount)
- {
+ while (mbi < TXMBCOUNT)
+ {
+ if (priv->tx[mbi].cs.code != CAN_TXMB_DATAORREMOTE)
+ {
+ putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
+ break;
+ }
- if (priv->tx[mbi].CS.code != CAN_TXMB_DATAORREMOTE)
- {
- putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
- break;
- }
- mb_bit <<= 1;
- mbi++;
- }
+ mb_bit <<= 1;
+ mbi++;
+ }
- if ((mbi-RxandFilterMBCount) == TxMBCount)
- {
- nwarn("No TX MB available mbi %i\r\n", mbi);
- return 0; // No transmission for you!
- }
+ if ((mbi - RXANDFILTERMBCOUNT) == TXMBCOUNT)
+ {
+ nwarn("No TX MB available mbi %i\r\n", mbi);
+ return 0; /* No transmission for you! */
+ }
- peak_tx_mailbox_index_ = (peak_tx_mailbox_index_ > mbi ? peak_tx_mailbox_index_ : mbi );
+ peak_tx_mailbox_index_ =
+ (peak_tx_mailbox_index_ > mbi ? peak_tx_mailbox_index_ : mbi);
- union TXcsType cs;
+ union txcs_e cs;
cs.code = CAN_TXMB_DATAORREMOTE;
- struct MbTx* mb = &priv->tx[mbi];
- mb->CS.code = CAN_TXMB_INACTIVE;
+ struct mbtx_s *mb = &priv->tx[mbi];
+ mb->cs.code = CAN_TXMB_INACTIVE;
- if (0) //FIXME detect Std or Ext id
- {
- cs.ide = 1;
- mb->ID.ext = frame->can_id & MaskExtID;
- }
+ if (0) /* FIXME detect Std or Ext id */
+ {
+ cs.ide = 1;
+ mb->id.ext = frame->can_id & MASKEXTID;
+ }
else
- {
- mb->ID.std = frame->can_id & MaskStdID;
- }
+ {
+ mb->id.std = frame->can_id & MASKSTDID;
+ }
- //cs.rtr = frame.isRemoteTransmissionRequest();
+#if 0
+ cs.rtr = frame.isRemoteTransmissionRequest();
+#endif
cs.dlc = frame->can_dlc;
- //FIXME endian swap instruction or somekind takes 1.5us right now
+ /* FIXME endian swap instruction or somekind takes 1.5us right now */
+
mb->data.b0 = frame->data[0];
mb->data.b1 = frame->data[1];
mb->data.b2 = frame->data[2];
@@ -524,20 +515,22 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mb->data.b6 = frame->data[6];
mb->data.b7 = frame->data[7];
- /*
- * Registering the pending transmission so we can track its deadline and loopback it as needed
+#if 0
+ /* Registering the pending transmission so we can track its deadline and
+ * loopback it as needed
*/
- /*TxItem& txi = pending_tx_[mbi];
+
+ txitem& txi = pending_tx_[mbi];
txi.deadline = tx_deadline;
txi.frame = frame;
txi.loopback = (flags & uavcan::CanIOFlagLoopback) != 0;
txi.abort_on_error = (flags & uavcan::CanIOFlagAbortOnError) != 0;
- txi.pending = TxItem::busy;*/
-
+ txi.pending = txitem::busy;
+#endif
s32k1xx_gpiowrite(PIN_PORTD | PIN31, 0);
- mb->CS = cs; // Go.
+ mb->cs = cs; /* Go. */
uint32_t regval;
regval = getreg32(S32K1XX_CAN0_IMASK1);
@@ -585,14 +578,15 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
if (priv->dev.d_len > 0)
{
-
if (!devif_loopback(&priv->dev))
{
/* Send the packet */
s32k1xx_transmit(priv);
- /*priv->dev.d_buf =
- (uint8_t *)s32k1xx_swap32((uint32_t)priv->txdesc[priv->txhead].data);*/
+#if 0
+ priv->dev.d_buf =
+ (uint8_t *)s32k1xx_swap32((uint32_t)priv->txdesc[priv->txhead].data);
+#endif
/* Check if there is room in the device to hold another packet. If
* not, return a non-zero value to terminate the poll.
@@ -632,7 +626,6 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
static inline void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv)
{
-
#warning Missing logic
}
@@ -656,96 +649,90 @@ static inline void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv)
static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv)
{
#warning Missing logic
- //ninfo("FLEXCAN: receive\r\n");
-
- s32k1xx_gpiowrite(PIN_PORTD | PIN31, 1);
-
- struct can_frame frame;
- uint32_t flags = getreg32(S32K1XX_CAN0_IFLAG1);
-
- if ((flags & FIFO_IFLAG1) == 0)
- {
- // Weird, IRQ is here but no data to read
- return;
- }
+ s32k1xx_gpiowrite(PIN_PORTD | PIN31, 1);
- if (flags & CAN_FIFO_OV)
- {
- //error_cnt_++;
- putreg32(CAN_FIFO_OV, S32K1XX_CAN0_IFLAG1);
- }
+ struct can_frame frame;
+ uint32_t flags = getreg32(S32K1XX_CAN0_IFLAG1);
- if (flags & CAN_FIFO_WARN)
- {
- //fifo_warn_cnt_++;
- putreg32(CAN_FIFO_WARN, S32K1XX_CAN0_IFLAG1);
- }
-
- if (flags & CAN_FIFO_NE)
- {
- struct MbRx *rf = priv->rx;
+ if ((flags & FIFO_IFLAG1) == 0)
+ {
+ /* Weird, IRQ is here but no data to read */
- /*
- * Read the frame contents
- */
+ return;
+ }
- if (rf->CS.ide)
- {
- frame.can_id = MaskExtID & rf->ID.ext;
- frame.can_id |= FlagEFF;
- }
- else
- {
- frame.can_id = MaskStdID & rf->ID.std;
- }
+ if (flags & CAN_FIFO_OV)
+ {
+#if 0
+ error_cnt_++;
+#endif
+ putreg32(CAN_FIFO_OV, S32K1XX_CAN0_IFLAG1);
+ }
- if (rf->CS.rtr)
- {
- frame.can_id |= FlagRTR;
- }
+ if (flags & CAN_FIFO_WARN)
+ {
+#if 0
+ fifo_warn_cnt_++;
+#endif
+ putreg32(CAN_FIFO_WARN, S32K1XX_CAN0_IFLAG1);
+ }
- frame.can_dlc = rf->CS.dlc;
+ if (flags & CAN_FIFO_NE)
+ {
+ struct mbrx_s *rf = priv->rx;
- frame.data[0] = rf->data.b0;
- frame.data[1] = rf->data.b1;
- frame.data[2] = rf->data.b2;
- frame.data[3] = rf->data.b3;
- frame.data[4] = rf->data.b4;
- frame.data[5] = rf->data.b5;
- frame.data[6] = rf->data.b6;
- frame.data[7] = rf->data.b7;
+ /* Read the frame contents */
+ if (rf->cs.ide)
+ {
+ frame.can_id = MASKEXTID & rf->id.ext;
+ frame.can_id |= FLAGEFF;
+ }
+ else
+ {
+ frame.can_id = MASKSTDID & rf->id.std;
+ }
- putreg32(CAN_FIFO_NE, S32K1XX_CAN0_IFLAG1);
+ if (rf->cs.rtr)
+ {
+ frame.can_id |= FLAGRTR;
+ }
- /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
- * in priv->dev.d_len
- */
+ frame.can_dlc = rf->cs.dlc;
- priv->dev.d_len = sizeof(struct can_frame);
- priv->dev.d_buf =
- (uint8_t *)s32k1xx_swap32((uint32_t)&frame); //FIXME
+ frame.data[0] = rf->data.b0;
+ frame.data[1] = rf->data.b1;
+ frame.data[2] = rf->data.b2;
+ frame.data[3] = rf->data.b3;
+ frame.data[4] = rf->data.b4;
+ frame.data[5] = rf->data.b5;
+ frame.data[6] = rf->data.b6;
+ frame.data[7] = rf->data.b7;
- /* Invalidate the buffer so that the correct packet will be re-read
- * from memory when the packet content is accessed.
- */
+ putreg32(CAN_FIFO_NE, S32K1XX_CAN0_IFLAG1);
- up_invalidate_dcache((uintptr_t)priv->dev.d_buf,
- (uintptr_t)priv->dev.d_buf + priv->dev.d_len);
+ /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
+ * in priv->dev.d_len
+ */
- /* Send to socket interface */
- NETDEV_RXPACKETS(&priv->dev);
+ priv->dev.d_len = sizeof(struct can_frame);
+ priv->dev.d_buf = (uint8_t *)s32k1xx_swap32((uint32_t)&frame); /* FIXME */
- can_input(&priv->dev);
+ /* Invalidate the buffer so that the correct packet will be re-read
+ * from memory when the packet content is accessed.
+ */
+ up_invalidate_dcache((uintptr_t)priv->dev.d_buf,
+ (uintptr_t)priv->dev.d_buf + priv->dev.d_len);
+ /* Send to socket interface */
+ NETDEV_RXPACKETS(&priv->dev);
- /*
- * Store with timeout into the FIFO buffer and signal update event
- */
+ can_input(&priv->dev);
- }
+ /* Store with timeout into the FIFO buffer and signal update event */
+ }
}
/****************************************************************************
@@ -771,24 +758,27 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv)
#warning Missing logic
uint32_t tx_iflags;
- tx_iflags = getreg32(S32K1XX_CAN0_IFLAG1) & TXMBMask;
+ tx_iflags = getreg32(S32K1XX_CAN0_IFLAG1) & TXMBMASK;
- //FIXME process aborts
+ /* FIXME process aborts */
/* Process TX completions */
- uint32_t mb_bit = 1 << RxMBCount;
- for(uint32_t mbi = 0; tx_iflags && mbi < TxMBCount; mbi++)
- {
+ uint32_t mb_bit = 1 << RXMBCOUNT;
+ for (uint32_t mbi = 0; tx_iflags && mbi < TXMBCOUNT; mbi++)
+ {
if (tx_iflags & mb_bit)
- {
- putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
+ {
+ putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
tx_iflags &= ~mb_bit;
- //const bool txok = priv->tx[mbi].CS.code != CAN_TXMB_ABORT;
- //handleTxMailboxInterrupt(mbi, txok, utc_usec);
- }
+#if 0
+ const bool txok = priv->tx[mbi].cs.code != CAN_TXMB_ABORT;
+ handleTxMailboxInterrupt(mbi, txok, utc_usec);
+#endif
+ }
+
mb_bit <<= 1;
- }
+ }
}
/****************************************************************************
@@ -833,27 +823,26 @@ static void s32k1xx_flexcan_interrupt_work(FAR void *arg)
*
****************************************************************************/
-
static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
{
#warning Missing logic
- FAR struct s32k1xx_driver_s *priv = &g_flexcan[0];
- uint32_t flags;
- flags = getreg32(S32K1XX_CAN0_IFLAG1);
- flags &= FIFO_IFLAG1;
-
- if(flags)
- {
- s32k1xx_receive(priv);
- }
-
- flags = getreg32(S32K1XX_CAN0_IFLAG1);
- flags &= TXMBMask;
-
- if(flags)
- {
- s32k1xx_txdone(priv);
- }
+ FAR struct s32k1xx_driver_s *priv = &g_flexcan[0];
+ uint32_t flags;
+ flags = getreg32(S32K1XX_CAN0_IFLAG1);
+ flags &= FIFO_IFLAG1;
+
+ if (flags)
+ {
+ s32k1xx_receive(priv);
+ }
+
+ flags = getreg32(S32K1XX_CAN0_IFLAG1);
+ flags &= TXMBMASK;
+
+ if (flags)
+ {
+ s32k1xx_txdone(priv);
+ }
}
/****************************************************************************
@@ -875,7 +864,7 @@ static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
static void s32k1xx_txtimeout_work(FAR void *arg)
{
#warning Missing logic
- ninfo("FLEXCAN: tx timeout work\r\n");
+ ninfo("FLEXCAN: tx timeout work\r\n");
}
/****************************************************************************
@@ -900,7 +889,7 @@ static void s32k1xx_txtimeout_work(FAR void *arg)
static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
{
#warning Missing logic
- ninfo("FLEXCAN: tx timeout expiry\r\n");
+ ninfo("FLEXCAN: tx timeout expiry\r\n");
}
/****************************************************************************
@@ -923,32 +912,29 @@ static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
static void s32k1xx_poll_work(FAR void *arg)
{
#warning Missing logic
- //ninfo("FLEXCAN: poll work\r\n");
-
- FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
-
- /* Check if there is there is a transmission in progress. We cannot
- * perform the TX poll if he are unable to accept another packet for
- * transmission.
- */
+ FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
- net_lock();
- if (1) //!s32k1xx_txringfull(priv))
- {
- /* If so, update TCP timing states and poll the network for new XMIT
- * data. Hmmm.. might be bug here. Does this mean if there is a
- * transmit in progress, we will missing TCP time state updates?
- */
+ /* Check if there is there is a transmission in progress. We cannot
+ * perform the TX poll if he are unable to accept another packet for
+ * transmission.
+ */
- devif_timer(&priv->dev, S32K1XX_WDDELAY, s32k1xx_txpoll);
- }
+ net_lock();
+ if (1) /* !s32k1xx_txringfull(priv)) */
+ {
+ /* If so, update TCP timing states and poll the network for new XMIT
+ * data. Hmmm.. might be bug here. Does this mean if there is a
+ * transmit in progress, we will missing TCP time state updates?
+ */
- /* Setup the watchdog poll timer again in any case */
+ devif_timer(&priv->dev, S32K1XX_WDDELAY, s32k1xx_txpoll);
+ }
- wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry,
- 1, (wdparm_t)priv);
- net_unlock();
+ /* Setup the watchdog poll timer again in any case */
+ wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry,
+ 1, (wdparm_t)priv);
+ net_unlock();
}
/****************************************************************************
@@ -981,62 +967,67 @@ static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
static void s32k1xx_setenable(uint32_t enable)
{
- uint32_t regval;
- if(enable)
- {
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval &= ~(CAN_MCR_MDIS);
- putreg32(regval, S32K1XX_CAN0_MCR);
- }
- else
- {
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_MDIS;
- putreg32(regval, S32K1XX_CAN0_MCR);
- }
- s32k1xx_waitmcr_change(CAN_MCR_LPMACK,1);
+ uint32_t regval;
+
+ if (enable)
+ {
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval &= ~(CAN_MCR_MDIS);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
+ else
+ {
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_MDIS;
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
+
+ s32k1xx_waitmcr_change(CAN_MCR_LPMACK, 1);
}
static void s32k1xx_setfreeze(uint32_t freeze)
{
- uint32_t regval;
- if(freeze)
- {
- /* Enter freeze mode */
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= (CAN_MCR_HALT | CAN_MCR_FRZ);
- putreg32(regval, S32K1XX_CAN0_MCR);
- }
- else
- {
- /* Exit freeze mode */
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval &= ~(CAN_MCR_HALT | CAN_MCR_FRZ);
- putreg32(regval, S32K1XX_CAN0_MCR);
- }
+ uint32_t regval;
+ if (freeze)
+ {
+ /* Enter freeze mode */
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= (CAN_MCR_HALT | CAN_MCR_FRZ);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
+ else
+ {
+ /* Exit freeze mode */
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval &= ~(CAN_MCR_HALT | CAN_MCR_FRZ);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
}
static uint32_t s32k1xx_waitmcr_change(uint32_t mask, uint32_t target_state)
{
- const unsigned Timeout = 1000;
- for (unsigned wait_ack = 0; wait_ack < Timeout; wait_ack++)
- {
- const bool state = (getreg32(S32K1XX_CAN0_MCR) & mask) != 0;
- if (state == target_state)
- {
- return true;
- }
- up_udelay(10);
- }
- return false;
+ const unsigned timeout = 1000;
+ for (unsigned wait_ack = 0; wait_ack < timeout; wait_ack++)
+ {
+ const bool state = (getreg32(S32K1XX_CAN0_MCR) & mask) != 0;
+ if (state == target_state)
+ {
+ return true;
+ }
+
+ up_udelay(10);
+ }
+
+ return false;
}
static uint32_t s32k1xx_waitfreezeack_change(uint32_t target_state)
{
- return s32k1xx_waitmcr_change(CAN_MCR_FRZACK, target_state);
+ return s32k1xx_waitmcr_change(CAN_MCR_FRZACK, target_state);
}
-
/****************************************************************************
* Function: s32k1xx_ifup
*
@@ -1057,16 +1048,16 @@ static uint32_t s32k1xx_waitfreezeack_change(uint32_t target_state)
static int s32k1xx_ifup(struct net_driver_s *dev)
{
FAR struct s32k1xx_driver_s *priv =
- (FAR struct s32k1xx_driver_s *)dev->d_private;
+ (FAR struct s32k1xx_driver_s *)dev->d_private;
uint32_t regval;
#warning Missing logic
- if(!s32k1xx_initialize(priv))
- {
- nerr("initialize failed");
- return -1;
- }
+ if (!s32k1xx_initialize(priv))
+ {
+ nerr("initialize failed");
+ return -1;
+ }
/* Set and activate a timer process */
@@ -1078,6 +1069,7 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
priv->dev.d_buf = &g_desc_pool;
/* Set interrupts */
+
up_enable_irq(S32K1XX_IRQ_CAN0_BUS);
up_enable_irq(S32K1XX_IRQ_CAN0_ERROR);
up_enable_irq(S32K1XX_IRQ_CAN0_LPRX);
@@ -1127,28 +1119,28 @@ static int s32k1xx_ifdown(struct net_driver_s *dev)
static void s32k1xx_txavail_work(FAR void *arg)
{
- FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
+ FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
- /* Ignore the notification if the interface is not yet up */
+ /* Ignore the notification if the interface is not yet up */
- net_lock();
- if (priv->bifup)
- {
- /* Check if there is room in the hardware to hold another outgoing
- * packet.
- */
+ net_lock();
+ if (priv->bifup)
+ {
+ /* Check if there is room in the hardware to hold another outgoing
+ * packet.
+ */
- if (!s32k1xx_txringfull(priv))
- {
- /* No, there is space for another transfer. Poll the network for
- * new XMIT data.
- */
+ if (!s32k1xx_txringfull(priv))
+ {
+ /* No, there is space for another transfer. Poll the network for
+ * new XMIT data.
+ */
- devif_poll(&priv->dev, s32k1xx_txpoll);
- }
- }
+ devif_poll(&priv->dev, s32k1xx_txpoll);
+ }
+ }
- net_unlock();
+ net_unlock();
}
/****************************************************************************
@@ -1183,8 +1175,9 @@ static int s32k1xx_txavail(struct net_driver_s *dev)
if (work_available(&priv->pollwork))
{
/* Schedule to serialize the poll on the worker thread. */
+
#ifdef WORK_QUEUE_BYPASS
- s32k1xx_txavail_work(priv);
+ s32k1xx_txavail_work(priv);
#else
work_queue(ETHWORK, &priv->pollwork, s32k1xx_txavail_work, priv, 0);
#endif
@@ -1193,7 +1186,6 @@ static int s32k1xx_txavail(struct net_driver_s *dev)
return OK;
}
-
/****************************************************************************
* Function: s32k1xx_ioctl
*
@@ -1247,119 +1239,131 @@ static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
{
- uint32_t regval;
- uint32_t i;
+ uint32_t regval;
+ uint32_t i;
- /* initialize CAN device */
- //FIXME we only support a single can device for now
+ /* initialize CAN device */
- //TEST GPIO tming
- s32k1xx_pinconfig(PIN_PORTD | PIN31 | GPIO_OUTPUT);
+ /* FIXME we only support a single can device for now */
+ /* TEST GPIO tming */
- s32k1xx_setenable(0);
+ s32k1xx_pinconfig(PIN_PORTD | PIN31 | GPIO_OUTPUT);
- /* Set SYS_CLOCK src */
- regval = getreg32(S32K1XX_CAN0_CTRL1);
- regval |= CAN_CTRL1_CLKSRC;
- putreg32(regval, S32K1XX_CAN0_CTRL1);
+ s32k1xx_setenable(0);
- s32k1xx_setenable(1);
+ /* Set SYS_CLOCK src */
- s32k1xx_reset(priv);
+ regval = getreg32(S32K1XX_CAN0_CTRL1);
+ regval |= CAN_CTRL1_CLKSRC;
+ putreg32(regval, S32K1XX_CAN0_CTRL1);
- /* Enter freeze mode */
- s32k1xx_setfreeze(1);
- if(!s32k1xx_waitfreezeack_change(1))
- {
- ninfo("FLEXCAN: freeze fail\r\n");
- return -1;
- }
+ s32k1xx_setenable(1);
- /*regval = getreg32(S32K1XX_CAN0_CTRL1);
- regval |= ((0 << CAN_CTRL1_PRESDIV_SHIFT) & CAN_CTRL1_PRESDIV_MASK)
- | ((46 << CAN_CTRL1_ROPSEG_SHIFT) & CAN_CTRL1_ROPSEG_MASK)
- | ((18 << CAN_CTRL1_PSEG1_SHIFT) & CAN_CTRL1_PSEG1_MASK)
- | ((12 << CAN_CTRL1_PSEG2_SHIFT) & CAN_CTRL1_PSEG2_MASK)
- | ((12 << CAN_CTRL1_RJW_SHIFT) & CAN_CTRL1_RJW_MASK)
- | CAN_CTRL1_ERRMSK
- | CAN_CTRL1_TWRNMSK
- | CAN_CTRL1_RWRNMSK;
+ s32k1xx_reset(priv);
- putreg32(regval, S32K1XX_CAN0_CTRL1);*/
+ /* Enter freeze mode */
+
+ s32k1xx_setfreeze(1);
+ if (!s32k1xx_waitfreezeack_change(1))
+ {
+ ninfo("FLEXCAN: freeze fail\r\n");
+ return -1;
+ }
+
+#if 0
+ regval = getreg32(S32K1XX_CAN0_CTRL1);
+ regval |= ((0 << CAN_CTRL1_PRESDIV_SHIFT) & CAN_CTRL1_PRESDIV_MASK) |
+ ((46 << CAN_CTRL1_ROPSEG_SHIFT) & CAN_CTRL1_ROPSEG_MASK) |
+ ((18 << CAN_CTRL1_PSEG1_SHIFT) & CAN_CTRL1_PSEG1_MASK) |
+ ((12 << CAN_CTRL1_PSEG2_SHIFT) & CAN_CTRL1_PSEG2_MASK) |
+ ((12 << CAN_CTRL1_RJW_SHIFT) & CAN_CTRL1_RJW_MASK) |
+ CAN_CTRL1_ERRMSK |
+ CAN_CTRL1_TWRNMSK |
+ CAN_CTRL1_RWRNMSK;
+
+ putreg32(regval, S32K1XX_CAN0_CTRL1);
+#endif
#define BIT_METHOD2
#ifdef BIT_METHOD2
- /* CAN Bit Timing (CBT) configuration for a nominal phase of 1 Mbit/s
- * with 80 time quantas,in accordance with Bosch 2012 specification,
- * sample point at 83.75% */
- regval = getreg32(S32K1XX_CAN0_CBT);
- regval |= CAN_CBT_BTF | /* Enable extended bit timing configurations for CAN-FD
- for setting up separetely nominal and data phase */
- CAN_CBT_EPRESDIV(0) | /* Prescaler divisor factor of 1 */
- CAN_CBT_EPROPSEG(46) | /* Propagation segment of 47 time quantas */
- CAN_CBT_EPSEG1(18) | /* Phase buffer segment 1 of 19 time quantas */
- CAN_CBT_EPSEG2(12) | /* Phase buffer segment 2 of 13 time quantas */
- CAN_CBT_ERJW(12); /* Resynchronization jump width same as PSEG2 */
- putreg32(regval, S32K1XX_CAN0_CBT);
+ /* CAN Bit Timing (CBT) configuration for a nominal phase of 1 Mbit/s
+ * with 80 time quantas,in accordance with Bosch 2012 specification,
+ * sample point at 83.75%
+ */
+
+ regval = getreg32(S32K1XX_CAN0_CBT);
+ regval |= CAN_CBT_BTF | /* Enable extended bit timing configurations
+ * for CAN-FD for setting up separately
+ * nominal and data phase */
+ CAN_CBT_EPRESDIV(0) | /* Prescaler divisor factor of 1 */
+ CAN_CBT_EPROPSEG(46) | /* Propagation segment of 47 time quantas */
+ CAN_CBT_EPSEG1(18) | /* Phase buffer segment 1 of 19 time quantas */
+ CAN_CBT_EPSEG2(12) | /* Phase buffer segment 2 of 13 time quantas */
+ CAN_CBT_ERJW(12); /* Resynchronization jump width same as PSEG2 */
+ putreg32(regval, S32K1XX_CAN0_CBT);
#endif
#ifdef CAN_FD
+ /* Enable CAN FD feature */
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_FDEN;
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ /* CAN-FD Bit Timing (FDCBT) for a data phase of 4 Mbit/s with 20 time quantas,
+ * in accordance with Bosch 2012 specification, sample point at 75%
+ */
+
+ regval = getreg32(S32K1XX_CAN0_FDCBT);
+ regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
+ CAN_FDCBT_FPROPSEG(7) | /* Propagation semgment of 7 time quantas
+ * (only register that doesn't add 1) */
+ CAN_FDCBT_FPSEG1(6) | /* Phase buffer segment 1 of 7 time quantas */
+ CAN_FDCBT_FPSEG2(4) | /* Phase buffer segment 2 of 5 time quantas */
+ CAN_FDCBT_FRJW(4); /* Resynchorinzation jump width same as PSEG2 */
+ putreg32(regval, S32K1XX_CAN0_FDCBT);
+
+ /* Additional CAN-FD configurations */
+
+ regval = getreg32(S32K1XX_CAN0_FDCTRL);
- /* Enable CAN FD feature */
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_FDEN;
- putreg32(regval, S32K1XX_CAN0_MCR);
-
- /* CAN-FD Bit Timing (FDCBT) for a data phase of 4 Mbit/s with 20 time quantas,
- in accordance with Bosch 2012 specification, sample point at 75% */
- regval = getreg32(S32K1XX_CAN0_FDCBT);
- regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
- CAN_FDCBT_FPROPSEG(7) | /* Propagation semgment of 7 time quantas
- (only register that doesn't add 1) */
- CAN_FDCBT_FPSEG1(6) | /* Phase buffer segment 1 of 7 time quantas */
- CAN_FDCBT_FPSEG2(4) | /* Phase buffer segment 2 of 5 time quantas */
- CAN_FDCBT_FRJW(4); /* Resynchorinzation jump width same as PSEG2 */
- putreg32(regval, S32K1XX_CAN0_FDCBT);
-
- /* Additional CAN-FD configurations */
- regval = getreg32(S32K1XX_CAN0_FDCTRL);
- regval |= CAN_FDCTRL_FDRATE | /* Enable bit rate switch in data phase of frame */
- CAN_FDCTRL_TDCEN | /* Enable transceiver delay compensation */
- CAN_FDCTRL_TDCOFF(5) | /* Setup 5 cycles for data phase sampling delay */
- CAN_FDCTRL_MBDSR0(3); /* Setup 64 bytes per message buffer (7 MB's) */
- putreg32(regval, S32K1XX_CAN0_FDCTRL);
-
- regval = getreg32(S32K1XX_CAN0_CTRL2);
- regval |= CAN_CTRL2_ISOCANFDEN;
- putreg32(regval, S32K1XX_CAN0_CTRL2);
+ regval |= CAN_FDCTRL_FDRATE | /* Enable bit rate switch in data phase of frame */
+ CAN_FDCTRL_TDCEN | /* Enable transceiver delay compensation */
+ CAN_FDCTRL_TDCOFF(5) | /* Setup 5 cycles for data phase sampling delay */
+ CAN_FDCTRL_MBDSR0(3); /* Setup 64 bytes per message buffer (7 MB's) */
+ putreg32(regval, S32K1XX_CAN0_FDCTRL);
+
+ regval = getreg32(S32K1XX_CAN0_CTRL2);
+ regval |= CAN_CTRL2_ISOCANFDEN;
+ putreg32(regval, S32K1XX_CAN0_CTRL2);
#endif
- for(i = TxMBCount; i < TotalMBcount; i++)
- {
- priv->rx[i].ID.w = 0x0;
- }
+ for (i = TXMBCOUNT; i < TOTALMBCOUNT; i++)
+ {
+ priv->rx[i].id.w = 0x0;
+ }
- putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
+ putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
- for(i = 0; i < TotalMBcount; i++)
- {
- putreg32(0,S32K1XX_CAN0_RXIMR(i));
- }
+ for (i = 0; i < TOTALMBCOUNT; i++)
+ {
+ putreg32(0, S32K1XX_CAN0_RXIMR(i));
+ }
- putreg32(FIFO_IFLAG1 | TXMBMask, S32K1XX_CAN0_IFLAG1);
- putreg32(FIFO_IFLAG1, S32K1XX_CAN0_IMASK1);
+ putreg32(FIFO_IFLAG1 | TXMBMASK, S32K1XX_CAN0_IFLAG1);
+ putreg32(FIFO_IFLAG1, S32K1XX_CAN0_IMASK1);
+ /* Exit freeze mode */
- /* Exit freeze mode */
- s32k1xx_setfreeze(0);
- if(!s32k1xx_waitfreezeack_change(0))
- {
- ninfo("FLEXCAN: unfreeze fail\r\n");
- return -1;
- }
+ s32k1xx_setfreeze(0);
+ if (!s32k1xx_waitfreezeack_change(0))
+ {
+ ninfo("FLEXCAN: unfreeze fail\r\n");
+ return -1;
+ }
- return 1;
+ return 1;
}
/****************************************************************************
@@ -1401,57 +1405,57 @@ static void s32k1xx_initbuffers(struct s32k1xx_driver_s *priv)
static void s32k1xx_reset(struct s32k1xx_driver_s *priv)
{
- uint32_t regval;
- uint32_t i;
-
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_SOFTRST;
- putreg32(regval, S32K1XX_CAN0_MCR);
-
- if(!s32k1xx_waitmcr_change(CAN_MCR_SOFTRST, 0))
- {
- nerr("Reset failed");
- return;
- }
-
- /* TODO calculate TASD */
-
-
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval &= ~(CAN_MCR_SUPV);
- putreg32(regval, S32K1XX_CAN0_MCR);
-
- /* Initialize all MB rx and tx */
- for(i = 0; i < TotalMBcount; i++)
- {
- ninfo("MB %i %p\r\n", i, &priv->rx[i]);
- ninfo("MB %i %p\r\n", i, &priv->rx[i].ID.w);
- priv->rx[i].CS.cs = 0x0;
- priv->rx[i].ID.w = 0x0;
- priv->rx[i].data.l = 0x0;
- priv->rx[i].data.h = 0x0;
- }
-
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_RFEN | CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS
- | CAN_MCR_IRMQ | CAN_MCR_AEN |
- (((TotalMBcount - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
- putreg32(regval, S32K1XX_CAN0_MCR);
-
- regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN | CAN_CTRL2_RFFN_16MB; //FIXME TASD
- putreg32(regval, S32K1XX_CAN0_CTRL2);
-
-
- for(i = 0; i < TotalMBcount; i++)
- {
- putreg32(0,S32K1XX_CAN0_RXIMR(i));
- }
-
- /* Filtering catchall */
- putreg32(0x3FFFFFFF, S32K1XX_CAN0_RX14MASK);
- putreg32(0x3FFFFFFF, S32K1XX_CAN0_RX15MASK);
- putreg32(0x3FFFFFFF, S32K1XX_CAN0_RXMGMASK);
- putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
+ uint32_t regval;
+ uint32_t i;
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_SOFTRST;
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ if (!s32k1xx_waitmcr_change(CAN_MCR_SOFTRST, 0))
+ {
+ nerr("Reset failed");
+ return;
+ }
+
+ /* TODO calculate TASD */
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval &= ~(CAN_MCR_SUPV);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ /* Initialize all MB rx and tx */
+
+ for (i = 0; i < TOTALMBCOUNT; i++)
+ {
+ ninfo("MB %i %p\r\n", i, &priv->rx[i]);
+ ninfo("MB %i %p\r\n", i, &priv->rx[i].id.w);
+ priv->rx[i].cs.cs = 0x0;
+ priv->rx[i].id.w = 0x0;
+ priv->rx[i].data.l = 0x0;
+ priv->rx[i].data.h = 0x0;
+ }
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_RFEN | CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS |
+ CAN_MCR_IRMQ | CAN_MCR_AEN |
+ (((TOTALMBCOUNT - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN | CAN_CTRL2_RFFN_16MB; /* FIXME TASD */
+ putreg32(regval, S32K1XX_CAN0_CTRL2);
+
+ for (i = 0; i < TOTALMBCOUNT; i++)
+ {
+ putreg32(0, S32K1XX_CAN0_RXIMR(i));
+ }
+
+ /* Filtering catchall */
+
+ putreg32(0x3fffffff, S32K1XX_CAN0_RX14MASK);
+ putreg32(0x3fffffff, S32K1XX_CAN0_RX15MASK);
+ putreg32(0x3fffffff, S32K1XX_CAN0_RXMGMASK);
+ putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
}
/****************************************************************************
@@ -1480,7 +1484,8 @@ int s32k1xx_netinitialize(int intf)
struct s32k1xx_driver_s *priv;
int ret;
- //FIXME dynamic board config
+ /* FIXME dynamic board config */
+
s32k1xx_pinconfig(PIN_CAN0_TX_4);
s32k1xx_pinconfig(PIN_CAN0_RX_4);
@@ -1490,10 +1495,10 @@ int s32k1xx_netinitialize(int intf)
/* Get the interface structure associated with this interface number. */
- #warning Missing logic
-
+#warning Missing logic
/* Attach the flexcan interrupt handler */
+
if (irq_attach(S32K1XX_IRQ_CAN0_BUS, s32k1xx_flexcan_interrupt, NULL))
{
/* We could not attach the ISR to the interrupt */
@@ -1501,6 +1506,7 @@ int s32k1xx_netinitialize(int intf)
nerr("ERROR: Failed to attach CAN bus IRQ\n");
return -EAGAIN;
}
+
if (irq_attach(S32K1XX_IRQ_CAN0_ERROR, s32k1xx_flexcan_interrupt, NULL))
{
/* We could not attach the ISR to the interrupt */
@@ -1508,6 +1514,7 @@ int s32k1xx_netinitialize(int intf)
nerr("ERROR: Failed to attach CAN error IRQ\n");
return -EAGAIN;
}
+
if (irq_attach(S32K1XX_IRQ_CAN0_LPRX, s32k1xx_flexcan_interrupt, NULL))
{
/* We could not attach the ISR to the interrupt */
@@ -1515,6 +1522,7 @@ int s32k1xx_netinitialize(int intf)
nerr("ERROR: Failed to attach CAN LPRX IRQ\n");
return -EAGAIN;
}
+
if (irq_attach(S32K1XX_IRQ_CAN0_0_15, s32k1xx_flexcan_interrupt, NULL))
{
/* We could not attach the ISR to the interrupt */
@@ -1526,20 +1534,21 @@ int s32k1xx_netinitialize(int intf)
/* Initialize the driver structure */
memset(priv, 0, sizeof(struct s32k1xx_driver_s));
- priv->dev.d_ifup = s32k1xx_ifup; /* I/F up (new IP address) callback */
- priv->dev.d_ifdown = s32k1xx_ifdown; /* I/F down callback */
- priv->dev.d_txavail = s32k1xx_txavail; /* New TX data callback */
+ priv->dev.d_ifup = s32k1xx_ifup; /* I/F up (new IP address) callback */
+ priv->dev.d_ifdown = s32k1xx_ifdown; /* I/F down callback */
+ priv->dev.d_txavail = s32k1xx_txavail; /* New TX data callback */
#ifdef CONFIG_NETDEV_IOCTL
- priv->dev.d_ioctl = s32k1xx_ioctl; /* Support PHY ioctl() calls */
+ priv->dev.d_ioctl = s32k1xx_ioctl; /* Support PHY ioctl() calls */
#endif
- priv->dev.d_private = (void *)g_flexcan; /* Used to recover private state from dev */
+ priv->dev.d_private = (void *)g_flexcan; /* Used to recover private state from dev */
/* Create a watchdog for timing polling for and timing of transmissions */
- priv->txpoll = wd_create(); /* Create periodic poll timer */
- priv->txtimeout = wd_create(); /* Create TX timeout timer */
- priv->rx = (struct MbRx *)(S32K1XX_CAN0_MB);
- priv->tx = (struct MbTx *)(S32K1XX_CAN0_MB + (sizeof(struct MbRx)
- * RxMBCount) );
+
+ priv->txpoll = wd_create(); /* Create periodic poll timer */
+ priv->txtimeout = wd_create(); /* Create TX timeout timer */
+ priv->rx = (struct mbrx_s *)(S32K1XX_CAN0_MB);
+ priv->tx = (struct mbtx_s *)(S32K1XX_CAN0_MB +
+ (sizeof(struct mbrx_s) * RXMBCOUNT));
/* Put the interface in the down state. This usually amounts to resetting
* the device and/or calling s32k1xx_ifdown().
@@ -1568,7 +1577,7 @@ int s32k1xx_netinitialize(int intf)
*
****************************************************************************/
-//FIXME CONFIG_S32K1XX_FLEXCAN_NETHIFS == 1 &&
+/* FIXME CONFIG_S32K1XX_FLEXCAN_NETHIFS == 1 && */
#if !defined(CONFIG_NETDEV_LATEINIT)
void up_netinitialize(void)
diff --git a/include/netpacket/can.h b/include/netpacket/can.h
index 45edab5..0b4c7b9 100644
--- a/include/netpacket/can.h
+++ b/include/netpacket/can.h
@@ -126,13 +126,13 @@ struct sockaddr_can
* 1 bit: reserved
*/
- uint32_t pgn;
+ uint32_t pgn;
- /* 1 byte address */
+ /* 1 byte address */
- uint8_t addr;
- } j1939;
- } can_addr;
+ uint8_t addr;
+ } j1939;
+ } can_addr;
};
#endif /* __INCLUDE_NETPACKET_CAN_H */
diff --git a/include/nuttx/can.h b/include/nuttx/can.h
index 02f80a8..7a66a65 100644
--- a/include/nuttx/can.h
+++ b/include/nuttx/can.h
@@ -53,7 +53,6 @@
* Pre-processor Definitions
************************************************************************************/
-
/* Ioctl Commands *******************************************************************/
/* Ioctl commands supported by the upper half CAN driver.
@@ -185,61 +184,17 @@
* CAN_B_NCMDS 77 <- Number of commands
*/
-/************************************************************************************
- * Public Types
- ************************************************************************************/
-
-typedef FAR void *CAN_HANDLE;
-
-struct can_response_s
-{
- sq_entry_t flink;
-
- /* Message-specific data may follow */
-}; //FIXME remvoe
-
-
-typedef uint32_t canid_t;
-
-/*
- * Controller Area Network Error Message Frame Mask structure
- *
- * bit 0-28 : error class mask (see include/uapi/linux/can/error.h)
- * bit 29-31 : set to zero
- */
-typedef uint32_t can_err_mask_t;
-
/* CAN payload length and DLC definitions according to ISO 11898-1 */
+
#define CAN_MAX_DLC 8
#define CAN_MAX_DLEN 8
/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
+
#define CANFD_MAX_DLC 15
#define CANFD_MAX_DLEN 64
-
-/**
- * struct can_frame - basic CAN frame structure
- * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
- * @can_dlc: frame payload length in byte (0 .. 8) aka data length code
- * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
- * mapping of the 'data length code' to the real payload length
- * @__pad: padding
- * @__res0: reserved / padding
- * @__res1: reserved / padding
- * @data: CAN frame payload (up to 8 byte)
- */
-struct can_frame {
- canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
- uint8_t can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
- uint8_t __pad; /* padding */
- uint8_t __res0; /* reserved / padding */
- uint8_t __res1; /* reserved / padding */
- uint8_t data[CAN_MAX_DLEN] __attribute__((aligned(8)));
-};
-
-/*
- * defined bits for canfd_frame.flags
+/* Defined bits for canfd_frame.flags
*
* The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
* be set in the CAN frame bitstream on the wire. The EDL bit switch turns
@@ -254,48 +209,94 @@ struct can_frame {
* building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
* sense for virtual CAN interfaces to test applications with echoed frames.
*/
+
#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
-/**
- * struct canfd_frame - CAN flexible data rate frame structure
- * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
- * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
- * @flags: additional flags for CAN FD
- * @__res0: reserved / padding
- * @__res1: reserved / padding
- * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
+#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
+#define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */
+
+/************************************************************************************
+ * Public Types
+ ************************************************************************************/
+
+typedef FAR void *CAN_HANDLE;
+
+struct can_response_s
+{
+ sq_entry_t flink;
+
+ /* Message-specific data may follow */
+}; /* FIXME remove */
+
+typedef uint32_t canid_t;
+
+/* Controller Area Network Error Message Frame Mask structure
+ *
+ * bit 0-28 : error class mask (see include/uapi/linux/can/error.h)
+ * bit 29-31 : set to zero
*/
-struct canfd_frame {
- canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
- uint8_t len; /* frame payload length in byte */
- uint8_t flags; /* additional flags for CAN FD */
- uint8_t __res0; /* reserved / padding */
- uint8_t __res1; /* reserved / padding */
- uint8_t data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
+
+typedef uint32_t can_err_mask_t;
+
+/* struct can_frame - basic CAN frame structure
+ * can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
+ * can_dlc: frame payload length in byte (0 .. 8) aka data length code
+ * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
+ * mapping of the 'data length code' to the real payload length
+ * __pad: padding
+ * __res0: reserved / padding
+ * __res1: reserved / padding
+ * data: CAN frame payload (up to 8 byte)
+ */
+
+struct can_frame
+{
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ uint8_t can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
+ uint8_t __pad; /* padding */
+ uint8_t __res0; /* reserved / padding */
+ uint8_t __res1; /* reserved / padding */
+ uint8_t data[CAN_MAX_DLEN] __attribute__((aligned(8)));
};
+/* struct canfd_frame - CAN flexible data rate frame structure
+ * can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
+ * len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
+ * flags: additional flags for CAN FD
+ * __res0: reserved / padding
+ * __res1: reserved / padding
+ * data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
+ */
+
+struct canfd_frame
+{
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ uint8_t len; /* frame payload length in byte */
+ uint8_t flags; /* additional flags for CAN FD */
+ uint8_t __res0; /* reserved / padding */
+ uint8_t __res1; /* reserved / padding */
+ uint8_t data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
+};
-/**
- * struct can_filter - CAN ID based filter in can_register().
- * @can_id: relevant bits of CAN ID which are not masked out.
- * @can_mask: CAN mask (see description)
+/* struct can_filter - CAN ID based filter in can_register().
+ * can_id: relevant bits of CAN ID which are not masked out.
+ * can_mask: CAN mask (see description)
*
* Description:
* A filter matches, when
*
- * <received_can_id> & mask == can_id & mask
+ * <received_can_id> & mask == can_id & mask
*
* The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
* filter for error message frames (CAN_ERR_FLAG bit set in mask).
*/
-struct can_filter {
- canid_t can_id;
- canid_t can_mask;
-};
-#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
-#define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */
+struct can_filter
+{
+ canid_t can_id;
+ canid_t can_mask;
+};
/************************************************************************************
* Public Function Prototypes
@@ -310,7 +311,6 @@ extern "C"
#define EXTERN extern
#endif
-
#undef EXTERN
#if defined(__cplusplus)
}
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index cabd2ff..5903c50 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -54,6 +54,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+
/* Configuration ************************************************************/
/* I/O buffer allocation logic supports a throttle value for read-ahead
diff --git a/include/sys/socket.h b/include/sys/socket.h
index bc7cd26..4cf40a7 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -131,7 +131,7 @@
/* Protocol levels supported by get/setsockopt(): */
-#define SOL_SOCKET 0 /* Only socket-level options supported */
+#define SOL_SOCKET 0 /* Only socket-level options supported */
/* Socket-level options */
@@ -202,13 +202,13 @@
* return: int
*/
-
/* The options are unsupported but included for compatibility
* and portability
*/
+
#define SO_TIMESTAMP 29
-#define SO_SNDBUFFORCE 32
-#define SO_RCVBUFFORCE 33
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
#define SO_RXQ_OVFL 40
/* Protocol-level socket operations. */
diff --git a/net/can/can.h b/net/can/can.h
index 46c7425..67c8d6f 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -85,26 +85,25 @@ struct can_conn_s
FAR struct devif_callback_s *list; /* NetLink callbacks */
FAR struct net_driver_s *dev; /* Reference to CAN device */
-
+
/* Read-ahead buffering.
*
* readahead - A singly linked list of type struct iob_qentry_s
* where the CAN/IP read-ahead data is retained.
*/
- struct iob_queue_s readahead; /* remove Read-ahead buffering */
+ struct iob_queue_s readahead; /* remove Read-ahead buffering */
/* CAN-specific content follows */
uint8_t protocol; /* Selected CAN protocol */
int16_t crefs; /* Reference count */
-
/* The following is a list of poll structures of threads waiting for
* socket events.
*/
- struct can_poll_s pollinfo[4]; //FIXME make dynamic
+ struct can_poll_s pollinfo[4]; /* FIXME make dynamic */
};
/****************************************************************************
@@ -223,9 +222,9 @@ uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
* Name: can_recvfrom
*
* Description:
- * Implements the socket recvfrom interface pkt_recvfrom() receives messages from
- * a socket, and may be used to receive data on a socket whether or not it
- * is connection-oriented.
+ * Implements the socket recvfrom interface pkt_recvfrom() receives
+ * messages from a socket, and may be used to receive data on a socket
+ * whether or not it is connection-oriented.
*
* Input Parameters:
* psock A pointer to a NuttX-specific, internal socket structure
@@ -315,7 +314,6 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
void can_readahead_signal(FAR struct can_conn_s *conn);
#endif
-
#undef EXTERN
#ifdef __cplusplus
}
diff --git a/net/can/can_callback.c b/net/can/can_callback.c
index 6f3ae93..c61bdce 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_callback.c
@@ -1,35 +1,20 @@
/****************************************************************************
* net/pkt/pkt_callback.c
*
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
- *
- * 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
*
****************************************************************************/
@@ -72,17 +57,15 @@ can_data_event(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn,
uint16_t flags)
{
uint16_t ret;
- uint8_t *buffer = dev->d_appdata;
- int buflen = dev->d_len;
+ FAR uint8_t *buffer = dev->d_appdata;
+ int buflen = dev->d_len;
uint16_t recvlen;
ret = (flags & ~CAN_NEWDATA);
- //ninfo("No listener on connection\n");
-
- /* Save as the packet data as in the read-ahead buffer. NOTE that
- * partial packets will not be buffered.
- */
+ /* Save as the packet data as in the read-ahead buffer. NOTE that
+ * partial packets will not be buffered.
+ */
recvlen = can_datahandler(conn, buffer, buflen);
if (recvlen < buflen)
@@ -94,10 +77,11 @@ can_data_event(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn,
ninfo("Dropped %d bytes\n", dev->d_len);
#ifdef CONFIG_NET_STATISTICS
- //g_netstats.tcp.drop++;
+ /* g_netstats.tcp.drop++; */
+
#endif
}
-
+
/* In any event, the new data has now been handled */
dev->d_len = 0;
@@ -132,15 +116,15 @@ uint16_t can_callback(FAR struct net_driver_s *dev,
/* Perform the callback */
flags = devif_conn_event(dev, conn, flags, conn->list);
-
- if ((flags & CAN_NEWDATA) != 0)
- {
- /* Data was not handled.. dispose of it appropriately */
-
- flags = can_data_event(dev, conn, flags);
- }
- }
-
+
+ if ((flags & CAN_NEWDATA) != 0)
+ {
+ /* Data was not handled.. dispose of it appropriately */
+
+ flags = can_data_event(dev, conn, flags);
+ }
+ }
+
return flags;
}
@@ -214,7 +198,7 @@ uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
iob_free_chain(iob, IOBUSER_NET_TCP_READAHEAD);
return 0;
}
-
+
#ifdef CONFIG_NET_CAN_NOTIFIER
/* Provide notification(s) that additional CAN read-ahead data is
* available.
diff --git a/net/can/can_getsockopt.c b/net/can/can_getsockopt.c
index d9e19f8..1fe8218 100644
--- a/net/can/can_getsockopt.c
+++ b/net/can/can_getsockopt.c
@@ -1,35 +1,20 @@
/****************************************************************************
* net/can/can_setsockopt.c
*
- * Copyright (C) 2018 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
*
****************************************************************************/
@@ -89,10 +74,9 @@
*
****************************************************************************/
-int can_getsockopt (FAR struct socket *psock, int option,
+int can_getsockopt(FAR struct socket *psock, int option,
FAR void *value, FAR socklen_t *value_len)
{
-
FAR struct can_conn_s *conn;
int ret;
int count = 0;
@@ -107,38 +91,37 @@ int can_getsockopt (FAR struct socket *psock, int option,
return -ENOTCONN;
}
-
switch (option)
{
-
case CAN_RAW_FILTER:
if (*value_len % sizeof(struct can_filter) != 0)
- {
- ret = -EINVAL;
- }
-
+ {
+ ret = -EINVAL;
+ }
+
if (value_len > CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
- {
- ret = -EINVAL;
- }
+ {
+ ret = -EINVAL;
+ }
+
+ count = *value_len / sizeof(struct can_filter);
- count = *value_len / sizeof(struct can_filter);
-
/* FIXME pass filter to driver */
+
break;
-
+
case CAN_RAW_ERR_FILTER:
break;
-
+
case CAN_RAW_LOOPBACK:
break;
-
+
case CAN_RAW_RECV_OWN_MSGS:
break;
-
+
case CAN_RAW_FD_FRAMES:
break;
-
+
case CAN_RAW_JOIN_FILTERS:
break;
diff --git a/net/can/can_input.c b/net/can/can_input.c
index 32dcebf..30e2507 100644
--- a/net/can/can_input.c
+++ b/net/can/can_input.c
@@ -2,39 +2,20 @@
* net/can/can_input.c
* Handling incoming packet input
*
- * Copyright (C) 2014, 2020 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
*
- * Adapted for NuttX from logic in uIP which also has a BSD-like license:
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Original author Adam Dunkels <ad...@dunkels.com>
- * Copyright () 2001-2003, Adam Dunkels.
- * All rights reserved.
- *
- * 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.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
*
****************************************************************************/
@@ -55,11 +36,6 @@
#include "can/can.h"
/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-
-/****************************************************************************
* Public Functions
****************************************************************************/
@@ -88,7 +64,7 @@ int can_input(struct net_driver_s *dev)
FAR struct can_conn_s *conn;
int ret = OK;
- conn = can_nextconn(NULL); //FIXME
+ conn = can_nextconn(NULL); /* FIXME */
if (conn)
{
uint16_t flags;
diff --git a/net/can/can_poll.c b/net/can/can_poll.c
index 80e59a2..77fe24c 100644
--- a/net/can/can_poll.c
+++ b/net/can/can_poll.c
@@ -2,39 +2,20 @@
* net/pkt/pkt_poll.c
* Poll for the availability of packet TX data
*
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
*
- * Adapted for NuttX from logic in uIP which also has a BSD-like license:
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Original author Adam Dunkels <ad...@dunkels.com>
- * Copyright () 2001-2003, Adam Dunkels.
- * All rights reserved.
- *
- * 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.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
*
****************************************************************************/
@@ -88,13 +69,15 @@ void can_poll(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn)
dev->d_sndlen = 0;
/* Perform the application callback */
+
can_callback(dev, conn, CAN_POLL);
/* Check if the application has data to send */
if (dev->d_sndlen > 0)
{
- //FIXME missing logic
+ /* FIXME missing logic */
+
return;
}
}
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index 990786d..d2f71a6 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -1,36 +1,20 @@
/****************************************************************************
* net/can/can_recvfrom.c
*
- * Copyright (C) 2007-2009, 2011-2017, 2020 Gregory Nutt. All rights
- * reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
- *
- * 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
*
****************************************************************************/
@@ -146,7 +130,6 @@ static size_t can_recvfrom_newdata(FAR struct net_driver_s *dev,
/* Copy the new packet data into the user buffer */
memcpy(pstate->pr_buffer, dev->d_buf, recvlen);
- //ninfo("Received %d bytes (of %d)\n", (int)recvlen, (int)dev->d_len);
/* Update the accumulated size of the data read */
@@ -155,7 +138,6 @@ static size_t can_recvfrom_newdata(FAR struct net_driver_s *dev,
return recvlen;
}
-
/****************************************************************************
* Name: can_newdata
*
@@ -187,7 +169,8 @@ static inline void can_newdata(FAR struct net_driver_s *dev,
if (recvlen < dev->d_len)
{
- FAR struct can_conn_s *conn = (FAR struct can_conn_s *)pstate->pr_sock->s_conn;
+ FAR struct can_conn_s *conn =
+ (FAR struct can_conn_s *)pstate->pr_sock->s_conn;
FAR uint8_t *buffer = (FAR uint8_t *)dev->d_appdata + recvlen;
uint16_t buflen = dev->d_len - recvlen;
#ifdef CONFIG_DEBUG_NET
@@ -249,8 +232,8 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
* buffer.
*/
- if((iob = iob_peek_queue(&conn->readahead)) != NULL &&
- pstate->pr_buflen > 0)
+ if ((iob = iob_peek_queue(&conn->readahead)) != NULL &&
+ pstate->pr_buflen > 0)
{
DEBUGASSERT(iob->io_pktlen > 0);
@@ -292,9 +275,11 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
iob_trimhead_queue(&conn->readahead, recvlen,
IOBUSER_NET_CAN_READAHEAD);
}
- return recvlen;
+
+ return recvlen;
}
- return 0;
+
+ return 0;
}
static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
@@ -303,8 +288,6 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
{
struct can_recvfrom_s *pstate = (struct can_recvfrom_s *)pvpriv;
- //ninfo("flags: %04x\n", flags);
-
/* 'priv' might be null in some race conditions (?) */
if (pstate)
@@ -319,17 +302,17 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
/* We are finished. */
- //ninfo("CAN done\n");
-
/* Don't allow any further call backs. */
pstate->pr_cb->flags = 0;
pstate->pr_cb->priv = NULL;
pstate->pr_cb->event = NULL;
+#if 0
/* Save the sender's address in the caller's 'from' location */
- //pkt_recvfrom_sender(dev, pstate);
+ pkt_recvfrom_sender(dev, pstate);
+#endif
/* indicate that the data has been consumed */
@@ -429,16 +412,15 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
(fromlen != NULL && *fromlen >= sizeof(struct sockaddr_can)));
conn = (FAR struct can_conn_s *)psock->s_conn;
-
+
if (psock->s_type != SOCK_RAW)
{
nerr("ERROR: Unsupported socket type: %d\n", psock->s_type);
ret = -ENOSYS;
}
-
-
+
net_lock();
-
+
/* Initialize the state structure. */
memset(&state, 0, sizeof(struct can_recvfrom_s));
@@ -453,19 +435,20 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
state.pr_buflen = len;
state.pr_buffer = buf;
state.pr_sock = psock;
-
+
/* Handle any any CAN data already buffered in a read-ahead buffer. NOTE
* that there may be read-ahead data to be retrieved even after the
* socket has been disconnected.
*/
+
ret = can_readahead(&state);
- if(ret > 0)
- {
+ if (ret > 0)
+ {
net_unlock();
nxsem_destroy(&state.pr_sem);
return ret;
- }
-
+ }
+
/* Get the device driver that will service this transfer */
dev = conn->dev;
@@ -474,7 +457,7 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
ret = -ENODEV;
goto errout_with_state;
}
-
+
/* Set up the callback in the connection */
state.pr_cb = can_callback_alloc(dev, conn);
@@ -502,7 +485,6 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
ret = -EBUSY;
}
-
errout_with_state:
net_unlock();
nxsem_destroy(&state.pr_sem);
diff --git a/net/can/can_setsockopt.c b/net/can/can_setsockopt.c
index db4cb76..2d117a8 100644
--- a/net/can/can_setsockopt.c
+++ b/net/can/can_setsockopt.c
@@ -1,35 +1,20 @@
/****************************************************************************
* net/can/can_setsockopt.c
*
- * Copyright (C) 2018, 2020 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gn...@nuttx.org>
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
*
****************************************************************************/
@@ -87,7 +72,6 @@
int can_setsockopt(FAR struct socket *psock, int option,
FAR const void *value, socklen_t value_len)
{
-
FAR struct can_conn_s *conn;
int ret;
int count = 0;
@@ -101,37 +85,37 @@ int can_setsockopt(FAR struct socket *psock, int option,
return -ENOTCONN;
}
-
switch (option)
{
case CAN_RAW_FILTER:
if (value_len % sizeof(struct can_filter) != 0)
- {
- ret = -EINVAL;
- }
-
+ {
+ ret = -EINVAL;
+ }
+
if (value_len > CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
- {
- ret = -EINVAL;
- }
+ {
+ ret = -EINVAL;
+ }
+
+ count = value_len / sizeof(struct can_filter);
- count = value_len / sizeof(struct can_filter);
-
/* FIXME pass filter to driver */
+
break;
-
+
case CAN_RAW_ERR_FILTER:
break;
-
+
case CAN_RAW_LOOPBACK:
break;
-
+
case CAN_RAW_RECV_OWN_MSGS:
break;
-
+
case CAN_RAW_FD_FRAMES:
break;
-
+
case CAN_RAW_JOIN_FILTERS:
break;
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 5c8415e..573ddd8 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -96,7 +96,6 @@ const struct sock_intf_s g_can_sockif =
can_close /* si_close */
};
-
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -149,12 +148,14 @@ static uint16_t can_poll_eventhandler(FAR struct net_driver_s *dev,
eventset |= (POLLHUP | POLLERR);
}
+#if 0
/* A poll is a sign that we are free to send data. */
- /* else if ((flags & CAN_POLL) != 0 && psock_udp_cansend(info->psock) >= 0)
+ else if ((flags & CAN_POLL) != 0 && psock_udp_cansend(info->psock) >= 0)
{
eventset |= (POLLOUT & info->fds->events);
- }*/
+ }
+#endif
/* Awaken the caller of poll() is requested event occurred. */
@@ -326,23 +327,23 @@ static void can_addref(FAR struct socket *psock)
****************************************************************************/
static int can_bind(FAR struct socket *psock,
- FAR const struct sockaddr *addr, socklen_t addrlen)
+ FAR const struct sockaddr *addr, socklen_t addrlen)
{
FAR struct sockaddr_can *canaddr;
FAR struct can_conn_s *conn;
+ char netdev_name[6];
DEBUGASSERT(psock != NULL && psock->s_conn != NULL && addr != NULL &&
addrlen >= sizeof(struct sockaddr_can));
/* Save the address information in the connection structure */
- canaddr = (FAR struct sockaddr_can *)addr;
- conn = (FAR struct can_conn_s *)psock->s_conn;
+ canaddr = (FAR struct sockaddr_can *)addr;
+ conn = (FAR struct can_conn_s *)psock->s_conn;
/* Bind CAN device to socket */
- //TODO better support for CONFIG_NETDEV_IFINDEX
- char netdev_name[6];
+ /* TODO better support for CONFIG_NETDEV_IFINDEX */
sprintf(netdev_name, "can%i", canaddr->can_ifindex);
@@ -374,8 +375,8 @@ static int can_bind(FAR struct socket *psock,
****************************************************************************/
static int can_getsockname(FAR struct socket *psock,
- FAR struct sockaddr *addr,
- FAR socklen_t *addrlen)
+ FAR struct sockaddr *addr,
+ FAR socklen_t *addrlen)
{
FAR struct sockaddr_can *canaddr;
@@ -430,8 +431,8 @@ static int can_getsockname(FAR struct socket *psock,
****************************************************************************/
static int can_getpeername(FAR struct socket *psock,
- FAR struct sockaddr *addr,
- FAR socklen_t *addrlen)
+ FAR struct sockaddr *addr,
+ FAR socklen_t *addrlen)
{
#warning Missing logic
return -EOPNOTSUPP; /* Or maybe return -EAFNOSUPPORT; */
@@ -488,8 +489,8 @@ static int can_listen(FAR struct socket *psock, int backlog)
****************************************************************************/
static int can_connect(FAR struct socket *psock,
- FAR const struct sockaddr *addr,
- socklen_t addrlen)
+ FAR const struct sockaddr *addr,
+ socklen_t addrlen)
{
#warning Missing logic
return -EOPNOTSUPP;
@@ -540,7 +541,7 @@ static int can_connect(FAR struct socket *psock,
****************************************************************************/
static int can_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
- FAR socklen_t *addrlen, FAR struct socket *newsock)
+ FAR socklen_t *addrlen, FAR struct socket *newsock)
{
#warning Missing logic
return -EOPNOTSUPP;
@@ -570,7 +571,7 @@ static int can_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
****************************************************************************/
static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
- bool setup)
+ bool setup)
{
FAR struct can_conn_s *conn;
FAR struct can_poll_s *info;
@@ -580,18 +581,17 @@ static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
DEBUGASSERT(psock != NULL && psock->s_conn != NULL);
conn = (FAR struct can_conn_s *)psock->s_conn;
info = conn->pollinfo;
-
- //FIXME add NETDEV_DOWN support
+
+ /* FIXME add NETDEV_DOWN support */
/* Check if we are setting up or tearing down the poll */
if (setup)
{
-
net_lock();
-
+
info->dev = conn->dev;
-
+
cb = can_callback_alloc(info->dev, conn);
if (cb == NULL)
{
@@ -600,82 +600,84 @@ static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
}
/* Initialize the poll info container */
-
+
info->psock = psock;
info->fds = fds;
info->cb = cb;
-
+
/* Initialize the callback structure. Save the reference to the info
* structure as callback private data so that it will be available during
* callback processing.
*/
-
+
cb->flags = NETDEV_DOWN;
cb->priv = (FAR void *)info;
cb->event = can_poll_eventhandler;
-
+
if ((fds->events & POLLOUT) != 0)
{
cb->flags |= CAN_POLL;
}
-
+
if ((fds->events & POLLIN) != 0)
{
cb->flags |= CAN_NEWDATA;
}
-
+
/* Save the reference in the poll info structure as fds private as well
* for use during poll teardown as well.
*/
-
+
fds->priv = (FAR void *)info;
-
+
/* Check for read data availability now */
-
+
if (!IOB_QEMPTY(&conn->readahead))
{
/* Normal data may be read without blocking. */
-
+
fds->revents |= (POLLRDNORM & fds->events);
}
-
+
#if 0
if (psock_udp_cansend(psock) >= 0)
{
/* Normal data may be sent without blocking (at least one byte). */
-
+
fds->revents |= (POLLWRNORM & fds->events);
}
#endif
-
+
/* Check if any requested events are already in effect */
-
+
if (fds->revents != 0)
{
/* Yes.. then signal the poll logic */
+
nxsem_post(fds->sem);
}
-
+
errout_with_lock:
net_unlock();
}
- else
+ else
{
info = (FAR struct can_poll_s *)fds->priv;
-
+
if (info != NULL)
- {
- /* Cancel any response notifications */
- can_callback_free(info->dev, conn, info->cb);
+ {
+ /* Cancel any response notifications */
+
+ can_callback_free(info->dev, conn, info->cb);
- /* Release the poll/select data slot */
+ /* Release the poll/select data slot */
- info->fds->priv = NULL;
+ info->fds->priv = NULL;
- /* Then free the poll info container */
+ /* Then free the poll info container */
- info->psock = NULL;
- }
+ info->psock = NULL;
+ }
}
return ret;
@@ -702,27 +704,28 @@ errout_with_lock:
****************************************************************************/
static ssize_t can_send(FAR struct socket *psock, FAR const void *buf,
- size_t len, int flags)
+ size_t len, int flags)
{
- ssize_t ret;
+ ssize_t ret;
- /* Only SOCK_RAW is supported */
+ /* Only SOCK_RAW is supported */
- if (psock->s_type == SOCK_RAW)
- {
- /* Raw packet send */
- ret = psock_can_send(psock, buf, len);
- }
- else
- {
- /* EDESTADDRREQ. Signifies that the socket is not connection-mode and
- * no peer address is set.
- */
+ if (psock->s_type == SOCK_RAW)
+ {
+ /* Raw packet send */
- ret = -EDESTADDRREQ;
- }
+ ret = psock_can_send(psock, buf, len);
+ }
+ else
+ {
+ /* EDESTADDRREQ. Signifies that the socket is not connection-mode and
+ * no peer address is set.
+ */
+
+ ret = -EDESTADDRREQ;
+ }
- return ret;
+ return ret;
}
/****************************************************************************
@@ -750,11 +753,11 @@ static ssize_t can_send(FAR struct socket *psock, FAR const void *buf,
****************************************************************************/
static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
- size_t len, int flags,
- FAR const struct sockaddr *to, socklen_t tolen)
+ size_t len, int flags,
+ FAR const struct sockaddr *to, socklen_t tolen)
{
- nerr("ERROR: sendto() not supported for raw packet sockets\n");
- return -EAFNOSUPPORT;
+ nerr("ERROR: sendto() not supported for raw packet sockets\n");
+ return -EAFNOSUPPORT;
}
/****************************************************************************
diff --git a/net/socket/getsockopt.c b/net/socket/getsockopt.c
index bc07a03..6d71106 100644
--- a/net/socket/getsockopt.c
+++ b/net/socket/getsockopt.c
@@ -376,7 +376,7 @@ int psock_getsockopt(FAR struct socket *psock, int level, int option,
ret = can_getsockopt(psock, option, value, value_len);
#endif
break;
-
+
/* These levels are defined in sys/socket.h, but are not yet
* implemented.
*/
[incubator-nuttx] 10/31: FlexCAN transmit CAN FD support
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 6d8e06bcf0bfb69f46197a0bd2daeee0668bb79d
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Tue Feb 25 16:56:26 2020 +0100
FlexCAN transmit CAN FD support
Also checks now if TX MB is full so that transmit blocks
Note receive performance is affect by non-optimized memcpy please use ARMV7M_MEMCPY for best performance
Removed unused g_desc_pool
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 279 ++++++++++++++++++++-------------
net/can/can_callback.c | 1 +
2 files changed, 172 insertions(+), 108 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index bb0d1d0..f394a20 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -114,6 +114,8 @@
#define CAN_FIFO_OV (1 << 6)
#define CAN_FIFO_WARN (1 << 7)
+#define POOL_SIZE 1
+
/* Interrupt flags for RX fifo */
#define IFLAG1_RXFIFO (CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV)
@@ -236,8 +238,13 @@ struct s32k1xx_driver_s
WDOG_ID txtimeout; /* TX timeout timer */
struct work_s irqwork; /* For deferring interrupt work to the work queue */
struct work_s pollwork; /* For deferring poll work to the work queue */
- struct enet_desc_s *txdesc; /* A pointer to the list of TX descriptor */
- struct enet_desc_s *rxdesc; /* A pointer to the list of RX descriptors */
+#ifdef CAN_FD
+ struct canfd_frame *txdesc; /* A pointer to the list of TX descriptor */
+ struct canfd_frame *rxdesc; /* A pointer to the list of RX descriptors */
+#else
+ struct can_frame *txdesc; /* A pointer to the list of TX descriptor */
+ struct can_frame *rxdesc; /* A pointer to the list of RX descriptors */
+#endif
/* This holds the information visible to the NuttX network */
@@ -253,8 +260,16 @@ struct s32k1xx_driver_s
static struct s32k1xx_driver_s g_flexcan[CONFIG_S32K1XX_ENET_NETHIFS];
-static uint8_t g_desc_pool[2000]
+#ifdef CAN_FD
+static uint8_t g_tx_pool[sizeof(struct canfd_frame)*POOL_SIZE];
+static uint8_t g_rx_pool[sizeof(struct canfd_frame)*POOL_SIZE];
+#else
+static uint8_t g_tx_pool[sizeof(struct can_frame)*POOL_SIZE]
+ __attribute__((aligned(ARMV7M_DCACHE_LINESIZE)));
+static uint8_t g_rx_pool[sizeof(struct can_frame)*POOL_SIZE]
__attribute__((aligned(ARMV7M_DCACHE_LINESIZE)));
+#endif
+
/****************************************************************************
* Private Function Prototypes
@@ -368,16 +383,17 @@ static void s32k1xx_reset(struct s32k1xx_driver_s *priv);
static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv)
{
- uint8_t txnext;
-
- /* Check if there is room in the hardware to hold another outgoing
- * packet. The ring is full if incrementing the head pointer would
- * collide with the tail pointer.
- */
-
- txnext = priv->txhead + 1;
+ uint32_t mbi = 0;
- return priv->txtail == txnext;
+ while (mbi < TXMBCOUNT)
+ {
+ if (priv->tx[mbi].cs.code != CAN_TXMB_DATAORREMOTE)
+ {
+ return 0;
+ }
+ mbi++;
+ }
+ return 1;
}
/****************************************************************************
@@ -404,19 +420,6 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
{
#warning Missing logic
- struct can_frame *frame = (struct can_frame *)priv->dev.d_buf;
-
-#if 0
- ninfo("CAN id: %i dlc: %i", frame->can_id, frame->can_dlc);
-
- for (int i = 0; i < frame->can_dlc; i++)
- {
- ninfo(" %02X", frame->data[i]);
- }
-
- ninfo("\r\n");
-#endif
-
/* Attempt to write frame */
uint32_t mbi = 0;
@@ -456,45 +459,98 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
struct mb_s *mb = &priv->tx[mbi];
mb->cs.code = CAN_TXMB_INACTIVE;
- if (0) /* FIXME detect Std or Ext id */
- {
- cs.ide = 1;
- mb->id.ext = frame->can_id & MASKEXTID;
- }
- else
+ if(priv->dev.d_len == sizeof(struct can_frame))
{
- mb->id.std = frame->can_id & MASKSTDID;
- }
+ struct can_frame *frame = (struct can_frame *)priv->dev.d_buf;
-#if 0
- cs.rtr = frame.isRemoteTransmissionRequest();
-#endif
+ if (0) /* FIXME detect Std or Ext id */
+ {
+ cs.ide = 1;
+ mb->id.ext = frame->can_id & MASKEXTID;
+ }
+ else
+ {
+ mb->id.std = frame->can_id & MASKSTDID;
+ }
- cs.dlc = frame->can_dlc;
+ #if 0
+ cs.rtr = frame.isRemoteTransmissionRequest();
+ #endif
- /* FIXME endian swap instruction or somekind takes 1.5us right now */
+ cs.dlc = frame->can_dlc;
- mb->data[0].b00 = frame->data[0];
- mb->data[0].b01 = frame->data[1];
- mb->data[0].b02 = frame->data[2];
- mb->data[0].b03 = frame->data[3];
- mb->data[1].b00 = frame->data[4];
- mb->data[1].b01 = frame->data[5];
- mb->data[1].b02 = frame->data[6];
- mb->data[1].b03 = frame->data[7];
+ mb->data[0].w00 = __builtin_bswap32(*(uint32_t*)&frame->data[0]);
+ mb->data[1].w00 = __builtin_bswap32(*(uint32_t*)&frame->data[4]);
-#if 0
- /* Registering the pending transmission so we can track its deadline and
- * loopback it as needed
- */
+ }
+ else /* CAN FD frame */
+ {
+ struct canfd_frame *frame = (struct canfd_frame *)priv->dev.d_buf;
+
+ cs.edl = 1; /* CAN FD Frame */
+
+ if (0) /* FIXME detect Std or Ext id */
+ {
+ cs.ide = 1;
+ mb->id.ext = frame->can_id & MASKEXTID;
+ }
+ else
+ {
+ mb->id.std = frame->can_id & MASKSTDID;
+ }
+
+ #if 0
+ cs.rtr = frame.isRemoteTransmissionRequest();
+ #endif
+
+ if(frame->len < 9)
+ {
+ cs.dlc = frame->len;
+ }
+ else
+ {
+ if (frame->len < 13)
+ {
+ cs.dlc = 9;
+ }
+ else if (frame->len < 17)
+ {
+ cs.dlc = 10;
+ }
+ else if (frame->len < 21)
+ {
+ cs.dlc = 11;
+ }
+ else if (frame->len < 25)
+ {
+ cs.dlc = 12;
+ }
+ else if (frame->len < 33)
+ {
+ cs.dlc = 13;
+ }
+ else if (frame->len < 49)
+ {
+ cs.dlc = 14;
+ }
+ else if (frame->len < 65)
+ {
+ cs.dlc = 15;
+ }
+ else
+ {
+ cs.dlc = 15; /* FIXME check CAN FD spec */
+ }
+ }
+
+ uint32_t* frame_data_word = (uint32_t*)&frame->data[0];
+
+ for(int i = 0; i < (frame->len + 4 - 1) / 4; i++)
+ {
+ mb->data[i].w00 = __builtin_bswap32(frame_data_word[i]);
+ }
+ }
- txitem& txi = pending_tx_[mbi];
- txi.deadline = tx_deadline;
- txi.frame = frame;
- txi.loopback = (flags & uavcan::CanIOFlagLoopback) != 0;
- txi.abort_on_error = (flags & uavcan::CanIOFlagAbortOnError) != 0;
- txi.pending = txitem::busy;
-#endif
s32k1xx_gpiowrite(PIN_PORTD | PIN31, 0);
@@ -552,6 +608,7 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
s32k1xx_transmit(priv);
#if 0
+ //FIXME implement ring buffer and increment pointer just like the enet driver??
priv->dev.d_buf =
(uint8_t *)s32k1xx_swap32((uint32_t)priv->txdesc[priv->txhead].data);
#endif
@@ -633,138 +690,127 @@ static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
if(rf->cs.edl) /* CAN FD frame */
{
-
- struct canfd_frame frame;
+ struct canfd_frame* frame = priv->rxdesc;
if (rf->cs.ide)
{
- frame.can_id = MASKEXTID & rf->id.ext;
- frame.can_id |= FLAGEFF;
+ frame->can_id = MASKEXTID & rf->id.ext;
+ frame->can_id |= FLAGEFF;
}
else
{
- frame.can_id = MASKSTDID & rf->id.std;
+ frame->can_id = MASKSTDID & rf->id.std;
}
if (rf->cs.rtr)
{
- frame.can_id |= FLAGRTR;
+ frame->can_id |= FLAGRTR;
}
if(rf->cs.dlc < 9){
- frame.len = rf->cs.dlc;
+ frame->len = rf->cs.dlc;
} else {
switch(rf->cs.dlc)
{
case 9:
- frame.len = 12;
+ frame->len = 12;
break;
case 10:
- frame.len = 16;
+ frame->len = 16;
break;
case 11:
- frame.len = 20;
+ frame->len = 20;
break;
case 12:
- frame.len = 24;
+ frame->len = 24;
break;
case 13:
- frame.len = 32;
+ frame->len = 32;
break;
case 14:
- frame.len = 48;
+ frame->len = 48;
break;
case 15:
- frame.len = 64;
+ frame->len = 64;
break;
}
}
- int j = 0;
- for(int i = 0; i < (frame.len + 4 - 1) / 4; i++)
+ uint32_t* frame_data_word = (uint32_t*)&frame->data[0];
+
+ for(int i = 0; i < (frame->len + 4 - 1) / 4; i++)
{
- frame.data[0+j] = rf->data[i].b00;
- frame.data[1+j] = rf->data[i].b01;
- frame.data[2+j] = rf->data[i].b02;
- frame.data[3+j] = rf->data[i].b03;
- j = j + 4;
+ frame_data_word[i] = __builtin_bswap32(rf->data[i].w00);
}
/* Clear MB interrupt flag */
regval = getreg32(S32K1XX_CAN0_IFLAG1);
- regval |= (1 << mb_index);
+ regval |= (0x80000000 >> mb_index);
putreg32(regval, S32K1XX_CAN0_IFLAG1);
- /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
+ /* Copy the buffer pointer to priv->dev.. Set amount of data
* in priv->dev.d_len
*/
priv->dev.d_len = sizeof(struct canfd_frame);
- priv->dev.d_buf = (uint8_t *)s32k1xx_swap32((uint32_t)&frame); /* FIXME */
+ priv->dev.d_buf = frame;
}
else /* CAN 2.0 Frame */
{
- struct can_frame frame;
+ struct can_frame* frame = priv->rxdesc;
if (rf->cs.ide)
{
- frame.can_id = MASKEXTID & rf->id.ext;
- frame.can_id |= FLAGEFF;
+ frame->can_id = MASKEXTID & rf->id.ext;
+ frame->can_id |= FLAGEFF;
}
else
{
- frame.can_id = MASKSTDID & rf->id.std;
+ frame->can_id = MASKSTDID & rf->id.std;
}
if (rf->cs.rtr)
{
- frame.can_id |= FLAGRTR;
+ frame->can_id |= FLAGRTR;
}
- frame.can_dlc = rf->cs.dlc;
+ frame->can_dlc = rf->cs.dlc;
- frame.data[0] = rf->data[0].b00;
- frame.data[1] = rf->data[0].b01;
- frame.data[2] = rf->data[0].b02;
- frame.data[3] = rf->data[0].b03;
- frame.data[4] = rf->data[1].b00;
- frame.data[5] = rf->data[1].b01;
- frame.data[6] = rf->data[1].b02;
- frame.data[7] = rf->data[1].b03;
+ *(uint32_t*)&frame->data[0] = __builtin_bswap32(rf->data[0].w00);
+ *(uint32_t*)&frame->data[4] = __builtin_bswap32(rf->data[1].w00);
/* Clear MB interrupt flag */
regval = getreg32(S32K1XX_CAN0_IFLAG1);
regval |= (1 << mb_index);
putreg32(regval, S32K1XX_CAN0_IFLAG1);
- /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
+ /* Copy the buffer pointer to priv->dev.. Set amount of data
* in priv->dev.d_len
*/
priv->dev.d_len = sizeof(struct can_frame);
- priv->dev.d_buf = (uint8_t *)s32k1xx_swap32((uint32_t)&frame); /* FIXME */
+ priv->dev.d_buf = frame;
}
- /* Invalidate the buffer so that the correct packet will be re-read
- * from memory when the packet content is accessed.
- */
-
- up_invalidate_dcache((uintptr_t)priv->dev.d_buf,
- (uintptr_t)priv->dev.d_buf + priv->dev.d_len);
-
/* Send to socket interface */
NETDEV_RXPACKETS(&priv->dev);
can_input(&priv->dev);
- /* Store with timeout into the FIFO buffer and signal update event */
+ /* Point the packet buffer back to the next Tx buffer that will be
+ * used during the next write. If the write queue is full, then
+ * this will point at an active buffer, which must not be written
+ * to. This is OK because devif_poll won't be called unless the
+ * queue is not full.
+ */
+ priv->dev.d_buf = priv->txdesc;
}
}
@@ -790,6 +836,12 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
#warning Missing logic
+ /* We are here because a transmission completed, so the watchdog can be
+ * canceled.
+ */
+
+ wd_cancel(priv->txtimeout);
+
/* FIXME process aborts */
/* Process TX completions */
@@ -805,10 +857,18 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
const bool txok = priv->tx[mbi].cs.code != CAN_TXMB_ABORT;
handleTxMailboxInterrupt(mbi, txok, utc_usec);
#endif
+
+ NETDEV_TXDONE(&priv->dev);
}
mb_bit <<= 1;
}
+
+ /* There should be space for a new TX in any event. Poll the network for
+ * new XMIT data
+ */
+
+ devif_poll(&priv->dev, s32k1xx_txpoll);
}
/****************************************************************************
@@ -950,7 +1010,7 @@ static void s32k1xx_poll_work(FAR void *arg)
*/
net_lock();
- if (1) /* !s32k1xx_txringfull(priv)) */
+ if (!s32k1xx_txringfull(priv))
{
/* If so, update TCP timing states and poll the network for new XMIT
* data. Hmmm.. might be bug here. Does this mean if there is a
@@ -1096,7 +1156,10 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
priv->bifup = true;
- priv->dev.d_buf = &g_desc_pool;
+ priv->txdesc = &g_tx_pool;
+ priv->rxdesc = &g_rx_pool;
+
+ priv->dev.d_buf = priv->txdesc;
/* Set interrupts */
@@ -1461,7 +1524,7 @@ static void s32k1xx_reset(struct s32k1xx_driver_s *priv)
(((TOTALMBCOUNT - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
putreg32(regval, S32K1XX_CAN0_MCR);
- regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN | CAN_CTRL2_RFFN_16MB; /* FIXME TASD */
+ regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN; /* FIXME TASD */
putreg32(regval, S32K1XX_CAN0_CTRL2);
for (i = 0; i < TOTALMBCOUNT; i++)
diff --git a/net/can/can_callback.c b/net/can/can_callback.c
index c61bdce..0f60b6a 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_callback.c
@@ -30,6 +30,7 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/netdev.h>
+#include <nuttx/mm/iob.h>
#include "devif/devif.h"
#include "can/can.h"
[incubator-nuttx] 04/31: PoC S32K1XX FlexCAN sends CAN msgs through
SocketCAN
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit d600a3dca452519c129d04f03244dff048970428
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Feb 19 11:24:31 2020 +0100
PoC S32K1XX FlexCAN sends CAN msgs through SocketCAN
---
arch/arm/src/s32k1xx/Kconfig | 4 +
arch/arm/src/s32k1xx/Make.defs | 4 +
arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h | 57 +-
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 1422 ++++++++++++++++++++
.../arm/src/s32k1xx/s32k1xx_flexcan.h | 120 +-
include/nuttx/can.h | 279 ++++
include/nuttx/net/can.h | 88 ++
include/nuttx/net/net.h | 3 +-
net/can/Make.defs | 6 +
net/can/can.h | 75 ++
net/{devif/devif_pktsend.c => can/can_callback.c} | 70 +-
net/can/can_poll.c | 107 ++
net/can/can_send.c | 264 ++++
net/can/can_sockif.c | 81 +-
net/devif/Make.defs | 2 +-
net/devif/devif.h | 4 +-
net/devif/devif_pktsend.c | 2 +-
net/devif/devif_poll.c | 49 +
net/local/local_sendpacket.c | 1 +
net/netdev/netdev_register.c | 12 +
20 files changed, 2487 insertions(+), 163 deletions(-)
diff --git a/arch/arm/src/s32k1xx/Kconfig b/arch/arm/src/s32k1xx/Kconfig
index 63e0cd9..68f9bb6 100644
--- a/arch/arm/src/s32k1xx/Kconfig
+++ b/arch/arm/src/s32k1xx/Kconfig
@@ -150,6 +150,10 @@ config S32K1XX_ENET
default n
depends on S32K1XX_HAVE_ENET
+config S32K1XX_FLEXCAN
+ bool "FLEXCAN"
+ default n
+
menuconfig S32K1XX_LPI2C0
bool "LPI2C0"
default n
diff --git a/arch/arm/src/s32k1xx/Make.defs b/arch/arm/src/s32k1xx/Make.defs
index a06fa86..940dc05 100644
--- a/arch/arm/src/s32k1xx/Make.defs
+++ b/arch/arm/src/s32k1xx/Make.defs
@@ -87,6 +87,10 @@ ifeq ($(CONFIG_S32K1XX_ENET),y)
CHIP_CSRCS += s32k1xx_enet.c
endif
+ifeq ($(CONFIG_S32K1XX_FLEXCAN),y)
+CHIP_CSRCS += s32k1xx_flexcan.c
+endif
+
ifeq ($(CONFIG_S32K1XX_RTC),y)
CHIP_CSRCS += s32k1xx_rtc.c
endif
diff --git a/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h b/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
index fa9c36f..03d3d90 100644
--- a/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
+++ b/arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
@@ -66,6 +66,9 @@
#define S32K1XX_CAN_CRCR_OFFSET 0x0044 /* CRC Register */
#define S32K1XX_CAN_RXFGMASK_OFFSET 0x0048 /* Rx FIFO Global Mask Register */
#define S32K1XX_CAN_RXFIR_OFFSET 0x004c /* Rx FIFO Information Register */
+#define S32K1XX_CAN_CBT_OFFSET 0x0050 /* CAN Bit Timing register */
+
+#define S32K1XX_CAN_MB_OFFSET 0x0080 /* CAN MB register */
#define S32K1XX_CAN_RXIMR_OFFSET(n) (0x0880 + ((n) << 2)) /* Rn Individual Mask Registers */
# define S32K1XX_CAN_RXIMR0_OFFSET 0x0880 /* R0 Individual Mask Registers */
@@ -162,6 +165,11 @@
#define S32K1XX_CAN0_CRCR (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_CRCR_OFFSET)
#define S32K1XX_CAN0_RXFGMASK (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_RXFGMASK_OFFSET)
#define S32K1XX_CAN0_RXFIR (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_RXFIR_OFFSET)
+#define S32K1XX_CAN0_CBT (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_CBT_OFFSET)
+#define S32K1XX_CAN0_MB (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_MB_OFFSET)
+#define S32K1XX_CAN0_FDCTRL (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_FDCTRL_OFFSET)
+#define S32K1XX_CAN0_FDCBT (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_FDCBT_OFFSET)
+#define S32K1XX_CAN0_FDCRC (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_FDCRC_OFFSET)
#define S32K1XX_CAN0_RXIMR(n) (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_RXIMR_OFFSET(n))
# define S32K1XX_CAN0_RXIMR0 (S32K1XX_FLEXCAN0_BASE + S32K1XX_CAN_RXIMR0_OFFSET)
@@ -340,7 +348,8 @@
# define CAN_MCR_IDAM_FMTB (1 << CAN_MCR_IDAM_SHIFT) /* Format B: Two full (or partial) IDs */
# define CAN_MCR_IDAM_FMTC (2 << CAN_MCR_IDAM_SHIFT) /* Format C: Four partial IDs */
# define CAN_MCR_IDAM_FMTD (3 << CAN_MCR_IDAM_SHIFT) /* Format D: All frames rejected */
- /* Bits 10-11: Reserved */
+ /* Bit 10: Reserved */
+#define CAN_MCR_FDEN (1 << 11) /* Bit 11: CAN FD operation enable */
#define CAN_MCR_AEN (1 << 12) /* Bit 12: Abort Enable */
#define CAN_MCR_LPRIOEN (1 << 13) /* Bit 13: Local Priority Enable */
/* Bits 14-15: Reserved */
@@ -454,7 +463,12 @@
#define CAN_IFLAG1(n) (1 << (n)) /* Bit n: Buffer MBn Interrupt, n=0..4,8..31 */
/* Control 2 Register */
- /* Bits 0-15: Reserved */
+ /* Bits 0-10: Reserved */
+#define CAN_CTRL2_EDFLTDIS (1 << 11) /* Bit 11: Edge Filter Disable */
+#define CAN_CTRL2_ISOCANFDEN (1 << 12) /* Bit 12: ISO CAN FD Enable */
+ /* Bit 13: Reserved */
+#define CAN_CTRL2_PREXCEN (1 << 14) /* Bit 14: Protocol Exception Enable */
+#define CAN_CTRL2_TIMER_SRC (1 << 15) /* Bit 15: Timer Source */
#define CAN_CTRL2_EACEN (1 << 16) /* Bit 16: Entire Frame Arbitration Field Comparison Enable (Rx) */
#define CAN_CTRL2_RRS (1 << 17) /* Bit 17: Remote Request Storing */
#define CAN_CTRL2_MRP (1 << 18) /* Bit 18: Mailboxes Reception Priority */
@@ -506,6 +520,45 @@
#define CAN_RXFIR_IDHIT_SHIFT (0) /* Bits 0-8: Identifier Acceptance Filter Hit Indicator */
#define CAN_RXFIR_IDHIT_MASK (0x1ff << CAN_RXFIR_IDHIT_SHIFT)
+/* CAN Bit Timing register (CBT) */
+
+/* CBT Bit Fields */
+#define CAN_CBT_EPSEG2(x) (((uint32_t)(((uint32_t)(x)) << 0)) & 0x1F)
+#define CAN_CBT_EPSEG1(x) (((uint32_t)(((uint32_t)(x)) << 5)) & 0x3E0)
+#define CAN_CBT_EPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << 10)) & 0xFC00)
+#define CAN_CBT_ERJW(x) (((uint32_t)(((uint32_t)(x)) << 16)) & 0x1F0000)
+#define CAN_CBT_EPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << 21)) & 0x7FE00000)
+#define CAN_CBT_BTF (1 << 31) /* Bit 31: Bit Timing Format Enable */
+
+/* CAN MB TX codes */
+#define CAN_TXMB_INACTIVE 0x8 /* MB is not active.*/
+#define CAN_TXMB_ABORT 0x9 /* MB is aborted.*/
+#define CAN_TXMB_DATAORREMOTE 0xC /* MB is a TX Data Frame(when MB RTR = 0) or */
+ /* MB is a TX Remote Request Frame (when MB RTR = 1).*/
+#define CAN_TXMB_TANSWER 0xE /* MB is a TX Response Request Frame from */
+ /* an incoming Remote Request Frame.*/
+#define CAN_TXMB_NOTUSED 0xF /* Not used.*/
+
+/* CAN FD Control register (FDCTRL) */
+#define CAN_FDCTRL_TDCVAL(x) (((uint32_t)(((uint32_t)(x)) << 0)) & 0x3F)
+#define CAN_FDCTRL_TDCOFF(x) (((uint32_t)(((uint32_t)(x)) << 8)) & 0x1F00)
+#define CAN_FDCTRL_TDCEN (1 << 14) /* Bit 14: TDC fail */
+#define CAN_FDCTRL_TDCEN (1 << 15) /* Bit 15: TDC enable */
+#define CAN_FDCTRL_MBDSR0(x) (((uint32_t)(((uint32_t)(x)) << 16)) & 0x30000)
+#define CAN_FDCTRL_FDRATE (1 << 31) /* Bit 31: FD rate */
+
+/* FDCBT Bit Fields */
+#define CAN_FDCBT_FPSEG2(x) (((uint32_t)(((uint32_t)(x)) << 0)) & 0x7)
+#define CAN_FDCBT_FPSEG1(x) (((uint32_t)(((uint32_t)(x)) << 5)) & 0xE0)
+#define CAN_FDCBT_FPROPSEG(x) (((uint32_t)(((uint32_t)(x)) << 10)) & 0x7C00)
+#define CAN_FDCBT_FRJW(x) (((uint32_t)(((uint32_t)(x)) << 16)) & 0x70000)
+#define CAN_FDCBT_FPRESDIV(x) (((uint32_t)(((uint32_t)(x)) << 20)) & 0x3FF00000)
+
+/* FDCRC Bit Fields */
+#define CAN_FDCRC_FD_TXCRC(x) (((uint32_t)(((uint32_t)(x)) << 0)) & 0x1FFFFF)
+#define CAN_FDCRC_FD_MBCRC(x) (((uint32_t)(((uint32_t)(x)) << 24)) & 0x7F000000)
+
+
/* Rn Individual Mask Registers */
#define CAN_RXIMR(n) (1 << (n)) /* Bit n: Individual Mask Bits */
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
new file mode 100644
index 0000000..74a21b8
--- /dev/null
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -0,0 +1,1422 @@
+/****************************************************************************
+ * arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+ *
+ * Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ * Authors: Gregory Nutt <gn...@nuttx.org>
+ *
+ * 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 <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <time.h>
+#include <string.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <arpa/inet.h>
+
+#include <nuttx/can.h>
+#include <nuttx/wdog.h>
+#include <nuttx/irq.h>
+#include <nuttx/arch.h>
+#include <nuttx/wqueue.h>
+#include <nuttx/signal.h>
+#include <nuttx/net/mii.h>
+#include <nuttx/net/arp.h>
+#include <nuttx/net/phy.h>
+#include <nuttx/net/netdev.h>
+
+#ifdef CONFIG_NET_PKT
+# include <nuttx/net/pkt.h>
+#endif
+
+#include "up_arch.h"
+#include "chip.h"
+#include "s32k1xx_config.h"
+#include "hardware/s32k1xx_flexcan.h"
+#include "hardware/s32k1xx_pinmux.h"
+#include "s32k1xx_periphclocks.h"
+#include "s32k1xx_pin.h"
+#include "s32k1xx_flexcan.h"
+
+#ifdef CONFIG_S32K1XX_FLEXCAN
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* If processing is not done at the interrupt level, then work queue support
+ * is required.
+ */
+
+#if !defined(CONFIG_SCHED_WORKQUEUE)
+# error Work queue support is required
+#else
+
+ /* Select work queue. Always use the LP work queue if available. If not,
+ * then LPWORK will re-direct to the HP work queue.
+ *
+ * NOTE: However, the network should NEVER run on the high priority work
+ * queue! That queue is intended only to service short back end interrupt
+ * processing that never suspends. Suspending the high priority work queue
+ * may bring the system to its knees!
+ */
+
+# define ETHWORK LPWORK
+#endif
+
+/* CONFIG_S32K1XX_FLEXCAN_NETHIFS determines the number of physical interfaces
+ * that will be supported.
+ */
+/*
+#if CONFIG_S32K1XX_FLEXCAN_NETHIFS != 1
+# error "CONFIG_S32K1XX_FLEXCAN_NETHIFS must be one for now"
+#endif
+
+#if CONFIG_S32K1XX_FLEXCAN_NTXBUFFERS < 1
+# error "Need at least one TX buffer"
+#endif
+
+#if CONFIG_S32K1XX_FLEXCAN_NRXBUFFERS < 1
+# error "Need at least one RX buffer"
+#endif*/
+
+#define S32K1XX_FLEXCAN_FIRST_TX_MB 10
+
+#define MaskStdID 0x000007FF;
+#define MaskExtID 0x1FFFFFFF;
+
+//Fixme nice variables/constants
+#define NumMBinFiFoAndFilters 10 //FIXME
+#define NumTxMesgBuffers 6
+#define HWMaxMB 16
+#define TXMBMask (0b111111 << NumMBinFiFoAndFilters)
+
+#define CAN_FIFO_NE (1 << 5)
+#define CAN_FIFO_OV (1 << 6)
+#define CAN_FIFO_WARN (1 << 7)
+
+static int peak_tx_mailbox_index_ = 0;
+
+
+
+
+/* Normally you would clean the cache after writing new values to the DMA
+ * memory so assure that the dirty cache lines are flushed to memory
+ * before the DMA occurs. And you would invalid the cache after a data is
+ * received via DMA so that you fetch the actual content of the data from
+ * the cache.
+ *
+ * These conditions are not fully supported here. If the write-throuch
+ * D-Cache is enabled, however, then many of these issues go away: The
+ * cache clean operation does nothing (because there are not dirty cache
+ * lines) and the cache invalid operation is innocuous (because there are
+ * never dirty cache lines to be lost; valid data will always be reloaded).
+ *
+ * At present, we simply insist that write through cache be enabled.
+ */
+
+#if defined(CONFIG_ARMV7M_DCACHE) && !defined(CONFIG_ARMV7M_DCACHE_WRITETHROUGH)
+# error Write back D-Cache not yet supported
+#endif
+
+/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per
+ * second.
+ */
+
+#define S32K1XX_WDDELAY (1*CLK_TCK)
+
+/* Align assuming that the D-Cache is enabled (probably 32-bytes).
+ *
+ * REVISIT: The size of descriptors and buffers must also be in even units
+ * of the cache line size That is because the operations to clean and
+ * invalidate the cache will operate on a full 32-byte cache line. If
+ * CONFIG_FLEXCAN_ENHANCEDBD is selected, then the size of the descriptor is
+ * 32-bytes (and probably already the correct size for the cache line);
+ * otherwise, the size of the descriptors much smaller, only 8 bytes.
+ */
+
+#define FLEXCAN_ALIGN ARMV7M_DCACHE_LINESIZE
+#define FLEXCAN_ALIGN_MASK (FLEXCAN_ALIGN - 1)
+#define FLEXCAN_ALIGN_UP(n) (((n) + FLEXCAN_ALIGN_MASK) & ~FLEXCAN_ALIGN_MASK)
+
+/* TX timeout = 1 minute */
+
+#define S32K1XX_TXTIMEOUT (60*CLK_TCK)
+#define MII_MAXPOLLS (0x1ffff)
+#define LINK_WAITUS (500*1000)
+#define LINK_NLOOPS (10)
+
+/* Interrupt groups */
+
+#define RX_INTERRUPTS (FLEXCAN_INT_RXF | FLEXCAN_INT_RXB)
+#define TX_INTERRUPTS FLEXCAN_INT_TXF
+#define ERROR_INTERRUPTS (FLEXCAN_INT_UN | FLEXCAN_INT_RL | FLEXCAN_INT_LC | \
+ FLEXCAN_INT_EBERR | FLEXCAN_INT_BABT | FLEXCAN_INT_BABR)
+
+/* The subset of errors that require us to reset the hardware - this list
+ * may need to be revisited if it's found that some error above leads to a
+ * locking up of the Ethernet interface.
+ */
+
+#define CRITICAL_ERROR (FLEXCAN_INT_UN | FLEXCAN_INT_RL | FLEXCAN_INT_EBERR )
+
+/* This is a helper pointer for accessing the contents of the Ethernet header */
+
+#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
+
+#define S32K1XX_BUF_SIZE FLEXCAN_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE)
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+
+union TXcsType
+{
+ volatile uint32_t w;
+ struct
+ {
+ volatile uint32_t time_stamp : 16;
+ volatile uint32_t dlc : 4;
+ volatile uint32_t rtr : 1;
+ volatile uint32_t ide : 1;
+ volatile uint32_t srr : 1;
+ volatile uint32_t res : 1;
+ volatile uint32_t code : 4;
+ volatile uint32_t res2 : 4;
+ };
+};
+
+union RXcsType
+{
+ volatile uint32_t cs;
+ struct
+ {
+ volatile uint32_t time_stamp : 16;
+ volatile uint32_t dlc : 4;
+ volatile uint32_t rtr : 1;
+ volatile uint32_t ide : 1;
+ volatile uint32_t srr : 1;
+ volatile uint32_t res : 9;
+ };
+};
+
+union IDType
+{
+ volatile uint32_t w;
+ struct
+ {
+ volatile uint32_t ext : 29;
+ volatile uint32_t resex : 3;
+ };
+ struct
+ {
+ volatile uint32_t res : 18;
+ volatile uint32_t std : 11;
+ volatile uint32_t resstd : 3;
+ };
+};
+
+union DataType
+{
+ volatile uint32_t l;
+ volatile uint32_t h;
+ struct
+ {
+ volatile uint32_t b3 : 8;
+ volatile uint32_t b2 : 8;
+ volatile uint32_t b1 : 8;
+ volatile uint32_t b0 : 8;
+ volatile uint32_t b7 : 8;
+ volatile uint32_t b6 : 8;
+ volatile uint32_t b5 : 8;
+ volatile uint32_t b4 : 8;
+ };
+};
+
+struct MbTx
+{
+ union TXcsType CS;
+ union IDType ID;
+ union DataType data;
+};
+
+struct MbRx
+{
+ union RXcsType CS;
+ union IDType ID;
+ union DataType data;
+};
+
+/* The s32k1xx_driver_s encapsulates all state information for a single
+ * hardware interface
+ */
+
+struct s32k1xx_driver_s
+{
+ bool bifup; /* true:ifup false:ifdown */
+ uint8_t txtail; /* The oldest busy TX descriptor */
+ uint8_t txhead; /* The next TX descriptor to use */
+ uint8_t rxtail; /* The next RX descriptor to use */
+ uint8_t phyaddr; /* Selected PHY address */
+ WDOG_ID txpoll; /* TX poll timer */
+ WDOG_ID txtimeout; /* TX timeout timer */
+ struct work_s irqwork; /* For deferring interrupt work to the work queue */
+ struct work_s pollwork; /* For deferring poll work to the work queue */
+ struct enet_desc_s *txdesc; /* A pointer to the list of TX descriptor */
+ struct enet_desc_s *rxdesc; /* A pointer to the list of RX descriptors */
+
+ /* This holds the information visible to the NuttX network */
+
+ struct net_driver_s dev; /* Interface understood by the network */
+
+ struct MbRx *rx;
+ struct MbTx *tx;
+
+};
+
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct s32k1xx_driver_s g_flexcan[CONFIG_S32K1XX_ENET_NETHIFS];
+
+static uint8_t g_desc_pool[2000]
+ __attribute__((aligned(ARMV7M_DCACHE_LINESIZE)));
+
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/* Utility functions */
+
+#ifndef S32K1XX_BUFFERS_SWAP
+# define s32k1xx_swap32(value) (value)
+# define s32k1xx_swap16(value) (value)
+#else
+#if 0 /* Use builtins if the compiler supports them */
+static inline uint32_t s32k1xx_swap32(uint32_t value);
+static inline uint16_t s32k1xx_swap16(uint16_t value);
+#else
+# define s32k1xx_swap32 __builtin_bswap32
+# define s32k1xx_swap16 __builtin_bswap16
+#endif
+#endif
+
+/* Common TX logic */
+
+static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv);
+static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv);
+static int s32k1xx_txpoll(struct net_driver_s *dev);
+
+/* Interrupt handling */
+
+static void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv);
+static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv);
+static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv);
+
+static void s32k1xx_flexcan_interrupt_work(FAR void *arg);
+static int s32k1xx_flexcan_interrupt(int irq, FAR void *context,
+ FAR void *arg);
+
+/* Watchdog timer expirations */
+
+static void s32k1xx_txtimeout_work(FAR void *arg);
+static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...);
+
+static void s32k1xx_poll_work(FAR void *arg);
+static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...);
+
+/* NuttX callback functions */
+
+static int s32k1xx_ifup(struct net_driver_s *dev);
+static int s32k1xx_ifdown(struct net_driver_s *dev);
+
+static void s32k1xx_txavail_work(FAR void *arg);
+static int s32k1xx_txavail(struct net_driver_s *dev);
+
+#ifdef CONFIG_NET_MCASTGROUP
+static int s32k1xx_addmac(struct net_driver_s *dev,
+ FAR const uint8_t *mac);
+static int s32k1xx_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
+#endif
+
+#ifdef CONFIG_NETDEV_IOCTL
+static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
+ unsigned long arg);
+#endif
+
+/* Initialization */
+
+static void s32k1xx_initbuffers(struct s32k1xx_driver_s *priv);
+static void s32k1xx_reset(struct s32k1xx_driver_s *priv);
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+
+/****************************************************************************
+ * Function: s32k1xx_txringfull
+ *
+ * Description:
+ * Check if all of the TX descriptors are in use.
+ *
+ * Input Parameters:
+ * priv - Reference to the driver state structure
+ *
+ * Returned Value:
+ * true is the TX ring is full; false if there are free slots at the
+ * head index.
+ *
+ ****************************************************************************/
+
+static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv)
+{
+ uint8_t txnext;
+
+ /* Check if there is room in the hardware to hold another outgoing
+ * packet. The ring is full if incrementing the head pointer would
+ * collide with the tail pointer.
+ */
+
+ txnext = priv->txhead + 1;
+
+ return priv->txtail == txnext;
+}
+
+/****************************************************************************
+ * Function: s32k1xx_transmit
+ *
+ * Description:
+ * Start hardware transmission. Called either from the txdone interrupt
+ * handling or from watchdog based polling.
+ *
+ * Input Parameters:
+ * priv - Reference to the driver state structure
+ *
+ * Returned Value:
+ * OK on success; a negated errno on failure
+ *
+ * Assumptions:
+ * May or may not be called from an interrupt handler. In either case,
+ * global interrupts are disabled, either explicitly or indirectly through
+ * interrupt handling logic.
+ *
+ ****************************************************************************/
+
+
+static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
+{
+ #warning Missing logic
+
+ struct can_frame *frame = (struct can_frame*)priv->dev.d_buf;
+
+ /*printf("CAN id: %i dlc: %i", frame->can_id, frame->can_dlc);
+
+ for(int i = 0; i < frame->can_dlc; i++){
+ printf(" %02X", frame->data[i]);
+ }
+ printf("\r\n");*/
+
+ /* Attempt to write frame */
+ uint32_t mbi = 0;
+ if ((getreg32(S32K1XX_CAN0_ESR2) & (CAN_ESR2_IMB | CAN_ESR2_VPS)) == (CAN_ESR2_IMB | CAN_ESR2_VPS))
+ {
+ mbi = (getreg32(S32K1XX_CAN0_ESR2) & CAN_ESR2_LPTM_MASK) >> CAN_ESR2_LPTM_SHIFT;
+ }
+
+ uint32_t mb_bit = 1 << (NumMBinFiFoAndFilters + mbi);
+
+ while (mbi < NumTxMesgBuffers)
+ {
+
+ if (priv->tx[mbi].CS.code != CAN_TXMB_DATAORREMOTE)
+ {
+ putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
+ break;
+ }
+ mb_bit <<= 1;
+ mbi++;
+ }
+
+ if (mbi == NumTxMesgBuffers)
+ {
+ return 0; // No transmission for you!
+ }
+
+ peak_tx_mailbox_index_ = (peak_tx_mailbox_index_ > mbi ? peak_tx_mailbox_index_ : mbi );
+
+ union TXcsType cs;
+ cs.code = CAN_TXMB_DATAORREMOTE;
+ struct MbTx* mb = &priv->tx[mbi];
+ mb->CS.code = CAN_TXMB_INACTIVE;
+
+ if (0) //FIXME detect Std or Ext id
+ {
+ cs.ide = 1;
+ mb->ID.ext = frame->can_id & MaskExtID;
+ }
+ else
+ {
+ mb->ID.std = frame->can_id & MaskStdID;
+ }
+
+ //cs.rtr = frame.isRemoteTransmissionRequest();
+
+ cs.dlc = frame->can_dlc;
+ //FIXME endian swap instruction or somekind
+ mb->data.b0 = frame->data[0];
+ mb->data.b1 = frame->data[1];
+ mb->data.b2 = frame->data[2];
+ mb->data.b3 = frame->data[3];
+ mb->data.b4 = frame->data[4];
+ mb->data.b5 = frame->data[5];
+ mb->data.b6 = frame->data[6];
+ mb->data.b7 = frame->data[7];
+
+ /*
+ * Registering the pending transmission so we can track its deadline and loopback it as needed
+ */
+ /*TxItem& txi = pending_tx_[mbi];
+ txi.deadline = tx_deadline;
+ txi.frame = frame;
+ txi.loopback = (flags & uavcan::CanIOFlagLoopback) != 0;
+ txi.abort_on_error = (flags & uavcan::CanIOFlagAbortOnError) != 0;
+ txi.pending = TxItem::busy;*/
+
+ mb->CS = cs; // Go.
+
+ uint32_t regval;
+ regval = getreg32(S32K1XX_CAN0_IMASK1);
+ regval |= mb_bit;
+ putreg32(regval, S32K1XX_CAN0_IMASK1);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Function: s32k1xx_txpoll
+ *
+ * Description:
+ * The transmitter is available, check if the network has any outgoing
+ * packets ready to send. This is a callback from devif_poll().
+ * devif_poll() may be called:
+ *
+ * 1. When the preceding TX packet send is complete,
+ * 2. When the preceding TX packet send timesout and the interface is reset
+ * 3. During normal TX polling
+ *
+ * Input Parameters:
+ * dev - Reference to the NuttX driver state structure
+ *
+ * Returned Value:
+ * OK on success; a negated errno on failure
+ *
+ * Assumptions:
+ * May or may not be called from an interrupt handler. In either case,
+ * global interrupts are disabled, either explicitly or indirectly through
+ * interrupt handling logic.
+ *
+ ****************************************************************************/
+
+static int s32k1xx_txpoll(struct net_driver_s *dev)
+{
+ #warning Missing logic
+
+ FAR struct s32k1xx_driver_s *priv =
+ (FAR struct s32k1xx_driver_s *)dev->d_private;
+
+ /* If the polling resulted in data that should be sent out on the network,
+ * the field d_len is set to a value > 0.
+ */
+
+ if (priv->dev.d_len > 0)
+ {
+
+ if (!devif_loopback(&priv->dev))
+ {
+ /* Send the packet */
+
+ s32k1xx_transmit(priv);
+ /*priv->dev.d_buf =
+ (uint8_t *)s32k1xx_swap32((uint32_t)priv->txdesc[priv->txhead].data);*/
+
+ /* Check if there is room in the device to hold another packet. If
+ * not, return a non-zero value to terminate the poll.
+ */
+
+ if (s32k1xx_txringfull(priv))
+ {
+ return -EBUSY;
+ }
+ }
+ }
+
+ /* If zero is returned, the polling will continue until all connections
+ * have been examined.
+ */
+
+ return 0;
+}
+
+/****************************************************************************
+ * Function: s32k1xx_dispatch
+ *
+ * Description:
+ * A new Rx packet was received; dispatch that packet to the network layer
+ * as necessary.
+ *
+ * Input Parameters:
+ * priv - Reference to the driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Global interrupts are disabled by interrupt handling logic.
+ *
+ ****************************************************************************/
+
+static inline void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv)
+{
+
+ #warning Missing logic
+}
+
+/****************************************************************************
+ * Function: s32k1xx_receive
+ *
+ * Description:
+ * An interrupt was received indicating the availability of a new RX packet
+ *
+ * Input Parameters:
+ * priv - Reference to the driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Global interrupts are disabled by interrupt handling logic.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv)
+{
+ #warning Missing logic
+ printf("FLEXCAN: receive\r\n");
+}
+
+/****************************************************************************
+ * Function: s32k1xx_txdone
+ *
+ * Description:
+ * An interrupt was received indicating that the last TX packet(s) is done
+ *
+ * Input Parameters:
+ * priv - Reference to the driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Global interrupts are disabled by the watchdog logic.
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv)
+{
+ #warning Missing logic
+
+ uint32_t tx_iflags;
+ tx_iflags = getreg32(S32K1XX_CAN0_IFLAG1) & TXMBMask;
+
+ //FIXME process aborts
+
+ /* Process TX completions */
+
+ uint32_t mb_bit = 1 << NumMBinFiFoAndFilters;
+ for(uint32_t mbi = 0; tx_iflags && mbi < NumTxMesgBuffers; mbi++)
+ {
+ if (tx_iflags & mb_bit)
+ {
+ putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
+ tx_iflags &= ~mb_bit;
+ const bool txok = priv->tx[mbi].CS.code != CAN_TXMB_ABORT;
+ //handleTxMailboxInterrupt(mbi, txok, utc_usec);
+ }
+ mb_bit <<= 1;
+ }
+}
+
+/****************************************************************************
+ * Function: s32k1xx_flexcan_interrupt_work
+ *
+ * Description:
+ * Perform interrupt related work from the worker thread
+ *
+ * Input Parameters:
+ * arg - The argument passed when work_queue() was called.
+ *
+ * Returned Value:
+ * OK on success
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_flexcan_interrupt_work(FAR void *arg)
+{
+ #warning Missing logic
+}
+
+/****************************************************************************
+ * Function: s32k1xx_flexcan_interrupt
+ *
+ * Description:
+ * Three interrupt sources will vector this this function:
+ * 1. Ethernet MAC transmit interrupt handler
+ * 2. Ethernet MAC receive interrupt handler
+ * 3.
+ *
+ * Input Parameters:
+ * irq - Number of the IRQ that generated the interrupt
+ * context - Interrupt register state save info (architecture-specific)
+ *
+ * Returned Value:
+ * OK on success
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+
+static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
+{
+ #warning Missing logic
+
+ FAR struct s32k1xx_driver_s *priv = &g_flexcan[0];
+ uint32_t FIFO_IFLAG1 = CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV;
+ uint32_t flags;
+ flags = getreg32(S32K1XX_CAN0_IFLAG1);
+ flags &= FIFO_IFLAG1;
+
+ if(flags)
+ {
+ s32k1xx_receive(priv);
+ }
+
+ flags = getreg32(S32K1XX_CAN0_IFLAG1);
+ flags &= TXMBMask;
+
+ if(flags)
+ {
+ s32k1xx_txdone(priv);
+ }
+}
+
+/****************************************************************************
+ * Function: s32k1xx_txtimeout_work
+ *
+ * Description:
+ * Perform TX timeout related work from the worker thread
+ *
+ * Input Parameters:
+ * arg - The argument passed when work_queue() as called.
+ *
+ * Returned Value:
+ * OK on success
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static void s32k1xx_txtimeout_work(FAR void *arg)
+{
+ #warning Missing logic
+ printf("FLEXCAN: tx timeout work\r\n");
+}
+
+/****************************************************************************
+ * Function: s32k1xx_txtimeout_expiry
+ *
+ * Description:
+ * Our TX watchdog timed out. Called from the timer interrupt handler.
+ * The last TX never completed. Reset the hardware and start again.
+ *
+ * Input Parameters:
+ * argc - The number of available arguments
+ * arg - The first argument
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Global interrupts are disabled by the watchdog logic.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
+{
+ #warning Missing logic
+ printf("FLEXCAN: tx timeout expiry\r\n");
+}
+
+/****************************************************************************
+ * Function: s32k1xx_poll_work
+ *
+ * Description:
+ * Perform periodic polling from the worker thread
+ *
+ * Input Parameters:
+ * arg - The argument passed when work_queue() as called.
+ *
+ * Returned Value:
+ * OK on success
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_poll_work(FAR void *arg)
+{
+ #warning Missing logic
+ //printf("FLEXCAN: poll work\r\n");
+
+ FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
+
+ /* Check if there is there is a transmission in progress. We cannot
+ * perform the TX poll if he are unable to accept another packet for
+ * transmission.
+ */
+
+ net_lock();
+ if (1) //!s32k1xx_txringfull(priv))
+ {
+ /* If so, update TCP timing states and poll the network for new XMIT
+ * data. Hmmm.. might be bug here. Does this mean if there is a
+ * transmit in progress, we will missing TCP time state updates?
+ */
+
+ devif_timer(&priv->dev, S32K1XX_WDDELAY, s32k1xx_txpoll);
+ }
+
+ /* Setup the watchdog poll timer again in any case */
+
+ wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry,
+ 1, (wdparm_t)priv);
+ net_unlock();
+
+}
+
+/****************************************************************************
+ * Function: s32k1xx_polltimer_expiry
+ *
+ * Description:
+ * Periodic timer handler. Called from the timer interrupt handler.
+ *
+ * Input Parameters:
+ * argc - The number of available arguments
+ * arg - The first argument
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Global interrupts are disabled by the watchdog logic.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
+{
+ #warning Missing logic
+ FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
+
+ /* Schedule to perform the poll processing on the worker thread. */
+
+ work_queue(ETHWORK, &priv->pollwork, s32k1xx_poll_work, priv, 0);
+}
+
+static void s32k1xx_setfreeze(uint32_t freeze)
+{
+ uint32_t regval;
+ if(freeze)
+ {
+ /* Enter freeze mode */
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= (CAN_MCR_HALT | CAN_MCR_FRZ);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
+ else
+ {
+ /* Exit freeze mode */
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval &= ~(CAN_MCR_HALT | CAN_MCR_FRZ);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
+}
+
+static uint32_t s32k1xx_waitmcr_change(uint32_t mask, uint32_t target_state)
+{
+ const unsigned Timeout = 1000;
+ for (unsigned wait_ack = 0; wait_ack < Timeout; wait_ack++)
+ {
+ const bool state = (getreg32(S32K1XX_CAN0_MCR) & mask) != 0;
+ if (state == target_state)
+ {
+ return true;
+ }
+ up_udelay(10);
+ }
+ return false;
+}
+
+static uint32_t s32k1xx_waitfreezeack_change(uint32_t target_state)
+{
+ return s32k1xx_waitmcr_change(CAN_MCR_FRZACK, target_state);
+}
+
+
+/****************************************************************************
+ * Function: s32k1xx_ifup
+ *
+ * Description:
+ * NuttX Callback: Bring up the Ethernet interface when an IP address is
+ * provided
+ *
+ * Input Parameters:
+ * dev - Reference to the NuttX driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static int s32k1xx_ifup(struct net_driver_s *dev)
+{
+ FAR struct s32k1xx_driver_s *priv =
+ (FAR struct s32k1xx_driver_s *)dev->d_private;
+ uint32_t regval;
+
+ #warning Missing logic
+ printf("FLEXCAN: test ifup\r\n");
+
+ /* initialize CAN device */
+ //FIXME we only support a single can device for now
+
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_MDIS;
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ /* Set SYS_CLOCK src */
+ regval = getreg32(S32K1XX_CAN0_CTRL1);
+ regval |= CAN_CTRL1_CLKSRC;
+ putreg32(regval, S32K1XX_CAN0_CTRL1);
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval &= ~(CAN_MCR_MDIS);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_RFEN | CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS
+ | CAN_MCR_IRMQ | CAN_MCR_AEN |
+ (((HWMaxMB - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN | CAN_CTRL2_RFFN_16MB; //FIXME TASD
+ putreg32(regval, S32K1XX_CAN0_CTRL2);
+
+ /* Enter freeze mode */
+ s32k1xx_setfreeze(1);
+ if(!s32k1xx_waitfreezeack_change(1))
+ {
+ printf("FLEXCAN: freeze fail\r\n");
+ return -1;
+ }
+
+ /*regval = getreg32(S32K1XX_CAN0_CTRL1);
+ regval |= ((0 << CAN_CTRL1_PRESDIV_SHIFT) & CAN_CTRL1_PRESDIV_MASK)
+ | ((46 << CAN_CTRL1_ROPSEG_SHIFT) & CAN_CTRL1_ROPSEG_MASK)
+ | ((18 << CAN_CTRL1_PSEG1_SHIFT) & CAN_CTRL1_PSEG1_MASK)
+ | ((12 << CAN_CTRL1_PSEG2_SHIFT) & CAN_CTRL1_PSEG2_MASK)
+ | ((12 << CAN_CTRL1_RJW_SHIFT) & CAN_CTRL1_RJW_MASK)
+ | CAN_CTRL1_ERRMSK
+ | CAN_CTRL1_TWRNMSK
+ | CAN_CTRL1_RWRNMSK;
+
+ putreg32(regval, S32K1XX_CAN0_CTRL1);*/
+
+ /* CAN Bit Timing (CBT) configuration for a nominal phase of 1 Mbit/s
+ * with 80 time quantas,in accordance with Bosch 2012 specification,
+ * sample point at 83.75% */
+ regval = getreg32(S32K1XX_CAN0_CBT);
+ regval |= CAN_CBT_BTF | /* Enable extended bit timing configurations for CAN-FD
+ for setting up separetely nominal and data phase */
+ CAN_CBT_EPRESDIV(0) | /* Prescaler divisor factor of 1 */
+ CAN_CBT_EPROPSEG(46) | /* Propagation segment of 47 time quantas */
+ CAN_CBT_EPSEG1(18) | /* Phase buffer segment 1 of 19 time quantas */
+ CAN_CBT_EPSEG2(12) | /* Phase buffer segment 2 of 13 time quantas */
+ CAN_CBT_ERJW(12); /* Resynchronization jump width same as PSEG2 */
+ putreg32(regval, S32K1XX_CAN0_CBT);
+
+#ifdef CAN_FD
+
+ /* Enable CAN FD feature */
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_FDEN;
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ /* CAN-FD Bit Timing (FDCBT) for a data phase of 4 Mbit/s with 20 time quantas,
+ in accordance with Bosch 2012 specification, sample point at 75% */
+ regval = getreg32(S32K1XX_CAN0_FDCBT);
+ regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
+ CAN_FDCBT_FPROPSEG(7) | /* Propagation semgment of 7 time quantas
+ (only register that doesn't add 1) */
+ CAN_FDCBT_FPSEG1(6) | /* Phase buffer segment 1 of 7 time quantas */
+ CAN_FDCBT_FPSEG2(4) | /* Phase buffer segment 2 of 5 time quantas */
+ CAN_FDCBT_FRJW(4); /* Resynchorinzation jump width same as PSEG2 */
+ putreg32(regval, S32K1XX_CAN0_FDCBT);
+
+ /* Additional CAN-FD configurations */
+ regval = getreg32(S32K1XX_CAN0_FDCTRL);
+ regval |= CAN_FDCTRL_FDRATE | /* Enable bit rate switch in data phase of frame */
+ CAN_FDCTRL_TDCEN | /* Enable transceiver delay compensation */
+ CAN_FDCTRL_TDCOFF(5) | /* Setup 5 cycles for data phase sampling delay */
+ CAN_FDCTRL_MBDSR0(3); /* Setup 64 bytes per message buffer (7 MB's) */
+ putreg32(regval, S32K1XX_CAN0_FDCTRL);
+
+ regval = getreg32(S32K1XX_CAN0_CTRL2);
+ regval |= CAN_CTRL2_ISOCANFDEN;
+ putreg32(regval, S32K1XX_CAN0_CTRL2);
+#endif
+
+
+ /* Filtering catchall */
+ putreg32(0, S32K1XX_CAN0_RXFGMASK);
+
+ /* Iniatilize all MB rx and tx */
+ /*for(int i = 0; i < HWMaxMB; i++)
+ {
+ priv->rx[i].CS.cs = 0x0;
+ priv->rx[i].ID.w = 0x0;
+ priv->rx[i].data.l = 0x0;
+ priv->rx[i].data.h = 0x0;
+ }*/
+
+ //FIXME max mb
+ for(int i = 0; i < HWMaxMB; i++)
+ {
+ putreg32(0,S32K1XX_CAN0_RXIMR(i));
+ }
+
+ putreg32(0,S32K1XX_CAN0_RXIMR0);
+ putreg32(0,S32K1XX_CAN0_RXIMR1);
+ putreg32(0,S32K1XX_CAN0_RXIMR2);
+ putreg32(0,S32K1XX_CAN0_RXIMR3);
+ putreg32(0,S32K1XX_CAN0_RXIMR4);
+ putreg32(0,S32K1XX_CAN0_RXIMR5);
+ putreg32(0,S32K1XX_CAN0_RXIMR6);
+ putreg32(0,S32K1XX_CAN0_RXIMR7);
+ putreg32(0,S32K1XX_CAN0_RXIMR8);
+ putreg32(0,S32K1XX_CAN0_RXIMR9);
+ putreg32(0,S32K1XX_CAN0_RXIMR10);
+ putreg32(0,S32K1XX_CAN0_RXIMR11);
+ putreg32(0,S32K1XX_CAN0_RXIMR12);
+ putreg32(0,S32K1XX_CAN0_RXIMR13);
+ putreg32(0,S32K1XX_CAN0_RXIMR14);
+ putreg32(0,S32K1XX_CAN0_RXIMR15);
+
+ putreg32(CAN_IFLAG1(1) | TXMBMask, S32K1XX_CAN0_IFLAG1); //FIXME dynamic MXMB
+ putreg32(CAN_IFLAG1(1), S32K1XX_CAN0_IMASK1);
+
+
+ /* Exit freeze mode */
+ s32k1xx_setfreeze(0);
+ if(!s32k1xx_waitfreezeack_change(0))
+ {
+ printf("FLEXCAN: unfreeze fail\r\n");
+ return -1;
+ }
+
+
+ /* Set and activate a timer process */
+
+ wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, 1,
+ (wdparm_t)priv);
+
+ priv->bifup = true;
+
+ priv->dev.d_buf = &g_desc_pool;
+
+ /* Set interrupts */
+ up_enable_irq(S32K1XX_IRQ_CAN0_BUS);
+ up_enable_irq(S32K1XX_IRQ_CAN0_ERROR);
+ up_enable_irq(S32K1XX_IRQ_CAN0_LPRX);
+ up_enable_irq(S32K1XX_IRQ_CAN0_0_15);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Function: s32k1xx_ifdown
+ *
+ * Description:
+ * NuttX Callback: Stop the interface.
+ *
+ * Input Parameters:
+ * dev - Reference to the NuttX driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static int s32k1xx_ifdown(struct net_driver_s *dev)
+{
+ #warning Missing logic
+ return OK;
+}
+
+/****************************************************************************
+ * Function: s32k1xx_txavail_work
+ *
+ * Description:
+ * Perform an out-of-cycle poll on the worker thread.
+ *
+ * Input Parameters:
+ * arg - Reference to the NuttX driver state structure (cast to void*)
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Called on the higher priority worker thread.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_txavail_work(FAR void *arg)
+{
+ FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
+
+ /* Ignore the notification if the interface is not yet up */
+
+ net_lock();
+ if (priv->bifup)
+ {
+ /* Check if there is room in the hardware to hold another outgoing
+ * packet.
+ */
+
+ if (!s32k1xx_txringfull(priv))
+ {
+ /* No, there is space for another transfer. Poll the network for
+ * new XMIT data.
+ */
+
+ devif_poll(&priv->dev, s32k1xx_txpoll);
+ }
+ }
+
+ net_unlock();
+}
+
+/****************************************************************************
+ * Function: s32k1xx_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.
+ *
+ * Input Parameters:
+ * dev - Reference to the NuttX driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Called in normal user mode
+ *
+ ****************************************************************************/
+
+static int s32k1xx_txavail(struct net_driver_s *dev)
+{
+ FAR struct s32k1xx_driver_s *priv =
+ (FAR struct s32k1xx_driver_s *)dev->d_private;
+
+ /* Is our single work structure available? It may not be if there are
+ * pending interrupt actions and we will have to ignore the Tx
+ * availability action.
+ */
+
+ if (work_available(&priv->pollwork))
+ {
+ /* Schedule to serialize the poll on the worker thread. */
+
+ work_queue(ETHWORK, &priv->pollwork, s32k1xx_txavail_work, priv, 0);
+ }
+
+ return OK;
+}
+
+
+/****************************************************************************
+ * Function: s32k1xx_ioctl
+ *
+ * Description:
+ * PHY ioctl command handler
+ *
+ * Input Parameters:
+ * dev - Reference to the NuttX driver state structure
+ * cmd - ioctl command
+ * arg - Argument accompanying the command
+ *
+ * Returned Value:
+ * Zero (OK) on success; a negated errno value on failure.
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NETDEV_IOCTL
+static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
+ unsigned long arg)
+{
+ int ret;
+
+ switch (cmd)
+ {
+ default:
+ ret = -ENOTTY;
+ break;
+ }
+
+ return ret;
+}
+#endif /* CONFIG_NETDEV_IOCTL */
+
+
+/****************************************************************************
+ * Function: s32k1xx_initbuffers
+ *
+ * Description:
+ * Initialize FLEXCAN buffers and descriptors
+ *
+ * Input Parameters:
+ * priv - Reference to the private FLEXCAN driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static void s32k1xx_initbuffers(struct s32k1xx_driver_s *priv)
+{
+ #warning Missing logic
+}
+
+/****************************************************************************
+ * Function: s32k1xx_reset
+ *
+ * Description:
+ * Put the EMAC in the non-operational, reset state
+ *
+ * Input Parameters:
+ * priv - Reference to the private FLEXCAN driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static void s32k1xx_reset(struct s32k1xx_driver_s *priv)
+{
+ unsigned int i;
+
+ /* Set the reset bit and clear the enable bit */
+
+
+ #warning Missing logic
+
+ /* Wait at least 8 clock cycles */
+
+ for (i = 0; i < 10; i++)
+ {
+ asm volatile ("nop");
+ }
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Function: s32k1xx_netinitialize
+ *
+ * Description:
+ * Initialize the Ethernet controller and driver
+ *
+ * Input Parameters:
+ * intf - In the case where there are multiple EMACs, this value
+ * identifies which EMAC is to be initialized.
+ *
+ * Returned Value:
+ * OK on success; Negated errno on failure.
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+int s32k1xx_netinitialize(int intf)
+{
+ struct s32k1xx_driver_s *priv;
+ int ret;
+
+ //FIXME dynamic board config
+ s32k1xx_pinconfig(PIN_CAN0_TX_4);
+ s32k1xx_pinconfig(PIN_CAN0_RX_4);
+
+ priv = &g_flexcan[intf];
+
+ ninfo("initialize\r\n");
+
+ /* Get the interface structure associated with this interface number. */
+
+ #warning Missing logic
+
+
+ /* Attach the flexcan interrupt handler */
+ if (irq_attach(S32K1XX_IRQ_CAN0_BUS, s32k1xx_flexcan_interrupt, NULL))
+ {
+ /* We could not attach the ISR to the interrupt */
+
+ nerr("ERROR: Failed to attach CAN bus IRQ\n");
+ return -EAGAIN;
+ }
+ if (irq_attach(S32K1XX_IRQ_CAN0_ERROR, s32k1xx_flexcan_interrupt, NULL))
+ {
+ /* We could not attach the ISR to the interrupt */
+
+ nerr("ERROR: Failed to attach CAN error IRQ\n");
+ return -EAGAIN;
+ }
+ if (irq_attach(S32K1XX_IRQ_CAN0_LPRX, s32k1xx_flexcan_interrupt, NULL))
+ {
+ /* We could not attach the ISR to the interrupt */
+
+ nerr("ERROR: Failed to attach CAN LPRX IRQ\n");
+ return -EAGAIN;
+ }
+ if (irq_attach(S32K1XX_IRQ_CAN0_0_15, s32k1xx_flexcan_interrupt, NULL))
+ {
+ /* We could not attach the ISR to the interrupt */
+
+ nerr("ERROR: Failed to attach CAN OR'ed Message buffer (0-15) IRQ\n");
+ return -EAGAIN;
+ }
+
+ /* Initialize the driver structure */
+
+ memset(priv, 0, sizeof(struct s32k1xx_driver_s));
+ priv->dev.d_ifup = s32k1xx_ifup; /* I/F up (new IP address) callback */
+ priv->dev.d_ifdown = s32k1xx_ifdown; /* I/F down callback */
+ priv->dev.d_txavail = s32k1xx_txavail; /* New TX data callback */
+#ifdef CONFIG_NETDEV_IOCTL
+ priv->dev.d_ioctl = s32k1xx_ioctl; /* Support PHY ioctl() calls */
+#endif
+ priv->dev.d_private = (void *)g_flexcan; /* Used to recover private state from dev */
+
+ /* Create a watchdog for timing polling for and timing of transmissions */
+ priv->txpoll = wd_create(); /* Create periodic poll timer */
+ priv->txtimeout = wd_create(); /* Create TX timeout timer */
+ priv->rx = (struct MbRx *)(S32K1XX_CAN0_MB);
+ priv->tx = (struct MbTx *)(S32K1XX_CAN0_MB + (sizeof(struct MbRx)
+ * S32K1XX_FLEXCAN_FIRST_TX_MB) );
+
+ /* Put the interface in the down state. This usually amounts to resetting
+ * the device and/or calling s32k1xx_ifdown().
+ */
+
+ ninfo("callbacks done\r\n");
+
+ s32k1xx_ifdown(&priv->dev);
+
+ /* Register the device with the OS so that socket IOCTLs can be performed */
+
+ netdev_register(&priv->dev, NET_LL_CAN);
+
+ UNUSED(ret);
+ return OK;
+}
+
+/****************************************************************************
+ * Name: up_netinitialize
+ *
+ * Description:
+ * Initialize the first network interface. If there are more than one
+ * interface in the chip, then board-specific logic will have to provide
+ * this function to determine which, if any, Ethernet controllers should
+ * be initialized.
+ *
+ ****************************************************************************/
+
+//FIXME CONFIG_S32K1XX_FLEXCAN_NETHIFS == 1 &&
+
+#if !defined(CONFIG_NETDEV_LATEINIT)
+void up_netinitialize(void)
+{
+ s32k1xx_netinitialize(0);
+}
+#endif
+
+#endif /* CONFIG_S32K1XX_FLEXCAN */
diff --git a/net/devif/devif_pktsend.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.h
similarity index 54%
copy from net/devif/devif_pktsend.c
copy to arch/arm/src/s32k1xx/s32k1xx_flexcan.h
index b041b2f..9dfe681 100644
--- a/net/devif/devif_pktsend.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.h
@@ -1,7 +1,7 @@
-/****************************************************************************
- * net/devif/devif_pktsend.c
+/************************************************************************************
+ * arch/arm/src/s32k1xx/s32k1xx_flexcan.h
*
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -31,83 +31,87 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ****************************************************************************/
+ ************************************************************************************/
-/****************************************************************************
+#ifndef __ARCH_ARM_SRC_S32K1XX_S32K1XX_FLEXCAN_H
+#define __ARCH_ARM_SRC_S32K1XX_S32K1XX_FLEXCAN_H
+
+/************************************************************************************
* Included Files
- ****************************************************************************/
+ ************************************************************************************/
#include <nuttx/config.h>
-#include <string.h>
-#include <assert.h>
-#include <debug.h>
-
-#include <nuttx/net/netdev.h>
+#include "hardware/s32k1xx_flexcan.h"
-#ifdef CONFIG_NET_PKT
+#ifdef CONFIG_S32K1XX_FLEXCAN
-/****************************************************************************
+/************************************************************************************
* Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Private Type Declarations
- ****************************************************************************/
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
+ ************************************************************************************/
-/****************************************************************************
- * Public Constant Data
- ****************************************************************************/
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Constant Data
- ****************************************************************************/
+/************************************************************************************
+ * Public Functions
+ ************************************************************************************/
-/****************************************************************************
- * Private Data
- ****************************************************************************/
+#ifndef __ASSEMBLY__
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
-/****************************************************************************
- * Name: devif_pkt_send
+/************************************************************************************
+ * Function: up_netinitialize
*
* Description:
- * Called from socket logic in order to send a raw packet in response to
- * an xmit or poll request from the network interface driver.
+ * Initialize the first network interface. If there are more than one
+ * interface in the chip, then board-specific logic will have to provide
+ * this function to determine which, if any, Ethernet controllers should
+ * be initialized. Also prototyped in up_internal.h.
*
- * This is almost identical to calling devif_send() except that the data to
- * be sent is copied into dev->d_buf (vs. dev->d_appdata), since there is
- * no header on the data.
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * OK on success; Negated errno on failure.
*
* Assumptions:
- * Called with the network locked.
+ * Called very early in the initialization sequence.
*
- ****************************************************************************/
-
-void devif_pkt_send(FAR struct net_driver_s *dev, FAR const void *buf,
- unsigned int len)
-{
- DEBUGASSERT(dev && len > 0 && len < NETDEV_PKTSIZE(dev));
+ ************************************************************************************/
- /* Copy the data into the device packet buffer */
+void up_netinitialize(void);
- memcpy(dev->d_buf, buf, len);
+/************************************************************************************
+ * Function: s32k1xx_phy_boardinitialize
+ *
+ * Description:
+ * Some boards require specialized initialization of the PHY before it can be
+ * used. This may include such things as configuring GPIOs, resetting the PHY,
+ * etc. If CONFIG_S32K1XX_FLEXCAN_PHYINIT is defined in the configuration then the
+ * board specific logic must provide s32k1xx_phyinitialize(); The i.MX RT Ethernet
+ * driver will call this function one time before it first uses the PHY.
+ *
+ * Input Parameters:
+ * intf - Always zero for now.
+ *
+ * Returned Value:
+ * OK on success; Negated errno on failure.
+ *
+ ************************************************************************************/
- /* Set the number of bytes to send */
- dev->d_len = len;
- dev->d_sndlen = len;
+#undef EXTERN
+#if defined(__cplusplus)
}
+#endif
-#endif /* CONFIG_NET_PKT */
+#endif /* __ASSEMBLY__ */
+#endif /* CONFIG_S32K1XX_FLEXCAN */
+#endif /* __ARCH_ARM_SRC_S32K1XX_S32K1XX_FLEXCAN_H */
diff --git a/include/nuttx/can.h b/include/nuttx/can.h
new file mode 100644
index 0000000..fd86b74
--- /dev/null
+++ b/include/nuttx/can.h
@@ -0,0 +1,279 @@
+/************************************************************************************
+ * include/nuttx/can/can.h
+ *
+ * Copyright (C) 2008, 2009, 2011-2012, 2015-2017, 2019 Gregory Nutt. All rights
+ * reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * 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 __INCLUDE_NUTTX_CAN_CAN_H
+#define __INCLUDE_NUTTX_CAN_CAN_H
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#ifdef CONFIG_CAN_TXREADY
+# include <nuttx/wqueue.h>
+#endif
+
+#ifdef CONFIG_NET_CAN
+
+/************************************************************************************
+ * Pre-processor Definitions
+ ************************************************************************************/
+
+
+/* Ioctl Commands *******************************************************************/
+
+/* Ioctl commands supported by the upper half CAN driver.
+ *
+ * CANIOC_RTR:
+ * Description: Send the remote transmission request and wait for the response.
+ * Argument: A reference to struct canioc_rtr_s
+ *
+ * Ioctl commands that may or may not be supported by the lower half CAN driver.
+ *
+ * CANIOC_ADD_STDFILTER:
+ * Description: Add an address filter for a standard 11 bit address.
+ * Argument: A reference to struct canioc_stdfilter_s
+ * Returned Value: A non-negative filter ID is returned on success.
+ * Otherwise -1 (ERROR) is returned with the errno
+ * variable set to indicate the nature of the error.
+ * Dependencies: None
+ *
+ * CANIOC_ADD_EXTFILTER:
+ * Description: Add an address filter for a extended 29 bit address.
+ * Argument: A reference to struct canioc_extfilter_s
+ * Returned Value: A non-negative filter ID is returned on success.
+ * Otherwise -1 (ERROR) is returned with the errno
+ * variable set to indicate the nature of the error.
+ * Dependencies: Requires CONFIG_CAN_EXTID=y
+ *
+ * CANIOC_DEL_STDFILTER:
+ * Description: Remove an address filter for a standard 11 bit address.
+ * Argument: The filter index previously returned by the
+ * CANIOC_ADD_STDFILTER command
+ * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
+ * is returned with the errno variable set to indicate the
+ * nature of the error.
+ * Dependencies: None
+ *
+ * CANIOC_DEL_EXTFILTER:
+ * Description: Remove an address filter for a standard 29 bit address.
+ * Argument: The filter index previously returned by the
+ * CANIOC_ADD_EXTFILTER command
+ * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
+ * is returned with the errno variable set to indicate the
+ * nature of the error.
+ * Dependencies: Requires CONFIG_CAN_EXTID=y
+ *
+ * CANIOC_GET_BITTIMING:
+ * Description: Return the current bit timing settings
+ * Argument: A pointer to a write-able instance of struct
+ * canioc_bittiming_s in which current bit timing values
+ * will be returned.
+ * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
+ * is returned with the errno variable set to indicate the
+ * nature of the error.
+ * Dependencies: None
+ *
+ * CANIOC_SET_BITTIMING:
+ * Description: Set new current bit timing values
+ * Argument: A pointer to a read-able instance of struct
+ * canioc_bittiming_s in which the new bit timing values
+ * are provided.
+ * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
+ * is returned with the errno variable set to indicate the
+ * nature of the error.
+ * Dependencies: None
+ *
+ * CANIOC_GET_CONNMODES:
+ * Description: Get the current bus connection modes
+ * Argument: A pointer to a write-able instance of struct
+ * canioc_connmodes_s in which the new bus modes will be returned.
+ * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
+ * is returned with the errno variable set to indicate the
+ * nature of the error.
+ * Dependencies: None
+ *
+ * CANIOC_SET_CONNMODES:
+ * Description: Set new bus connection modes values
+ * Argument: A pointer to a read-able instance of struct
+ * canioc_connmodes_s in which the new bus modes are provided.
+ * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
+ * is returned with the errno variable set to indicate the
+ * nature of the error.
+ * Dependencies: None
+ *
+ * CANIOC_BUSOFF_RECOVERY:
+ * Description: Initiates the BUS-OFF recovery sequence
+ * Argument: None
+ * Returned Value: Zero (OK) is returned on success. Otherwise -1 (ERROR)
+ * is returned with the errno variable set to indicate the
+ * nature of the error.
+ * Dependencies: None
+ */
+
+#define CANIOC_RTR _CANIOC(1)
+#define CANIOC_GET_BITTIMING _CANIOC(2)
+#define CANIOC_SET_BITTIMING _CANIOC(3)
+#define CANIOC_ADD_STDFILTER _CANIOC(4)
+#define CANIOC_ADD_EXTFILTER _CANIOC(5)
+#define CANIOC_DEL_STDFILTER _CANIOC(6)
+#define CANIOC_DEL_EXTFILTER _CANIOC(7)
+#define CANIOC_GET_CONNMODES _CANIOC(8)
+#define CANIOC_SET_CONNMODES _CANIOC(9)
+#define CANIOC_BUSOFF_RECOVERY _CANIOC(10)
+
+#define CAN_FIRST 0x0001 /* First common command */
+#define CAN_NCMDS 10 /* Ten common commands */
+
+/* User defined ioctl commands are also supported. These will be forwarded
+ * by the upper-half CAN driver to the lower-half CAN driver via the co_ioctl()
+ * method fo the CAN lower-half interface. However, the lower-half driver
+ * must reserve a block of commands as follows in order prevent IOCTL
+ * command numbers from overlapping.
+ *
+ * This is generally done as follows. The first reservation for CAN driver A would
+ * look like:
+ *
+ * CAN_A_FIRST (CAN_FIRST + CAN_NCMDS) <- First command
+ * CAN_A_NCMDS 42 <- Number of commands
+ *
+ * IOCTL commands for CAN driver A would then be defined in a CAN A header file like:
+ *
+ * CANIOC_A_CMD1 _CANIOC(CAN_A_FIRST+0)
+ * CANIOC_A_CMD2 _CANIOC(CAN_A_FIRST+1)
+ * CANIOC_A_CMD3 _CANIOC(CAN_A_FIRST+2)
+ * ...
+ * CANIOC_A_CMD42 _CANIOC(CAN_A_FIRST+41)
+ *
+ * The next reservation would look like:
+ *
+ * CAN_B_FIRST (CAN_A_FIRST + CAN_A_NCMDS) <- Next command
+ * CAN_B_NCMDS 77 <- Number of commands
+ */
+
+/************************************************************************************
+ * Public Types
+ ************************************************************************************/
+
+typedef uint32_t canid_t;
+
+/* CAN payload length and DLC definitions according to ISO 11898-1 */
+#define CAN_MAX_DLC 8
+#define CAN_MAX_DLEN 8
+
+/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
+#define CANFD_MAX_DLC 15
+#define CANFD_MAX_DLEN 64
+
+
+/**
+ * struct can_frame - basic CAN frame structure
+ * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
+ * @can_dlc: frame payload length in byte (0 .. 8) aka data length code
+ * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
+ * mapping of the 'data length code' to the real payload length
+ * @__pad: padding
+ * @__res0: reserved / padding
+ * @__res1: reserved / padding
+ * @data: CAN frame payload (up to 8 byte)
+ */
+struct can_frame {
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ uint8_t can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
+ uint8_t __pad; /* padding */
+ uint8_t __res0; /* reserved / padding */
+ uint8_t __res1; /* reserved / padding */
+ uint8_t data[CAN_MAX_DLEN] __attribute__((aligned(8)));
+};
+
+/*
+ * defined bits for canfd_frame.flags
+ *
+ * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
+ * be set in the CAN frame bitstream on the wire. The EDL bit switch turns
+ * the CAN controllers bitstream processor into the CAN FD mode which creates
+ * two new options within the CAN FD frame specification:
+ *
+ * Bit Rate Switch - to indicate a second bitrate is/was used for the payload
+ * Error State Indicator - represents the error state of the transmitting node
+ *
+ * As the CANFD_ESI bit is internally generated by the transmitting CAN
+ * controller only the CANFD_BRS bit is relevant for real CAN controllers when
+ * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
+ * sense for virtual CAN interfaces to test applications with echoed frames.
+ */
+#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
+#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
+
+/**
+ * struct canfd_frame - CAN flexible data rate frame structure
+ * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
+ * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
+ * @flags: additional flags for CAN FD
+ * @__res0: reserved / padding
+ * @__res1: reserved / padding
+ * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
+ */
+struct canfd_frame {
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ uint8_t len; /* frame payload length in byte */
+ uint8_t flags; /* additional flags for CAN FD */
+ uint8_t __res0; /* reserved / padding */
+ uint8_t __res1; /* reserved / padding */
+ uint8_t data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
+};
+
+
+/************************************************************************************
+ * Public Function Prototypes
+ ************************************************************************************/
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* CONFIG_CAN */
+#endif /* __INCLUDE_NUTTX_CAN_CAN_H */
diff --git a/include/nuttx/net/can.h b/include/nuttx/net/can.h
new file mode 100644
index 0000000..d426c7b
--- /dev/null
+++ b/include/nuttx/net/can.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+ * include/nuttx/net/ethernt.h
+ * Macros and definitions for the Ethernet link layer.
+ *
+ * Copyright (C) 2007, 2009-2012, 2015 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Derived from uIP with has a similar BSD-styple license:
+ *
+ * Author: Adam Dunkels <ad...@dunkels.com>
+ * Copyright (c) 2001-2003, Adam Dunkels.
+ * All rights reserved.
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_NET_CAN_H
+#define __INCLUDE_NUTTX_NET_CAN_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/can.h>
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define CAN_HDRLEN 4 //FIXME standard id vs extended
+#define NET_CAN_PKTSIZE sizeof(struct canfd_frame) // max size we can send through socket
+//FIXME think about can & canfd support
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __INCLUDE_NUTTX_NET_CAN_H */
diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 8218c0c..8c11db7 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -155,7 +155,8 @@ enum net_lltype_e
NET_LL_BLUETOOTH, /* Bluetooth */
NET_LL_IEEE80211, /* IEEE 802.11 */
NET_LL_IEEE802154, /* IEEE 802.15.4 MAC */
- NET_LL_PKTRADIO /* Non-standard packet radio */
+ NET_LL_PKTRADIO, /* Non-standard packet radio */
+ NET_LL_CAN /* CAN bus */
};
/* This defines a bitmap big enough for one bit for each socket option */
diff --git a/net/can/Make.defs b/net/can/Make.defs
index bb9ef9f..f8488c0 100644
--- a/net/can/Make.defs
+++ b/net/can/Make.defs
@@ -22,8 +22,14 @@
ifeq ($(CONFIG_NET_CAN),y)
+# Socket layer
+
SOCK_CSRCS += can_sockif.c
+SOCK_CSRCS += can_send.c
+
NET_CSRCS += can_conn.c
+NET_CSRCS += can_poll.c
+NET_CSRCS += can_callback.c
# Include can build support
diff --git a/net/can/can.h b/net/can/can.h
index 6f41ce9..3fed49b 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -32,6 +32,7 @@
#include <netpacket/can.h>
#include <nuttx/semaphore.h>
+#include <nuttx/net/netdev.h>
#include "devif/devif.h"
#include "socket/socket.h"
@@ -39,6 +40,17 @@
#ifdef CONFIG_NET_CAN
/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Allocate a new packet socket data callback */
+
+#define can_callback_alloc(dev,conn) \
+ devif_callback_alloc(dev, &conn->list)
+#define can_callback_free(dev,conn,cb) \
+ devif_conn_callback_free(dev, cb, &conn->list)
+
+/****************************************************************************
* Public Type Definitions
****************************************************************************/
@@ -57,6 +69,8 @@ struct can_conn_s
FAR struct devif_callback_s *list; /* NetLink callbacks */
+ FAR struct net_driver_s *dev; /* Reference to CAN device */
+
/* CAN-specific content follows */
uint8_t protocol; /* Selected CAN protocol */
@@ -135,6 +149,43 @@ void can_free(FAR struct can_conn_s *conn);
FAR struct can_conn_s *can_nextconn(FAR struct can_conn_s *conn);
/****************************************************************************
+ * Name: can_callback
+ *
+ * Description:
+ * Inform the application holding the packet socket of a change in state.
+ *
+ * Returned Value:
+ * OK if packet has been processed, otherwise ERROR.
+ *
+ * Assumptions:
+ * This function is called from network logic at with the network locked.
+ *
+ ****************************************************************************/
+
+uint16_t can_callback(FAR struct net_driver_s *dev,
+ FAR struct can_conn_s *conn, uint16_t flags);
+
+/****************************************************************************
+ * Name: can_poll
+ *
+ * Description:
+ * Poll a CAN connection structure for availability of TX data
+ *
+ * Input Parameters:
+ * dev - The device driver structure to use in the send operation
+ * conn - The CAN "connection" to poll for TX data
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Called from network stack logic with the network stack locked
+ *
+ ****************************************************************************/
+
+void can_poll(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn);
+
+/****************************************************************************
* Name: can_active()
*
* Description:
@@ -145,6 +196,30 @@ FAR struct can_conn_s *can_nextconn(FAR struct can_conn_s *conn);
FAR struct can_conn_s *can_active(FAR struct sockaddr_can *addr);
+/****************************************************************************
+ * Name: psock_can_send
+ *
+ * Description:
+ * The psock_can_send() call may be used only when the packet socket is in
+ * a connected state (so that the intended recipient is known).
+ *
+ * Input Parameters:
+ * psock An instance of the internal socket structure.
+ * buf Data to send
+ * len Length of data to send
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. On error,
+ * a negated errno value is returned. See send() for the complete list
+ * of return values.
+ *
+ ****************************************************************************/
+
+struct socket;
+ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
+ size_t len);
+
+
#undef EXTERN
#ifdef __cplusplus
}
diff --git a/net/devif/devif_pktsend.c b/net/can/can_callback.c
similarity index 53%
copy from net/devif/devif_pktsend.c
copy to net/can/can_callback.c
index b041b2f..2fad951 100644
--- a/net/devif/devif_pktsend.c
+++ b/net/can/can_callback.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * net/devif/devif_pktsend.c
+ * net/pkt/pkt_callback.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
@@ -38,76 +38,48 @@
****************************************************************************/
#include <nuttx/config.h>
+#if defined(CONFIG_NET) && defined(CONFIG_NET_CAN)
-#include <string.h>
-#include <assert.h>
+#include <stdint.h>
#include <debug.h>
+#include <nuttx/net/netconfig.h>
#include <nuttx/net/netdev.h>
-#ifdef CONFIG_NET_PKT
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Private Type Declarations
- ****************************************************************************/
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-/****************************************************************************
- * Public Constant Data
- ****************************************************************************/
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Constant Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
+#include "devif/devif.h"
+#include "can/can.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
- * Name: devif_pkt_send
+ * Name: can_callback
*
* Description:
- * Called from socket logic in order to send a raw packet in response to
- * an xmit or poll request from the network interface driver.
+ * Inform the application holding the packet socket of a change in state.
*
- * This is almost identical to calling devif_send() except that the data to
- * be sent is copied into dev->d_buf (vs. dev->d_appdata), since there is
- * no header on the data.
+ * Returned Value:
+ * OK if packet has been processed, otherwise ERROR.
*
* Assumptions:
- * Called with the network locked.
+ * This function is called with the network locked.
*
****************************************************************************/
-void devif_pkt_send(FAR struct net_driver_s *dev, FAR const void *buf,
- unsigned int len)
+uint16_t can_callback(FAR struct net_driver_s *dev,
+ FAR struct can_conn_s *conn, uint16_t flags)
{
- DEBUGASSERT(dev && len > 0 && len < NETDEV_PKTSIZE(dev));
-
- /* Copy the data into the device packet buffer */
+ /* Some sanity checking */
- memcpy(dev->d_buf, buf, len);
+ if (conn)
+ {
+ /* Perform the callback */
- /* Set the number of bytes to send */
+ flags = devif_conn_event(dev, conn, flags, conn->list);
+ }
- dev->d_len = len;
- dev->d_sndlen = len;
+ return flags;
}
-#endif /* CONFIG_NET_PKT */
+#endif /* CONFIG_NET && CONFIG_NET_CAN */
diff --git a/net/can/can_poll.c b/net/can/can_poll.c
new file mode 100644
index 0000000..84aeeab
--- /dev/null
+++ b/net/can/can_poll.c
@@ -0,0 +1,107 @@
+/****************************************************************************
+ * net/pkt/pkt_poll.c
+ * Poll for the availability of packet TX data
+ *
+ * Copyright (C) 2014 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Adapted for NuttX from logic in uIP which also has a BSD-like license:
+ *
+ * Original author Adam Dunkels <ad...@dunkels.com>
+ * Copyright () 2001-2003, Adam Dunkels.
+ * All rights reserved.
+ *
+ * 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 <nuttx/config.h>
+#if defined(CONFIG_NET) && defined(CONFIG_NET_CAN)
+
+#include <debug.h>
+
+#include <nuttx/net/netconfig.h>
+#include <nuttx/net/netdev.h>
+
+#include "devif/devif.h"
+#include "can/can.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: can_poll
+ *
+ * Description:
+ * Poll a packet "connection" structure for availability of TX data
+ *
+ * Input Parameters:
+ * dev - The device driver structure to use in the send operation
+ * conn - The packet "connection" to poll for TX data
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+void can_poll(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn)
+{
+ /* Verify that the packet connection is valid */
+
+ if (conn != NULL)
+ {
+ /* Setup for the application callback */
+
+ dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev)];
+ dev->d_len = 0;
+ dev->d_sndlen = 0;
+
+ /* Perform the application callback */
+
+ can_callback(dev, conn, CAN_POLL);
+
+ /* Check if the application has data to send */
+
+ if (dev->d_sndlen > 0)
+ {
+ return;
+ }
+ }
+
+ /* Make sure that d_len is zero meaning that there is nothing to be sent */
+
+ dev->d_len = 0;
+}
+
+#endif /* CONFIG_NET && CONFIG_NET_CAN */
diff --git a/net/can/can_send.c b/net/can/can_send.c
new file mode 100644
index 0000000..6b7a609
--- /dev/null
+++ b/net/can/can_send.c
@@ -0,0 +1,264 @@
+/****************************************************************************
+ * net/can/can_send.c
+ *
+ * Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * 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 <nuttx/config.h>
+#if defined(CONFIG_NET) && defined(CONFIG_NET_CAN)
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <arch/irq.h>
+
+#include <nuttx/semaphore.h>
+#include <nuttx/net/netdev.h>
+#include <nuttx/net/net.h>
+#include <nuttx/net/ip.h>
+
+#include "netdev/netdev.h"
+#include "devif/devif.h"
+#include "socket/socket.h"
+#include "can/can.h"
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/* This structure holds the state of the send operation until it can be
+ * operated upon by the event handler.
+ */
+
+struct send_s
+{
+ FAR struct socket *snd_sock; /* Points to the parent socket structure */
+ FAR struct devif_callback_s *snd_cb; /* Reference to callback instance */
+ sem_t snd_sem; /* Used to wake up the waiting thread */
+ FAR const uint8_t *snd_buffer; /* Points to the buffer of data to send */
+ size_t snd_buflen; /* Number of bytes in the buffer to send */
+ ssize_t snd_sent; /* The number of bytes sent */
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: psock_send_eventhandler
+ ****************************************************************************/
+
+static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
+ FAR void *pvconn,
+ FAR void *pvpriv, uint16_t flags)
+{
+ FAR struct send_s *pstate = (FAR struct send_s *)pvpriv;
+
+ if (pstate)
+ {
+ /* Check if the outgoing packet is available. It may have been claimed
+ * by a send event handler 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.
+ */
+
+ if (dev->d_sndlen > 0 || (flags & CAN_NEWDATA) != 0)
+ {
+ /* Another thread has beat us sending data or the buffer is busy,
+ * Check for a timeout. If not timed out, wait for the next
+ * polling cycle and check again.
+ */
+
+ /* No timeout. Just wait for the next polling cycle */
+
+ return flags;
+ }
+
+ /* It looks like we are good to send the data */
+
+ else
+ {
+ /* Copy the packet data into the device packet buffer and send it */
+ //FIXME potentialy wrong function do we have a header??
+ devif_pkt_send(dev, pstate->snd_buffer, pstate->snd_buflen);
+ pstate->snd_sent = pstate->snd_buflen;
+ }
+
+ /* Don't allow any further call backs. */
+
+ pstate->snd_cb->flags = 0;
+ pstate->snd_cb->priv = NULL;
+ pstate->snd_cb->event = NULL;
+
+ /* Wake up the waiting thread */
+
+ nxsem_post(&pstate->snd_sem);
+ }
+
+ return flags;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: psock_can_send
+ *
+ * Description:
+ * The psock_can_send() call may be used only when the packet socket is in
+ * a connected state (so that the intended recipient is known).
+ *
+ * Input Parameters:
+ * psock An instance of the internal socket structure.
+ * buf Data to send
+ * len Length of data to send
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. On error,
+ * a negated errno value is retruend. See send() for the complete list
+ * of return values.
+ *
+ ****************************************************************************/
+
+ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
+ size_t len)
+{
+ FAR struct net_driver_s *dev;
+ FAR struct can_conn_s *conn;
+ struct send_s state;
+ int ret = OK;
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+
+ /* Verify that the sockfd corresponds to valid, allocated socket */
+
+ if (!psock || psock->s_crefs <= 0)
+ {
+ return -EBADF;
+ }
+
+ /* Get the device driver that will service this transfer */
+
+ dev = conn->dev;
+ if (dev == NULL)
+ {
+ return -ENODEV;
+ }
+
+ /* Perform the send operation */
+
+ /* Initialize the state structure. This is done with the network locked
+ * because we don't want anything to happen until we are ready.
+ */
+
+ net_lock();
+ memset(&state, 0, sizeof(struct send_s));
+
+ /* This semaphore is used for signaling and, hence, should not have
+ * priority inheritance enabled.
+ */
+
+ nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */
+ nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE);
+
+ state.snd_sock = psock; /* Socket descriptor to use */
+ state.snd_buflen = len; /* Number of bytes to send */
+ state.snd_buffer = buf; /* Buffer to send from */
+
+ if (len > 0)
+ {
+ /* Allocate resource to receive a callback */
+
+ state.snd_cb = can_callback_alloc(dev, conn);
+ if (state.snd_cb)
+ {
+ /* Set up the callback in the connection */
+
+ state.snd_cb->flags = CAN_POLL;
+ state.snd_cb->priv = (FAR void *)&state;
+ state.snd_cb->event = psock_send_eventhandler;
+
+ /* Notify the device driver that new TX data is available. */
+
+ netdev_txnotify_dev(dev);
+
+ /* Wait for the send to complete or an error to occur.
+ * net_lockedwait will also terminate if a signal is received.
+ */
+
+ ret = net_lockedwait(&state.snd_sem);
+
+ /* Make sure that no further events are processed */
+
+ can_callback_free(dev, conn, state.snd_cb);
+ }
+ }
+
+ nxsem_destroy(&state.snd_sem);
+ net_unlock();
+
+ /* Check for a errors, Errors are signalled by negative errno values
+ * for the send length
+ */
+
+ if (state.snd_sent < 0)
+ {
+ return state.snd_sent;
+ }
+
+ /* If net_lockedwait failed, then we were probably reawakened by a signal.
+ * In this case, net_lockedwait will have returned negated errno
+ * appropriately.
+ */
+
+ if (ret < 0)
+ {
+ return ret;
+ }
+
+ /* Return the number of bytes actually sent */
+
+ return state.snd_sent;
+}
+
+#endif /* CONFIG_NET && CONFIG_NET_CAN */
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index b7e3fe6..1de95d9 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -40,6 +40,7 @@
#include <nuttx/net/net.h>
#include "can/can.h"
+#include "netdev/netdev.h"
#ifdef CONFIG_NET_CAN
@@ -61,7 +62,7 @@ static int can_connect(FAR struct socket *psock,
FAR const struct sockaddr *addr, socklen_t addrlen);
static int can_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
FAR socklen_t *addrlen, FAR struct socket *newsock);
-static int can_poll(FAR struct socket *psock, FAR struct pollfd *fds,
+static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
bool setup);
static ssize_t can_send(FAR struct socket *psock,
FAR const void *buf, size_t len, int flags);
@@ -88,7 +89,7 @@ const struct sock_intf_s g_can_sockif =
can_listen, /* si_listen */
can_connect, /* si_connect */
can_accept, /* si_accept */
- can_poll, /* si_poll */
+ can_poll_local, /* si_poll */
can_send, /* si_send */
can_sendto, /* si_sendto */
#ifdef CONFIG_NET_SENDFILE
@@ -272,7 +273,15 @@ static int can_bind(FAR struct socket *psock,
canaddr = (FAR struct sockaddr_can *)addr;
conn = (FAR struct can_conn_s *)psock->s_conn;
-#warning Missing logic
+
+ /* Bind CAN device to socket */
+
+ //TODO better support for CONFIG_NETDEV_IFINDEX
+ char netdev_name[6];
+
+ sprintf(netdev_name, "can%i", canaddr->can_ifindex);
+
+ conn->dev = netdev_findbyname(&netdev_name);
return OK;
}
@@ -473,7 +482,7 @@ static int can_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
}
/****************************************************************************
- * Name: can_poll
+ * Name: can_poll_local
*
* Description:
* The standard poll() operation redirects operations on socket descriptors
@@ -495,7 +504,7 @@ static int can_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
*
****************************************************************************/
-static int can_poll(FAR struct socket *psock, FAR struct pollfd *fds,
+static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
bool setup)
{
FAR struct can_conn_s *conn;
@@ -621,36 +630,25 @@ static int can_poll(FAR struct socket *psock, FAR struct pollfd *fds,
static ssize_t can_send(FAR struct socket *psock, FAR const void *buf,
size_t len, int flags)
{
- DEBUGASSERT(psock != NULL && psock->s_conn != NULL && buf != NULL);
-
- /* The socket must be connected in order to use send */
-
- if (_SS_ISBOUND(psock->s_flags))
- {
- FAR struct can_conn_s *conn;
- struct sockaddr_can canaddr;
-
- /* Get the underlying connection structure */
+ ssize_t ret;
- conn = (FAR struct can_conn_s *)psock->s_conn;
+ /* Only SOCK_RAW is supported */
- /* Format the address */
-
- canaddr.can_family = AF_CAN;
-#warning Missing logic
+ if (psock->s_type == SOCK_RAW)
+ {
+ /* Raw packet send */
+ ret = psock_can_send(psock, buf, len);
+ }
+ else
+ {
+ /* EDESTADDRREQ. Signifies that the socket is not connection-mode and
+ * no peer address is set.
+ */
- /* Then let sendto() perform the actual send operation */
-
- return can_sendto(psock, buf, len, flags,
- (FAR const struct sockaddr *)&canaddr,
- sizeof(struct sockaddr_can));
- }
-
- /* EDESTADDRREQ. Signifies that the socket is not connection-mode and no
- * peer address is set.
- */
+ ret = -EDESTADDRREQ;
+ }
- return -EDESTADDRREQ;
+ return ret;
}
/****************************************************************************
@@ -681,25 +679,8 @@ static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
size_t len, int flags,
FAR const struct sockaddr *to, socklen_t tolen)
{
- FAR struct can_conn_s *conn;
- int ret;
-
- DEBUGASSERT(psock != NULL && psock->s_conn != NULL && buf != NULL &&
- to != NULL && tolen >= sizeof(struct sockaddr_can));
-
- conn = (FAR struct can_conn_s *)psock->s_conn;
-#warning Missing logic
-
- switch (conn->protocol)
- {
-#warning Missing logic
-
- default:
- ret = -EOPNOTSUPP;
- break;
- }
-
- return ret;
+ nerr("ERROR: sendto() not supported for raw packet sockets\n");
+ return -EAFNOSUPPORT;
}
/****************************************************************************
diff --git a/net/devif/Make.defs b/net/devif/Make.defs
index 714a0ce..b2dca4a 100644
--- a/net/devif/Make.defs
+++ b/net/devif/Make.defs
@@ -62,7 +62,7 @@ endif
# Raw packet socket support
-ifeq ($(CONFIG_NET_PKT),y)
+ifeq ($(filter y,$(CONFIG_NET_PKT) $(CONFIG_NET_CAN)),)
NET_CSRCS += devif_pktsend.c
endif
diff --git a/net/devif/devif.h b/net/devif/devif.h
index cbe1a00..c54a68d 100644
--- a/net/devif/devif.h
+++ b/net/devif/devif.h
@@ -168,6 +168,7 @@
#define BLUETOOTH_NEWDATA TCP_NEWDATA
#define IEEE802154_NEWDATA TCP_NEWDATA
#define PKT_NEWDATA TCP_NEWDATA
+#define CAN_NEWDATA TCP_NEWDATA
#define WPAN_NEWDATA TCP_NEWDATA
#define IPFWD_NEWDATA TCP_NEWDATA
#define TCP_SNDACK (1 << 2)
@@ -175,6 +176,7 @@
#define TCP_POLL (1 << 4)
#define UDP_POLL TCP_POLL
#define PKT_POLL TCP_POLL
+#define CAN_POLL TCP_POLL
#define BLUETOOTH_POLL TCP_POLL
#define IEEE802154_POLL TCP_POLL
#define WPAN_POLL TCP_POLL
@@ -492,7 +494,7 @@ void devif_iob_send(FAR struct net_driver_s *dev, FAR struct iob_s *buf,
*
****************************************************************************/
-#ifdef CONFIG_NET_PKT
+#if defined(CONFIG_NET_PKT) || defined(CONFIG_NET_CAN)
void devif_pkt_send(FAR struct net_driver_s *dev, FAR const void *buf,
unsigned int len);
#endif
diff --git a/net/devif/devif_pktsend.c b/net/devif/devif_pktsend.c
index b041b2f..a5d0515 100644
--- a/net/devif/devif_pktsend.c
+++ b/net/devif/devif_pktsend.c
@@ -45,7 +45,7 @@
#include <nuttx/net/netdev.h>
-#ifdef CONFIG_NET_PKT
+#if defined(CONFIG_NET_PKT) || defined(CONFIG_NET_CAN)
/****************************************************************************
* Pre-processor Definitions
diff --git a/net/devif/devif_poll.c b/net/devif/devif_poll.c
index 7c4fd04..e997a6f 100644
--- a/net/devif/devif_poll.c
+++ b/net/devif/devif_poll.c
@@ -50,6 +50,7 @@
#include "devif/devif.h"
#include "arp/arp.h"
+#include "can/can.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
#include "pkt/pkt.h"
@@ -233,6 +234,46 @@ static int devif_poll_pkt_connections(FAR struct net_driver_s *dev,
#endif /* CONFIG_NET_PKT */
/****************************************************************************
+ * Name: devif_poll_pkt_connections
+ *
+ * Description:
+ * Poll all packet connections for available packets to send.
+ *
+ * Assumptions:
+ * This function is called from the MAC device driver with the network
+ * locked.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NET_CAN
+static int devif_poll_can_connections(FAR struct net_driver_s *dev,
+ devif_poll_callback_t callback)
+{
+ FAR struct can_conn_s *can_conn = NULL;
+ int bstop = 0;
+
+ /* Traverse all of the allocated packet connections and perform the poll action */
+
+ while (!bstop && (can_conn = can_nextconn(can_conn)))
+ {
+ /* Perform the packet TX poll */
+
+ can_poll(dev, can_conn);
+
+ /* Perform any necessary conversions on outgoing packets */
+
+ devif_packet_conversion(dev, DEVIF_CAN);
+
+ /* Call back into the driver */
+
+ bstop = callback(dev);
+ }
+
+ return bstop;
+}
+#endif /* CONFIG_NET_PKT */
+
+/****************************************************************************
* Name: devif_poll_bluetooth_connections
*
* Description:
@@ -646,6 +687,14 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
if (!bstop)
#endif
+#ifdef CONFIG_NET_CAN
+ {
+ /* Check for pending packet socket transfer */
+ bstop = devif_poll_can_connections(dev, callback);
+ }
+
+ if (!bstop)
+#endif
#ifdef CONFIG_NET_BLUETOOTH
{
/* Check for pending PF_BLUETOOTH socket transfer */
diff --git a/net/local/local_sendpacket.c b/net/local/local_sendpacket.c
index 68dfac6..644dd31 100644
--- a/net/local/local_sendpacket.c
+++ b/net/local/local_sendpacket.c
@@ -47,6 +47,7 @@
#include <debug.h>
#include <nuttx/fs/fs.h>
+#include "devif/devif.h"
#include "local/local.h"
diff --git a/net/netdev/netdev_register.c b/net/netdev/netdev_register.c
index 85483dc..fc4634b 100644
--- a/net/netdev/netdev_register.c
+++ b/net/netdev/netdev_register.c
@@ -37,6 +37,7 @@
#include <nuttx/net/netdev.h>
#include <nuttx/net/ethernet.h>
#include <nuttx/net/bluetooth.h>
+#include <nuttx/net/can.h>
#include "utils/utils.h"
#include "igmp/igmp.h"
@@ -55,6 +56,7 @@
#define NETDEV_PAN_FORMAT "pan%d"
#define NETDEV_WLAN_FORMAT "wlan%d"
#define NETDEV_WPAN_FORMAT "wpan%d"
+#define NETDEV_CAN_FORMAT "can%d"
#if defined(CONFIG_DRIVERS_IEEE80211) /* Usually also has CONFIG_NET_ETHERNET */
# define NETDEV_DEFAULT_FORMAT NETDEV_WLAN_FORMAT
@@ -66,6 +68,8 @@
# define NETDEV_DEFAULT_FORMAT NETDEV_SLIP_FORMAT
#elif defined(CONFIG_NET_TUN)
# define NETDEV_DEFAULT_FORMAT NETDEV_TUN_FORMAT
+#elif defined(CONFIG_NET_CAN)
+# define NETDEV_DEFAULT_FORMAT NETDEV_CAN_FORMAT
#else /* if defined(CONFIG_NET_LOOPBACK) */
# define NETDEV_DEFAULT_FORMAT NETDEV_LO_FORMAT
#endif
@@ -276,6 +280,14 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
break;
#endif
+#ifdef CONFIG_NET_CAN
+ case NET_LL_CAN: /* CAN bus */
+ dev->d_llhdrlen = 0;
+ dev->d_pktsize = NET_CAN_PKTSIZE;
+ devfmt = NETDEV_CAN_FORMAT;
+ break;
+#endif
+
#ifdef CONFIG_NET_BLUETOOTH
case NET_LL_BLUETOOTH: /* Bluetooth */
llhdrlen = BLUETOOTH_MAX_HDRLEN; /* Determined at runtime */
[incubator-nuttx] 26/31: Code style fixes 4
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit c9844c2d3f641910880ad2d9e90734c26133d3ec
Author: Jari van Ewijk <ja...@nxp.com>
AuthorDate: Mon Mar 16 09:03:03 2020 +0100
Code style fixes 4
---
include/nuttx/net/net.h | 12 +++---
net/can/can_setsockopt.c | 40 +++++++++++-------
net/devif/devif.h | 87 ++++++++++++++++++++------------------
net/devif/devif_poll.c | 37 +++++++++-------
net/icmp/icmp_sockif.c | 14 +++---
net/icmpv6/icmpv6_sockif.c | 28 ++++++------
net/ieee802154/ieee802154_sockif.c | 47 +++++++++++---------
net/local/local_sockif.c | 8 ++--
net/netlink/netlink_sockif.c | 15 +++++++
net/socket/recvmsg.c | 44 ++++++++++---------
net/socket/sendmsg.c | 43 ++++++++++---------
net/socket/setsockopt.c | 3 +-
12 files changed, 216 insertions(+), 162 deletions(-)
diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 055c865..47de1f8 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -215,9 +215,11 @@ struct sock_intf_s
CODE ssize_t (*si_recvfrom)(FAR struct socket *psock, FAR void *buf,
size_t len, int flags, FAR struct sockaddr *from,
FAR socklen_t *fromlen);
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
CODE ssize_t (*si_recvmsg)(FAR struct socket *psock,
- FAR struct msghdr *msg, int flags);
+ FAR struct msghdr *msg, int flags);
+ CODE ssize_t (*si_sendmsg)(FAR struct socket *psock,
+ FAR struct msghdr *msg, int flags);
#endif
CODE int (*si_close)(FAR struct socket *psock);
#ifdef CONFIG_NET_USRSOCK
@@ -507,9 +509,9 @@ FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid);
* Description:
* Check if the socket descriptor is valid for the provided TCB and if it
* supports the requested access. This trivial operation is part of the
- * fdopen() operation when the fdopen() is performed on a socket descriptor.
- * It simply performs some sanity checking before permitting the socket
- * descriptor to be wrapped as a C FILE stream.
+ * fdopen() operation when the fdopen() is performed on a socket
+ * descriptor. It simply performs some sanity checking before permitting
+ * the socket descriptor to be wrapped as a C FILE stream.
*
****************************************************************************/
diff --git a/net/can/can_setsockopt.c b/net/can/can_setsockopt.c
index ac9f912..3359e40 100644
--- a/net/can/can_setsockopt.c
+++ b/net/can/can_setsockopt.c
@@ -121,40 +121,48 @@ int can_setsockopt(FAR struct socket *psock, int option,
break;
case CAN_RAW_LOOPBACK:
- if (value_len != sizeof(conn->loopback))
- return -EINVAL;
+ if (value_len != sizeof(conn->loopback))
+ {
+ return -EINVAL;
+ }
- conn->loopback = *(FAR int32_t *)value;
+ conn->loopback = *(FAR int32_t *)value;
- break;
+ break;
case CAN_RAW_RECV_OWN_MSGS:
- if (value_len != sizeof(conn->recv_own_msgs))
- return -EINVAL;
+ if (value_len != sizeof(conn->recv_own_msgs))
+ {
+ return -EINVAL;
+ }
- conn->recv_own_msgs = *(FAR int32_t *)value;
+ conn->recv_own_msgs = *(FAR int32_t *)value;
- break;
+ break;
case CAN_RAW_FD_FRAMES:
- if (value_len != sizeof(conn->fd_frames))
- return -EINVAL;
+ if (value_len != sizeof(conn->fd_frames))
+ {
+ return -EINVAL;
+ }
- conn->fd_frames = *(FAR int32_t *)value;
+ conn->fd_frames = *(FAR int32_t *)value;
- break;
+ break;
case CAN_RAW_JOIN_FILTERS:
break;
#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
case CAN_RAW_TX_DEADLINE:
- if (value_len != sizeof(conn->tx_deadline))
- return -EINVAL;
+ if (value_len != sizeof(conn->tx_deadline))
+ {
+ return -EINVAL;
+ }
- conn->tx_deadline = *(FAR int32_t *)value;
+ conn->tx_deadline = *(FAR int32_t *)value;
- break;
+ break;
#endif
default:
diff --git a/net/devif/devif.h b/net/devif/devif.h
index f924ebc..1a95011 100644
--- a/net/devif/devif.h
+++ b/net/devif/devif.h
@@ -68,31 +68,32 @@
*
* TCP_ACKDATA IN: Signifies that the outstanding data was ACKed and
* the socket layer should send out new data instead
- * of retransmitting the last data (TCP only)
+ * of retransmitting the last data. (TCP only)
* OUT: Input state must be preserved on output.
*
* TCP_NEWDATA IN: Set to indicate that the peer has sent us new data.
- * UDP_NEWDATA OUT: Cleared (only) by the socket layer logic to indicate
- * ICMP_NEWDATA that the new data was consumed, suppressing further
- * ICMPv6_NEWDATA attempts to process the new data.
- * PKT_NEWDATA
+ * UDP_NEWDATA OUT: Cleared (only) by the socket layer logic to
+ * ICMP_NEWDATA indicate that the new data was consumed,
+ * ICMPv6_NEWDATA suppressing further attempts to process the new
+ * PKT_NEWDATA data.
* BLUETOOTH_NEWDATA
* IEEE802154_NEWDATA
*
* TCP_SNDACK IN: Not used; always zero
- * OUT: Set by the socket layer if the new data was consumed
- * and an ACK should be sent in the response. (TCP only)
+ * OUT: Set by the socket layer if the new data was
+ * consumed and an ACK should be sent in the response.
+ * (TCP only)
*
* TCP_REXMIT IN: Tells the socket layer to retransmit the data that
* was last sent. (TCP only)
* OUT: Not used
*
- * TCP_POLL IN: Used for polling the socket layer. This is provided
- * UDP_POLL periodically from the drivers to support (1) timed
- * PKT_POLL operations, and (2) to check if the socket layer has
- * BLUETOOTH_POLL data that it wants to send. These are socket oriented
- * IEEE802154_POLL callbacks where the context depends on the specific
- * set
+ * TCP_POLL IN: Used for polling the socket layer. This is
+ * UDP_POLL provided periodically from the drivers to support
+ * PKT_POLL (1) timed operations, and (2) to check if the
+ * BLUETOOTH_POLL socket layer has data that it wants to send.
+ * IEEE802154_POLL These are socket oriented callbacks where the
+ * context depends on the specific set.
* OUT: Not used
*
* TCP_BACKLOG IN: There is a new connection in the backlog list set
@@ -104,14 +105,15 @@
* OUT: The socket layer signals that it wants to close the
* connection. (TCP only)
*
- * TCP_ABORT IN: The remote host has aborted the connection, thus the
- * connection has gone away. (TCP only)
+ * TCP_ABORT IN: The remote host has aborted the connection, thus
+ * the connection has gone away. (TCP only)
* OUT: The socket layer signals that it wants to abort the
* connection. (TCP only)
*
- * TCP_CONNECTED IN: We have got a connection from a remote host and have
- * set up a new connection for it, or an active connection
- * has been successfully established. (TCP only)
+ * TCP_CONNECTED IN: We have got a connection from a remote host and
+ * have set up a new connection for it, or an active
+ * connection has been successfully established.
+ * (TCP only)
* OUT: Not used
*
* TCP_TIMEDOUT IN: The connection has been aborted due to too many
@@ -121,37 +123,38 @@
* Device Specific Events: These are events that may be notified through
* callback lists residing in the network device structure.
*
- * ARP_POLL IN: Used for polling the socket layer. This is provided
- * periodically from the drivers to support (1) timed
- * operations, and (2) to check if the ARP layer needs
- * to send an ARP request. This is a device oriented
- * event, not associated with a socket.
+ * ARP_POLL IN: Used for polling the socket layer. This is
+ * provided periodically from the drivers to support
+ * (1) timed operations, and (2) to check if the ARP
+ * layer needs to send an ARP request. This is a
+ * device oriented event, not associated with a
+ * socket.
* OUT: Not used
*
- * ICMP_POLL IN: Used for polling the socket layer. This is provided
- * periodically from the drivers to support (1) timed
- * operations, and (2) to check if the ICMP layer needs
- * to send an ARP request. This is a device oriented
- * event, not associated with a socket. This differs
- * from ICMPv6_POLL only in that the appdata pointer
- * is set differently
+ * ICMP_POLL IN: Used for polling the socket layer. This is
+ * provided periodically from the drivers to support
+ * (1) timed operations, and (2) to check if the ICMP
+ * layer needs to send an ARP request. This is a
+ * device oriented event, not associated with a
+ * socket. This differs from ICMPv6_POLL only in that
+ * the appdata pointer is set differently.
* OUT: Not used
*
- * ICMPv6_POLL IN: Used for polling the socket layer. This is provided
- * periodically from the drivers to support (1) timed
- * operations, and (2) to check if the ICMP layer needs
- * to send an ARP request. This is a device oriented
- * event, not associated with a socket. This differs
- * from ICMP_POLL only in that the appdata pointer
- * is set differently
+ * ICMPv6_POLL IN: Used for polling the socket layer. This is
+ * provided periodically from the drivers to support
+ * (1) timed operations, and (2) to check if the ICMP
+ * layer needs to send an ARP request. This is a
+ * device oriented event, not associated with a
+ * socket. This differs from ICMP_POLL only in that
+ * the appdata pointer is set differently.
* OUT: Not used
*
* IPFWD_POLL IN: Used for polling for forwarded packets layer. This
- * is provided periodically from the drivers to support
- * to check if there is a packet waiting to be forward
- * on the device. This is a device oriented event,
- * not associated with a socket. The appdata pointer
- * The appdata pointer is not used in this case.
+ * is provided periodically from the drivers to
+ * support to check if there is a packet waiting to be
+ * forward on the device. This is a device oriented
+ * event, not associated with a socket. The appdata
+ * pointer is not used in this case.
* OUT: Not used
*
* NETDEV_DOWN: IN: The network device has been taken down.
diff --git a/net/devif/devif_poll.c b/net/devif/devif_poll.c
index e997a6f..803d741 100644
--- a/net/devif/devif_poll.c
+++ b/net/devif/devif_poll.c
@@ -173,15 +173,17 @@ static void devif_packet_conversion(FAR struct net_driver_s *dev,
}
else
{
- nerr("ERROR: ICMPv6 protocol error: %u... Packet dropped\n",
- ipv6->proto);
+ nerr(
+ "ERROR: ICMPv6 protocol error: %u... Packet dropped\n",
+ ipv6->proto);
}
}
else
#endif
{
- nerr("ERROR: Unhandled packet dropped. pkttype=%u protocol=%u\n",
- pkttype, ipv6->proto);
+ nerr(
+ "ERROR: Unhandled packet dropped. pkttype=%u protocol=%u\n",
+ pkttype, ipv6->proto);
}
UNUSED(ipv6);
@@ -396,14 +398,16 @@ static inline int devif_poll_icmpv6(FAR struct net_driver_s *dev,
FAR struct icmpv6_conn_s *conn = NULL;
int bstop = 0;
- /* Traverse all of the allocated ICMPV6 connections and perform the poll action */
+ /* Traverse all of the allocated ICMPV6 connections and perform
+ * the poll action
+ */
do
{
/* Perform the ICMPV6 poll
- * Note: conn equal NULL in the first iteration means poll dev's callback list
- * since icmpv6_autoconfig and icmpv6_neighbor still append it's callback into
- * this list.
+ * Note: conn equal NULL in the first iteration means poll dev's
+ * callback list since icmpv6_autoconfig and icmpv6_neighbor still
+ * append it's callback into this list.
*/
icmpv6_poll(dev, conn);
@@ -654,9 +658,9 @@ static inline int devif_poll_tcp_timer(FAR struct net_driver_s *dev,
* should do only if it cannot accept further write data).
*
* When the callback function is called, there may be an outbound packet
- * waiting for service in the device packet buffer, and if so the d_len field
- * is set to a value larger than zero. The device driver should then send
- * out the packet.
+ * waiting for service in the device packet buffer, and if so the d_len
+ * field is set to a value larger than zero. The device driver should then
+ * send out the packet.
*
* Assumptions:
* This function is called from the MAC device driver with the network
@@ -690,6 +694,7 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
#ifdef CONFIG_NET_CAN
{
/* Check for pending packet socket transfer */
+
bstop = devif_poll_can_connections(dev, callback);
}
@@ -791,8 +796,8 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
* Name: devif_timer
*
* Description:
- * These function will traverse each active network connection structure and
- * perform network timer operations. The Ethernet driver MUST implement
+ * These function will traverse each active network connection structure
+ * and perform network timer operations. The Ethernet driver MUST implement
* logic to periodically call devif_timer().
*
* This function will call the provided callback function for every active
@@ -801,9 +806,9 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
* should do only if it cannot accept further write data).
*
* When the callback function is called, there may be an outbound packet
- * waiting for service in the device packet buffer, and if so the d_len field
- * is set to a value larger than zero. The device driver should then send
- * out the packet.
+ * waiting for service in the device packet buffer, and if so the d_len
+ * field is set to a value larger than zero. The device driver should then
+ * send out the packet.
*
* Assumptions:
* This function is called from the MAC device driver with the network
diff --git a/net/icmp/icmp_sockif.c b/net/icmp/icmp_sockif.c
index ebe2bab..2b1e179 100644
--- a/net/icmp/icmp_sockif.c
+++ b/net/icmp/icmp_sockif.c
@@ -284,7 +284,8 @@ static int icmp_connect(FAR struct socket *psock,
* Input Parameters:
* psock Reference to the listening socket structure
* addr Receives the address of the connecting client
- * addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
+ * addrlen Input: allocated size of 'addr',
+ * Return: returned size of 'addr'
* newsock Location to return the accepted socket information.
*
* Returned Value:
@@ -322,7 +323,8 @@ static int icmp_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
*
****************************************************************************/
-static int icmp_bind(FAR struct socket *psock, FAR const struct sockaddr *addr,
+static int icmp_bind(FAR struct socket *psock,
+ FAR const struct sockaddr *addr,
socklen_t addrlen)
{
/* An ICMP socket cannot be bound to a local address */
@@ -368,10 +370,10 @@ static int icmp_getsockname(FAR struct socket *psock,
* Name: icmp_getpeername
*
* Description:
- * The icmp_getpeername() function retrieves the remote-connected name of the
- * specified packet socket, stores this address in the sockaddr structure
- * pointed to by the 'addr' argument, and stores the length of this
- * address in the object pointed to by the 'addrlen' argument.
+ * The icmp_getpeername() function retrieves the remote-connected name of
+ * the specified packet socket, stores this address in the sockaddr
+ * structure pointed to by the 'addr' argument, and stores the length of
+ * this address in the object pointed to by the 'addrlen' argument.
*
* If the actual length of the address is greater than the length of the
* supplied sockaddr structure, the stored address will be truncated.
diff --git a/net/icmpv6/icmpv6_sockif.c b/net/icmpv6/icmpv6_sockif.c
index 5adae60..3dbb5c8 100644
--- a/net/icmpv6/icmpv6_sockif.c
+++ b/net/icmpv6/icmpv6_sockif.c
@@ -284,7 +284,8 @@ static int icmpv6_connect(FAR struct socket *psock,
* Input Parameters:
* psock Reference to the listening socket structure
* addr Receives the address of the connecting client
- * addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
+ * addrlen Input: allocated size of 'addr',
+ * Return: returned size of 'addr'
* newsock Location to return the accepted socket information.
*
* Returned Value:
@@ -322,8 +323,9 @@ static int icmpv6_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
*
****************************************************************************/
-static int icmpv6_bind(FAR struct socket *psock, FAR const struct sockaddr *addr,
- socklen_t addrlen)
+static int icmpv6_bind(FAR struct socket *psock,
+ FAR const struct sockaddr *addr,
+ socklen_t addrlen)
{
/* An ICMPv6 socket cannot be bound to a local address */
@@ -334,10 +336,10 @@ static int icmpv6_bind(FAR struct socket *psock, FAR const struct sockaddr *addr
* Name: icmpv6_getsockname
*
* Description:
- * The icmpv6_getsockname() function retrieves the locally-bound name of the
- * specified packet socket, stores this address in the sockaddr structure
- * pointed to by the 'addr' argument, and stores the length of this
- * address in the object pointed to by the 'addrlen' argument.
+ * The icmpv6_getsockname() function retrieves the locally-bound name of
+ * the specified packet socket, stores this address in the sockaddr
+ * structure pointed to by the 'addr' argument, and stores the length of
+ * this address in the object pointed to by the 'addrlen' argument.
*
* If the actual length of the address is greater than the length of the
* supplied sockaddr structure, the stored address will be truncated.
@@ -368,10 +370,10 @@ static int icmpv6_getsockname(FAR struct socket *psock,
* Name: icmpv6_getpeername
*
* Description:
- * The icmpv6_getpeername() function retrieves the remote-connected name of the
- * specified packet socket, stores this address in the sockaddr structure
- * pointed to by the 'addr' argument, and stores the length of this
- * address in the object pointed to by the 'addrlen' argument.
+ * The icmpv6_getpeername() function retrieves the remote-connected name of
+ * the specified packet socket, stores this address in the sockaddr
+ * structure pointed to by the 'addr' argument, and stores the length of
+ * this address in the object pointed to by the 'addrlen' argument.
*
* If the actual length of the address is greater than the length of the
* supplied sockaddr structure, the stored address will be truncated.
@@ -487,8 +489,8 @@ static int icmpv6_netpoll(FAR struct socket *psock, FAR struct pollfd *fds,
static ssize_t icmpv6_send(FAR struct socket *psock, FAR const void *buf,
size_t len, int flags)
{
- /* ICMPv6 sockets cannot be bound and, hence, cannot support any connection-
- * oriented data transfer.
+ /* ICMPv6 sockets cannot be bound and, hence, cannot support any
+ * connection-oriented data transfer.
*/
return -EDESTADDRREQ;
diff --git a/net/ieee802154/ieee802154_sockif.c b/net/ieee802154/ieee802154_sockif.c
index 6c0f88a..03db4fb 100644
--- a/net/ieee802154/ieee802154_sockif.c
+++ b/net/ieee802154/ieee802154_sockif.c
@@ -245,10 +245,10 @@ static void ieee802154_addref(FAR struct socket *psock)
* Name: ieee802154_connect
*
* Description:
- * ieee802154_connect() connects the local socket referred to by the structure
- * 'psock' to the address specified by 'addr'. The addrlen argument
- * specifies the size of 'addr'. The format of the address in 'addr' is
- * determined by the address space of the socket 'psock'.
+ * ieee802154_connect() connects the local socket referred to by the
+ * structure 'psock' to the address specified by 'addr'. The addrlen
+ * argument specifies the size of 'addr'. The format of the address in
+ * 'addr' is determined by the address space of the socket 'psock'.
*
* If the socket 'psock' is of type SOCK_DGRAM then 'addr' is the address
* to which datagrams are sent by default, and the only address from which
@@ -311,8 +311,8 @@ static int ieee802154_connect(FAR struct socket *psock,
* Name: ieee802154_accept
*
* Description:
- * The ieee802154_accept function is used with connection-based socket types
- * (SOCK_STREAM, SOCK_SEQPACKET and SOCK_RDM). It extracts the first
+ * The ieee802154_accept function is used with connection-based socket
+ * types (SOCK_STREAM, SOCK_SEQPACKET and SOCK_RDM). It extracts the first
* connection request on the queue of pending connections, creates a new
* connected socket with mostly the same properties as 'sockfd', and
* allocates a new socket descriptor for the socket, which is returned. The
@@ -338,7 +338,8 @@ static int ieee802154_connect(FAR struct socket *psock,
* Input Parameters:
* psock Reference to the listening socket structure
* addr Receives the address of the connecting client
- * addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
+ * addrlen Input: allocated size of 'addr',
+ * Return: returned size of 'addr'
* newsock Location to return the accepted socket information.
*
* Returned Value:
@@ -380,7 +381,8 @@ static int ieee802154_accept(FAR struct socket *psock,
****************************************************************************/
static int ieee802154_bind(FAR struct socket *psock,
- FAR const struct sockaddr *addr, socklen_t addrlen)
+ FAR const struct sockaddr *addr,
+ socklen_t addrlen)
{
FAR const struct sockaddr_ieee802154_s *iaddr;
FAR struct radio_driver_s *radio;
@@ -450,10 +452,10 @@ static int ieee802154_bind(FAR struct socket *psock,
* Name: ieee802154_getsockname
*
* Description:
- * The ieee802154_getsockname() function retrieves the locally-bound name of the
- * specified packet socket, stores this address in the sockaddr structure
- * pointed to by the 'addr' argument, and stores the length of this
- * address in the object pointed to by the 'addrlen' argument.
+ * The ieee802154_getsockname() function retrieves the locally-bound name
+ * of the specified packet socket, stores this address in the sockaddr
+ * structure pointed to by the 'addr' argument, and stores the length of
+ * this address in the object pointed to by the 'addrlen' argument.
*
* If the actual length of the address is greater than the length of the
* supplied sockaddr structure, the stored address will be truncated.
@@ -512,10 +514,10 @@ static int ieee802154_getsockname(FAR struct socket *psock,
* Name: ieee802154_getpeername
*
* Description:
- * The ieee802154_getpeername() function retrieves the remote-connectd name of the
- * specified packet socket, stores this address in the sockaddr structure
- * pointed to by the 'addr' argument, and stores the length of this
- * address in the object pointed to by the 'addrlen' argument.
+ * The ieee802154_getpeername() function retrieves the remote-connectd name
+ * of the specified packet socket, stores this address in the sockaddr
+ * structure pointed to by the 'addr' argument, and stores the length of
+ * this address in the object pointed to by the 'addrlen' argument.
*
* If the actual length of the address is greater than the length of the
* supplied sockaddr structure, the stored address will be truncated.
@@ -680,7 +682,8 @@ static ssize_t ieee802154_send(FAR struct socket *psock, FAR const void *buf,
ret = psock_ieee802154_sendto(psock, buf, len, flags,
(FAR const struct sockaddr *)&to,
- sizeof(struct sockaddr_ieee802154_s));
+ sizeof(
+ struct sockaddr_ieee802154_s));
}
}
else
@@ -717,9 +720,11 @@ static ssize_t ieee802154_send(FAR struct socket *psock, FAR const void *buf,
*
****************************************************************************/
-static ssize_t ieee802154_sendto(FAR struct socket *psock, FAR const void *buf,
+static ssize_t ieee802154_sendto(FAR struct socket *psock,
+ FAR const void *buf,
size_t len, int flags,
- FAR const struct sockaddr *to, socklen_t tolen)
+ FAR const struct sockaddr *to,
+ socklen_t tolen)
{
ssize_t ret;
@@ -777,8 +782,8 @@ static int ieee802154_close(FAR struct socket *psock)
{
/* Yes... free the connection structure */
- conn->crefs = 0; /* No more references on the connection */
- ieee802154_conn_free(psock->s_conn); /* Free network resources */
+ conn->crefs = 0; /* No more references on the connection */
+ ieee802154_conn_free(psock->s_conn); /* Free network resources */
}
else
{
diff --git a/net/local/local_sockif.c b/net/local/local_sockif.c
index cd9bd66..c4f7531 100644
--- a/net/local/local_sockif.c
+++ b/net/local/local_sockif.c
@@ -165,7 +165,8 @@ static int local_sockif_alloc(FAR struct socket *psock)
* specific socket fields.
*
* Input Parameters:
- * psock A pointer to a user allocated socket structure to be initialized.
+ * psock A pointer to a user allocated socket structure
+ * to be initialized.
* protocol (see sys/socket.h)
*
* Returned Value:
@@ -594,7 +595,8 @@ static int local_connect(FAR struct socket *psock,
* Input Parameters:
* psock Reference to the listening socket structure
* addr Receives the address of the connecting client
- * addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
+ * addrlen Input: allocated size of 'addr',
+ * Return: returned size of 'addr'
* newsock Location to return the accepted socket information.
*
* Returned Value:
@@ -721,7 +723,7 @@ static ssize_t local_send(FAR struct socket *psock, FAR const void *buf,
* Name: local_sendto
*
* Description:
- * Implements the sendto() operation for the case of the local, Unix socket.
+ * Implements the sendto() operation for the case of the local Unix socket.
*
* Input Parameters:
* psock A pointer to a NuttX-specific, internal socket structure
diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c
index 34b011a..5e05f64 100644
--- a/net/netlink/netlink_sockif.c
+++ b/net/netlink/netlink_sockif.c
@@ -510,8 +510,13 @@ static int netlink_connect(FAR struct socket *psock,
****************************************************************************/
static int netlink_accept(FAR struct socket *psock,
+<<<<<<< HEAD
FAR struct sockaddr *addr, FAR socklen_t *addrlen,
FAR struct socket *newsock)
+=======
+ FAR struct sockaddr *addr,
+ FAR socklen_t *addrlen, FAR struct socket *newsock)
+>>>>>>> Code style fixes 4
{
return -EOPNOTSUPP;
}
@@ -649,8 +654,13 @@ static int netlink_poll(FAR struct socket *psock, FAR struct pollfd *fds,
conn->pollsem = fds->sem;
conn->pollevent = &fds->revents;
+<<<<<<< HEAD
ret = netlink_notifier_setup(netlink_response_available,
conn, conn);
+=======
+ ret = netlink_notifier_setup(netlink_response_available, conn,
+ conn);
+>>>>>>> Code style fixes 4
if (ret < 0)
{
nerr("ERROR: netlink_notifier_setup() failed: %d\n", ret);
@@ -729,7 +739,12 @@ static ssize_t netlink_send(FAR struct socket *psock, FAR const void *buf,
* returned when the socket was not actually connected.
*
* Input Parameters:
+<<<<<<< HEAD
* psock A reference to the structure of the socket to be connected
+=======
+ * psock A reference to the socket structure of the socket
+ * to be connected
+>>>>>>> Code style fixes 4
* buf Data to send
* len Length of data to send
* flags Send flags (ignored)
diff --git a/net/socket/recvmsg.c b/net/socket/recvmsg.c
index 800eeb1..9ba5de3 100644
--- a/net/socket/recvmsg.c
+++ b/net/socket/recvmsg.c
@@ -1,7 +1,8 @@
/****************************************************************************
* net/socket/recvmsg.c
*
- * Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights
+ * reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -86,6 +87,7 @@ ssize_t psock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
int flags)
{
/* Verify that non-NULL pointers were passed */
+
if (msg == NULL)
{
return -EINVAL;
@@ -111,20 +113,22 @@ ssize_t psock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
(psock->s_sockif->si_recvmsg != NULL ||
psock->s_sockif->si_recvfrom != NULL));
- if(psock->s_sockif->si_recvmsg != NULL)
+ if (psock->s_sockif->si_recvmsg != NULL)
{
- return psock->s_sockif->si_recvmsg(psock, msg, flags);
+ return psock->s_sockif->si_recvmsg(psock, msg, flags);
}
else
{
- /* Socket doesn't implement si_recvmsg fallback to si_recvfrom */
- FAR void *buf = msg->msg_iov->iov_base;
- FAR struct sockaddr *from = msg->msg_name;
- FAR socklen_t *fromlen = (FAR socklen_t *)&msg->msg_namelen;
- size_t len = msg->msg_iov->iov_len;
- return psock->s_sockif->si_recvfrom(psock, buf, len, flags, from, fromlen);
- }
+ /* Socket doesn't implement si_recvmsg fallback to si_recvfrom */
+ FAR void *buf = msg->msg_iov->iov_base;
+ FAR struct sockaddr *from = msg->msg_name;
+ FAR socklen_t *fromlen = (FAR socklen_t *)&msg->msg_namelen;
+ size_t len = msg->msg_iov->iov_len;
+
+ return psock->s_sockif->si_recvfrom(psock, buf, len, flags, from,
+ fromlen);
+ }
}
/****************************************************************************
@@ -171,7 +175,8 @@ ssize_t nx_recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
* Function: recvmsg
*
* Description:
- * The recvmsg() call is identical to recvfrom() with a NULL from parameter.
+ * The recvmsg() call is identical to recvfrom() with a NULL from
+ * parameter.
*
* Parameters:
* sockfd Socket descriptor of socket
@@ -184,19 +189,20 @@ ssize_t nx_recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
* -1 is returned, and errno is set appropriately:
*
* EAGAIN
- * The socket is marked non-blocking and the receive operation would block,
- * or a receive timeout had been set and the timeout expired before data
- * was received.
+ * The socket is marked non-blocking and the receive operation would
+ * block, or a receive timeout had been set and the timeout expired
+ * before data was received.
* EBADF
* The argument sockfd is an invalid descriptor.
* ECONNREFUSED
- * A remote host refused to allow the network connection (typically because
- * it is not running the requested service).
+ * A remote host refused to allow the network connection (typically
+ * because it is not running the requested service).
* EFAULT
- * The receive buffer pointer(s) point outside the process's address space.
+ * The receive buffer pointer(s) point outside the process's address
+ * space.
* EINTR
- * The receive was interrupted by delivery of a signal before any data were
- * available.
+ * The receive was interrupted by delivery of a signal before any data
+ * were available.
* EINVAL
* Invalid argument passed.
* ENOMEM
diff --git a/net/socket/sendmsg.c b/net/socket/sendmsg.c
index 3bc32e8..a188b3a 100644
--- a/net/socket/sendmsg.c
+++ b/net/socket/sendmsg.c
@@ -1,7 +1,8 @@
/****************************************************************************
* net/socket/sendmsg.c
*
- * Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights
+ * reserved.
* Author: Gregory Nutt <gn...@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -86,6 +87,7 @@ ssize_t psock_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
int flags)
{
/* Verify that non-NULL pointers were passed */
+
if (msg == NULL)
{
return -EINVAL;
@@ -111,20 +113,21 @@ ssize_t psock_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
(psock->s_sockif->si_sendmsg != NULL ||
psock->s_sockif->si_sendto != NULL));
- if(psock->s_sockif->si_sendmsg != NULL)
+ if (psock->s_sockif->si_sendmsg != NULL)
{
- return psock->s_sockif->si_sendmsg(psock, msg, flags);
+ return psock->s_sockif->si_sendmsg(psock, msg, flags);
}
else
{
- /* Socket doesn't implement si_sendmsg fallback to si_sendto */
- FAR void *buf = msg->msg_iov->iov_base;
- FAR struct sockaddr *to = msg->msg_name;
- socklen_t tolen = msg->msg_namelen;
- size_t len = msg->msg_iov->iov_len;
- return psock->s_sockif->si_sendto(psock, buf, len, flags, to, tolen);
- }
+ /* Socket doesn't implement si_sendmsg fallback to si_sendto */
+ FAR void *buf = msg->msg_iov->iov_base;
+ FAR struct sockaddr *to = msg->msg_name;
+ socklen_t tolen = msg->msg_namelen;
+ size_t len = msg->msg_iov->iov_len;
+
+ return psock->s_sockif->si_sendto(psock, buf, len, flags, to, tolen);
+ }
}
/****************************************************************************
@@ -171,7 +174,8 @@ ssize_t nx_sendmsg(int sockfd, FAR struct msghdr *msg, int flags)
* Function: sendmsg
*
* Description:
- * The sendmsg() call is identical to sendfrom() with a NULL from parameter.
+ * The sendmsg() call is identical to sendfrom() with a NULL from
+ * parameter.
*
* Parameters:
* sockfd Socket descriptor of socket
@@ -184,19 +188,20 @@ ssize_t nx_sendmsg(int sockfd, FAR struct msghdr *msg, int flags)
* -1 is returned, and errno is set appropriately:
*
* EAGAIN
- * The socket is marked non-blocking and the receive operation would block,
- * or a receive timeout had been set and the timeout expired before data
- * was received.
+ * The socket is marked non-blocking and the receive operation would
+ * block, or a receive timeout had been set and the timeout expired
+ * before data was received.
* EBADF
* The argument sockfd is an invalid descriptor.
* ECONNREFUSED
- * A remote host refused to allow the network connection (typically because
- * it is not running the requested service).
+ * A remote host refused to allow the network connection (typically
+ * because it is not running the requested service).
* EFAULT
- * The receive buffer pointer(s) point outside the process's address space.
+ * The receive buffer pointer(s) point outside the process's address
+ * space.
* EINTR
- * The receive was interrupted by delivery of a signal before any data were
- * available.
+ * The receive was interrupted by delivery of a signal before any data
+ * were available.
* EINVAL
* Invalid argument passed.
* ENOMEM
diff --git a/net/socket/setsockopt.c b/net/socket/setsockopt.c
index fddf0c1..873fcbc 100644
--- a/net/socket/setsockopt.c
+++ b/net/socket/setsockopt.c
@@ -283,7 +283,6 @@ static int psock_socketlevel_option(FAR struct socket *psock, int option,
#ifdef CONFIG_NET_TIMESTAMP
case SO_TIMESTAMP: /* Generates a timestamp for each incoming packet */
{
-
/* Verify that option is at least the size of an integer. */
if (value_len < sizeof(FAR int32_t))
@@ -297,7 +296,7 @@ static int psock_socketlevel_option(FAR struct socket *psock, int option,
net_lock();
- psock->s_timestamp = *((FAR int32_t*)value);
+ psock->s_timestamp = *((FAR int32_t *)value);
net_unlock();
}
[incubator-nuttx] 01/31: include/sys/socket.h: Add CAN socket
family.
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 53fe91ca5840e03955f9a31dd40696d05ffd358e
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Thu Feb 13 09:57:38 2020 -0600
include/sys/socket.h: Add CAN socket family.
---
include/sys/socket.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/sys/socket.h b/include/sys/socket.h
index b940126..e85242e 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -62,6 +62,7 @@
#define PF_NETLINK 16 /* Netlink IPC socket */
#define PF_ROUTE PF_NETLINK /* 4.4BSD Compatibility*/
#define PF_PACKET 17 /* Low level packet interface */
+#define PF_CAN 29 /* Controller Area Network (SocketCAN) */
#define PF_BLUETOOTH 31 /* Bluetooth sockets */
#define PF_IEEE802154 36 /* Low level IEEE 802.15.4 radio frame interface */
#define PF_PKTRADIO 64 /* Low level packet radio interface */
@@ -78,6 +79,7 @@
#define AF_NETLINK PF_NETLINK
#define AF_ROUTE PF_ROUTE
#define AF_PACKET PF_PACKET
+#define AF_CAN PF_CAN
#define AF_BLUETOOTH PF_BLUETOOTH
#define AF_IEEE802154 PF_IEEE802154
#define AF_PKTRADIO PF_PKTRADIO
[incubator-nuttx] 23/31: Code style fixes 2
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 95d8441a09607d66c480e54126f30a8947dcea4b
Author: Jari van Ewijk <ja...@nxp.com>
AuthorDate: Fri Mar 13 14:30:32 2020 +0100
Code style fixes 2
---
include/sys/socket.h | 13 +++++++------
libs/libc/net/lib_recvmsg.c | 3 ++-
net/bluetooth/bluetooth_sockif.c | 34 ++++++++++++++++++----------------
3 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 4cf40a7..87cb8e8 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -157,10 +157,10 @@
#define SO_ERROR 4 /* Reports and clears error status (get only).
* arg: returns an integer value
*/
-#define SO_KEEPALIVE 5 /* Keeps connections active by enabling the periodic
- * transmission of messages (get/set).
- * arg: pointer to integer containing a boolean int
- * value
+#define SO_KEEPALIVE 5 /* Keeps connections active by enabling the
+ * periodic transmission of messages (get/set).
+ * arg: pointer to integer containing a boolean
+ * int value
*/
#define SO_LINGER 6 /* Lingers on a close() if data is present (get/set)
* arg: struct linger
@@ -194,8 +194,9 @@
* arg: integer value
*/
#define SO_SNDTIMEO 14 /* Sets the timeout value specifying the amount of
- * time that an output function blocks because flow
- * control prevents data from being sent(get/set).
+ * time that an output function blocks because
+ * flow control prevents data from being sent
+ * (get/set).
* arg: struct timeval
*/
#define SO_TYPE 15 /* Reports the socket type (get only).
diff --git a/libs/libc/net/lib_recvmsg.c b/libs/libc/net/lib_recvmsg.c
index 2513dfa..5200acd 100644
--- a/libs/libc/net/lib_recvmsg.c
+++ b/libs/libc/net/lib_recvmsg.c
@@ -53,7 +53,8 @@
* Function: recvmsg
*
* Description:
- * The recvmsg() call is identical to recvfrom() with a NULL from parameter.
+ * The recvmsg() call is identical to recvfrom() with a NULL from
+ * parameter.
*
* Parameters:
* sockfd Socket descriptor of socket
diff --git a/net/bluetooth/bluetooth_sockif.c b/net/bluetooth/bluetooth_sockif.c
index 4f4b936..fd6d95f 100644
--- a/net/bluetooth/bluetooth_sockif.c
+++ b/net/bluetooth/bluetooth_sockif.c
@@ -106,7 +106,7 @@ const struct sock_intf_s g_bluetooth_sockif =
bluetooth_send, /* si_send */
bluetooth_sendto, /* si_sendto */
#ifdef CONFIG_NET_SENDFILE
- NULL, /* si_sendfile */
+ NULL, /* si_sendfile */
#endif
bluetooth_recvfrom, /* si_recvfrom */
#ifdef CONFIG_NET_RECVMSG_CMSG
@@ -246,10 +246,10 @@ static void bluetooth_addref(FAR struct socket *psock)
* Name: bluetooth_connect
*
* Description:
- * bluetooth_connect() connects the local socket referred to by the structure
- * 'psock' to the address specified by 'addr'. The addrlen argument
- * specifies the size of 'addr'. The format of the address in 'addr' is
- * determined by the address space of the socket 'psock'.
+ * bluetooth_connect() connects the local socket referred to by the
+ * structure 'psock' to the address specified by 'addr'. The addrlen
+ * argument specifies the size of 'addr'. The format of the address in
+ * 'addr' is determined by the address space of the socket 'psock'.
*
* Generally, connection-based protocol sockets may successfully
* bluetooth_connect() only once; connectionless protocol sockets may use
@@ -333,7 +333,8 @@ static int bluetooth_connect(FAR struct socket *psock,
* Input Parameters:
* psock Reference to the listening socket structure
* addr Receives the address of the connecting client
- * addrlen Input: allocated size of 'addr', Return: returned size of 'addr'
+ * addrlen Input: allocated size of 'addr',
+ * Return: returned size of 'addr'
* newsock Location to return the accepted socket information.
*
* Returned Value:
@@ -375,7 +376,7 @@ static int bluetooth_accept(FAR struct socket *psock,
****************************************************************************/
static int bluetooth_bind(FAR struct socket *psock,
- FAR const struct sockaddr *addr, socklen_t addrlen)
+ FAR const struct sockaddr *addr, socklen_t addrlen)
{
FAR const struct sockaddr_bt_s *iaddr;
FAR struct radio_driver_s *radio;
@@ -442,10 +443,10 @@ static int bluetooth_bind(FAR struct socket *psock,
* Name: bluetooth_getsockname
*
* Description:
- * The bluetooth_getsockname() function retrieves the locally-bound name of the
- * specified packet socket, stores this address in the sockaddr structure
- * pointed to by the 'addr' argument, and stores the length of this
- * address in the object pointed to by the 'addrlen' argument.
+ * The bluetooth_getsockname() function retrieves the locally-bound name of
+ * the specified packet socket, stores this address in the sockaddr
+ * structure pointed to by the 'addr' argument, and stores the length of
+ * this address in the object pointed to by the 'addrlen' argument.
*
* If the actual length of the address is greater than the length of the
* supplied sockaddr structure, the stored address will be truncated.
@@ -504,8 +505,8 @@ static int bluetooth_getsockname(FAR struct socket *psock,
* Name: bluetooth_getpeername
*
* Description:
- * The bluetooth_getpeername() function retrieves the remote-connected name of
- * the specified local socket, stores this address in the sockaddr
+ * The bluetooth_getpeername() function retrieves the remote-connected name
+ * of the specified local socket, stores this address in the sockaddr
* structure pointed to by the 'addr' argument, and stores the length of
* this address in the object pointed to by the 'addrlen' argument.
*
@@ -708,9 +709,10 @@ static ssize_t bluetooth_send(FAR struct socket *psock, FAR const void *buf,
*
****************************************************************************/
-static ssize_t bluetooth_sendto(FAR struct socket *psock, FAR const void *buf,
- size_t len, int flags,
- FAR const struct sockaddr *to, socklen_t tolen)
+static ssize_t bluetooth_sendto(FAR struct socket *psock,
+ FAR const void *buf, size_t len, int flags,
+ FAR const struct sockaddr *to,
+ socklen_t tolen)
{
ssize_t ret;
[incubator-nuttx] 13/31: SocketCAN removed NET_TCP and NET_PKT
dependencies
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 8bc2922f22d77ad565aafdcdde956c3a39718cab
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Thu Mar 5 16:36:56 2020 +0100
SocketCAN removed NET_TCP and NET_PKT dependencies
---
fs/vfs/fs_write.c | 2 +-
include/nuttx/mm/iob.h | 2 +-
net/can/can_send.c | 2 +-
net/devif/Make.defs | 2 +-
net/devif/devif.h | 23 ++++++++++++++++++++++-
net/devif/devif_pktsend.c | 2 +-
6 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c
index 6e9a379..ef5f137 100644
--- a/fs/vfs/fs_write.c
+++ b/fs/vfs/fs_write.c
@@ -149,7 +149,7 @@ ssize_t nx_write(int fd, FAR const void *buf, size_t nbytes)
if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS)
{
-#ifdef CONFIG_NET_TCP
+#if defined(CONFIG_NET_TCP) || defined(CONFIG_NET_CAN)
/* Write to a socket descriptor is equivalent to send with flags == 0. */
ret = nx_send(fd, buf, nbytes, 0);
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index 5903c50..e986105 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -221,7 +221,7 @@ enum iob_user_e
#ifdef CONFIG_WIRELESS_BLUETOOTH
IOBUSER_WIRELESS_BLUETOOTH,
#endif
-#if defined(CONFIG_NET_CAN)
+#ifdef CONFIG_NET_CAN
IOBUSER_NET_CAN_READAHEAD,
#endif
IOBUSER_GLOBAL,
diff --git a/net/can/can_send.c b/net/can/can_send.c
index 1d8677d..be621b4 100644
--- a/net/can/can_send.c
+++ b/net/can/can_send.c
@@ -119,7 +119,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
{
/* Copy the packet data into the device packet buffer and send it */
//FIXME potentialy wrong function do we have a header??
- devif_pkt_send(dev, pstate->snd_buffer, pstate->snd_buflen);
+ devif_can_send(dev, pstate->snd_buffer, pstate->snd_buflen);
pstate->snd_sent = pstate->snd_buflen;
}
diff --git a/net/devif/Make.defs b/net/devif/Make.defs
index 57aac89..492c7d8 100644
--- a/net/devif/Make.defs
+++ b/net/devif/Make.defs
@@ -67,7 +67,7 @@ NET_CSRCS += devif_pktsend.c
endif
ifeq ($(CONFIG_NET_CAN),y)
-NET_CSRCS += devif_pktsend.c
+NET_CSRCS += devif_cansend.c
endif
# Include network device interface build support
diff --git a/net/devif/devif.h b/net/devif/devif.h
index c54a68d..f924ebc 100644
--- a/net/devif/devif.h
+++ b/net/devif/devif.h
@@ -494,11 +494,32 @@ void devif_iob_send(FAR struct net_driver_s *dev, FAR struct iob_s *buf,
*
****************************************************************************/
-#if defined(CONFIG_NET_PKT) || defined(CONFIG_NET_CAN)
+#if defined(CONFIG_NET_PKT)
void devif_pkt_send(FAR struct net_driver_s *dev, FAR const void *buf,
unsigned int len);
#endif
+/****************************************************************************
+ * Name: devif_can_send
+ *
+ * Description:
+ * Called from socket logic in order to send a raw packet in response to
+ * an xmit or poll request from the network interface driver.
+ *
+ * This is almost identical to calling devif_send() except that the data to
+ * be sent is copied into dev->d_buf (vs. dev->d_appdata), since there is
+ * no header on the data.
+ *
+ * Assumptions:
+ * This function must be called with the network locked.
+ *
+ ****************************************************************************/
+
+#if defined(CONFIG_NET_CAN)
+void devif_can_send(FAR struct net_driver_s *dev, FAR const void *buf,
+ unsigned int len);
+#endif
+
#undef EXTERN
#ifdef __cplusplus
}
diff --git a/net/devif/devif_pktsend.c b/net/devif/devif_pktsend.c
index a5d0515..465def2 100644
--- a/net/devif/devif_pktsend.c
+++ b/net/devif/devif_pktsend.c
@@ -45,7 +45,7 @@
#include <nuttx/net/netdev.h>
-#if defined(CONFIG_NET_PKT) || defined(CONFIG_NET_CAN)
+#if defined(CONFIG_NET_PKT)
/****************************************************************************
* Pre-processor Definitions
[incubator-nuttx] 30/31: Backport code style fixes
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit ec7b886e97b893353263f1f43beeb4247bfcdcb1
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Mar 18 12:18:30 2020 +0100
Backport code style fixes
---
include/nuttx/wqueue.h | 2 +-
net/can/can.h | 13 ++--
net/can/can_recvfrom.c | 191 ++++++++++++++++++++++++++-----------------------
3 files changed, 108 insertions(+), 98 deletions(-)
diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h
index 5ea8dfc..ea7563c 100644
--- a/include/nuttx/wqueue.h
+++ b/include/nuttx/wqueue.h
@@ -280,7 +280,7 @@ enum work_evtype_e
WORK_TCP_DISCONNECT, /* Notify loss of TCP connection */
WORK_UDP_READAHEAD, /* Notify that UDP read-ahead data is available */
WORK_UDP_WRITEBUFFER, /* Notify that UDP write buffer is empty */
- WORK_NETLINK_RESPONSE, /* Notify thtat Netlink response is available */
+ WORK_NETLINK_RESPONSE, /* Notify that Netlink response is available */
WORK_CAN_READAHEAD /* Notify that CAN read-ahead data is available */
};
diff --git a/net/can/can.h b/net/can/can.h
index a727612..2377a0c 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -104,7 +104,7 @@ struct can_conn_s
*/
struct can_poll_s pollinfo[4]; /* FIXME make dynamic */
-
+
#ifdef CONFIG_NET_CANPROTO_OPTIONS
int32_t loopback;
int32_t recv_own_msgs;
@@ -115,12 +115,10 @@ struct can_conn_s
int32_t tx_deadline;
# endif
#endif
-
+
#ifdef CONFIG_NET_TIMESTAMP
FAR struct socket *psock; /* Needed to get SO_TIMESTAMP value */
#endif
-
-
};
/****************************************************************************
@@ -169,8 +167,8 @@ FAR struct can_conn_s *can_alloc(void);
* Name: can_free()
*
* Description:
- * Free a NetLink connection structure that is no longer in use. This should
- * be done by the implementation of close().
+ * Free a NetLink connection structure that is no longer in use. This
+ * should be done by the implementation of close().
*
****************************************************************************/
@@ -259,7 +257,6 @@ uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
*
****************************************************************************/
-
ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
int flags, FAR struct sockaddr *from,
FAR socklen_t *fromlen);
@@ -282,7 +279,7 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
* flags Receive flags (ignored)
*
****************************************************************************/
-#ifdef CONFIG_NET_RECVMSG_CMSG
+#ifdef CONFIG_NET_CMSG
ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
size_t len, int flags);
#endif
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index d9ed8cb..b304977 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -50,14 +50,13 @@
#include <sys/time.h>
#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
struct can_recvfrom_s
{
- FAR struct socket *pr_sock; /* The parent socket structure */
+ FAR struct socket *pr_sock; /* The parent socket structure */
FAR struct devif_callback_s *pr_cb; /* Reference to callback instance */
sem_t pr_sem; /* Semaphore signals recv completion */
size_t pr_buflen; /* Length of receive buffer */
@@ -233,14 +232,15 @@ static inline void can_newdata(FAR struct net_driver_s *dev,
static inline int can_readahead(struct can_recvfrom_s *pstate)
{
- FAR struct can_conn_s *conn = (FAR struct can_conn_s *)pstate->pr_sock->s_conn;
+ FAR struct can_conn_s *conn =
+ (FAR struct can_conn_s *) pstate->pr_sock->s_conn;
FAR struct iob_s *iob;
int recvlen;
/* Check there is any CAN data already buffered in a read-ahead
* buffer.
*/
-
+
pstate->pr_recvlen = -1;
if ((iob = iob_peek_queue(&conn->readahead)) != NULL &&
@@ -287,15 +287,16 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
IOBUSER_NET_CAN_READAHEAD);
}
- /* do not pass frames with DLC > 8 to a legacy socket */
- if (!conn->fd_frames)
- {
- struct canfd_frame *cfd = (struct canfd_frame *)pstate->pr_buffer;
- if (cfd->len > CAN_MAX_DLEN)
- {
- return 0;
- }
- }
+ /* do not pass frames with DLC > 8 to a legacy socket */
+
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame *)pstate->pr_buffer;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ return 0;
+ }
+ }
return recvlen;
}
@@ -319,13 +320,14 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
* The network is locked.
*
****************************************************************************/
+
#ifdef CONFIG_NET_TIMESTAMP
-static inline int can_readahead_timestamp(struct can_conn_s *conn, FAR uint8_t *buffer)
+static inline int can_readahead_timestamp(struct can_conn_s *conn,
+ FAR uint8_t *buffer)
{
FAR struct iob_s *iob;
int recvlen;
-
if ((iob = iob_peek_queue(&conn->readahead)) != NULL)
{
DEBUGASSERT(iob->io_pktlen > 0);
@@ -379,26 +381,27 @@ static inline int can_readahead_timestamp(struct can_conn_s *conn, FAR uint8_t *
#ifdef CONFIG_NET_CANPROTO_OPTIONS
static int can_recv_filter(struct can_conn_s *conn, canid_t id)
{
- for(int i = 0; i < conn->filter_count; i++)
+ for (int i = 0; i < conn->filter_count; i++)
{
- if (conn->filters[i].can_id & CAN_INV_FILTER)
- {
- if((id & conn->filters[i].can_mask) !=
- ((conn->filters[i].can_id & ~CAN_INV_FILTER)
- & conn->filters[i].can_mask))
- {
- return 1;
- }
- }
- else
- {
- if((id & conn->filters[i].can_mask) ==
- (conn->filters[i].can_id & conn->filters[i].can_mask))
- {
- return 1;
- }
- }
+ if (conn->filters[i].can_id & CAN_INV_FILTER)
+ {
+ if ((id & conn->filters[i].can_mask) !=
+ ((conn->filters[i].can_id & ~CAN_INV_FILTER) &
+ conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
+ else
+ {
+ if ((id & conn->filters[i].can_mask) ==
+ (conn->filters[i].can_id & conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
}
+
return 0;
}
#endif
@@ -416,46 +419,50 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
{
if ((flags & CAN_NEWDATA) != 0)
{
- /* If a new packet is available, check receive filters
- * when is valid then complete the read action. */
+ /* If a new packet is available, check receive filters
+ * when is valid then complete the read action.
+ */
#ifdef CONFIG_NET_CANPROTO_OPTIONS
- if(can_recv_filter(conn,(canid_t)*dev->d_appdata) == 0)
- {
- flags &= ~CAN_NEWDATA;
- return flags;
- }
+ if (can_recv_filter(conn, (canid_t) *dev->d_appdata) == 0)
+ {
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
#endif
- /* do not pass frames with DLC > 8 to a legacy socket */
- if (!conn->fd_frames)
- {
- struct canfd_frame *cfd = (struct canfd_frame*)dev->d_appdata;
- if (cfd->len > CAN_MAX_DLEN)
- {
- /* DO WE NEED TO CLEAR FLAGS?? */
- flags &= ~CAN_NEWDATA;
- return flags;
- }
- }
+ /* do not pass frames with DLC > 8 to a legacy socket */
+
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame *)dev->d_appdata;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ /* DO WE NEED TO CLEAR FLAGS?? */
+
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
+ }
/* Copy the packet */
can_newdata(dev, pstate);
#ifdef CONFIG_NET_TIMESTAMP
- if(pstate->pr_sock->s_timestamp)
- {
- if(pstate->pr_msglen == sizeof(struct timeval))
- {
- can_readahead_timestamp(conn, pstate->pr_msgbuf);
- }
- else
- {
- /* We still have to consume the data otherwise IOB gets full */
- uint8_t dummy_buf[sizeof(struct timeval)];
- can_readahead_timestamp(conn, &dummy_buf);
- }
- }
+ if (pstate->pr_sock->s_timestamp)
+ {
+ if (pstate->pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, pstate->pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
#endif
/* We are finished. */
@@ -508,6 +515,7 @@ static ssize_t can_recvfrom_result(int result,
if (pstate->pr_result < 0)
{
/* This might return EAGAIN on a timeout */
+
return pstate->pr_result;
}
@@ -592,10 +600,10 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
ret = can_readahead(&state);
if (ret > 0)
- {
+ {
goto errout_with_state;
}
-
+
ret = state.pr_recvlen;
/* Handle non-blocking CAN sockets */
@@ -610,7 +618,7 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
{
/* Nothing was received */
- ret = -EAGAIN;
+ ret = -EAGAIN;
goto errout_with_state;
}
}
@@ -675,7 +683,8 @@ errout_with_state:
* flags Receive flags (ignored)
*
****************************************************************************/
-#ifdef CONFIG_NET_RECVMSG_CMSG
+
+#ifdef CONFIG_NET_CMSG
ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
size_t len, int flags)
{
@@ -707,20 +716,22 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
nxsem_init(&state.pr_sem, 0, 0); /* Doesn't really fail */
nxsem_setprotocol(&state.pr_sem, SEM_PRIO_NONE);
-
state.pr_buflen = msg->msg_iov->iov_len;
state.pr_buffer = msg->msg_iov->iov_base;
+
#ifdef CONFIG_NET_TIMESTAMP
- if(psock->s_timestamp && msg->msg_controllen == (sizeof(struct cmsghdr) + sizeof(struct timeval)))
+ if (psock->s_timestamp && msg->msg_controllen ==
+ (sizeof(struct cmsghdr) + sizeof(struct timeval)))
{
- struct cmsghdr* cmsg = CMSG_FIRSTHDR(msg);
- state.pr_msglen = sizeof(struct timeval);
- state.pr_msgbuf = CMSG_DATA(cmsg);
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SO_TIMESTAMP;
- cmsg->cmsg_len = state.pr_msglen;
+ struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
+ state.pr_msglen = sizeof(struct timeval);
+ state.pr_msgbuf = CMSG_DATA(cmsg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SO_TIMESTAMP;
+ cmsg->cmsg_len = state.pr_msglen;
}
#endif
+
state.pr_sock = psock;
/* Handle any any CAN data already buffered in a read-ahead buffer. NOTE
@@ -732,20 +743,22 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
if (ret > 0)
{
#ifdef CONFIG_NET_TIMESTAMP
- if(psock->s_timestamp)
- {
- if(state.pr_msglen == sizeof(struct timeval))
- {
- can_readahead_timestamp(conn, state.pr_msgbuf);
- }
- else
- {
- /* We still have to consume the data otherwise IOB gets full */
- uint8_t dummy_buf[sizeof(struct timeval)];
- can_readahead_timestamp(conn, &dummy_buf);
- }
- }
+ if (psock->s_timestamp)
+ {
+ if (state.pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, state.pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
#endif
+
goto errout_with_state;
}
[incubator-nuttx] 18/31: Added support for SO_TIMESTAMP in
socketlayer and SocketCAN Cleanup FlexCAN driver driver Disabled workqueue
based TX in FlexCAN
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 754b9ae6e755720ac1caeab75d550e8ba5af8614
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Mar 11 14:32:52 2020 +0100
Added support for SO_TIMESTAMP in socketlayer and SocketCAN
Cleanup FlexCAN driver driver
Disabled workqueue based TX in FlexCAN
---
net/socket/recvmsg.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 238 insertions(+)
diff --git a/net/socket/recvmsg.c b/net/socket/recvmsg.c
new file mode 100644
index 0000000..17d4dfe
--- /dev/null
+++ b/net/socket/recvmsg.c
@@ -0,0 +1,238 @@
+/****************************************************************************
+ * net/socket/recvmsg.c
+ *
+ * Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * 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 <nuttx/config.h>
+
+#include <assert.h>
+#include <errno.h>
+
+#include <nuttx/cancelpt.h>
+#include <nuttx/net/net.h>
+
+#include "socket/socket.h"
+
+#ifdef CONFIG_NET_RECVMSG_CMSG
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: psock_recvmsg
+ *
+ * Description:
+ * psock_recvfrom() receives messages from a socket, and may be used to
+ * receive data on a socket whether or not it is connection-oriented.
+ * This is an internal OS interface. It is functionally equivalent to
+ * recvfrom() except that:
+ *
+ * - It is not a cancellation point,
+ * - It does not modify the errno variable, and
+ * - I accepts the internal socket structure as an input rather than an
+ * task-specific socket descriptor.
+ *
+ * Input Parameters:
+ * psock - A pointer to a NuttX-specific, internal socket structure
+ * msg Buffer to receive msg
+ * len - Length of buffer
+ * flags - Receive flags
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. If no data is
+ * available to be received and the peer has performed an orderly shutdown,
+ * recv() will return 0. Otherwise, on any failure, a negated errno value
+ * is returned (see comments with send() for a list of appropriate errno
+ * values).
+ *
+ ****************************************************************************/
+
+ssize_t psock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ int flags)
+{
+ /* Verify that non-NULL pointers were passed */
+ if (msg == NULL)
+ {
+ return -EINVAL;
+ }
+
+ if (msg->msg_iovlen != 1)
+ {
+ return -ENOTSUP;
+ }
+
+ /* Verify that the sockfd corresponds to valid, allocated socket */
+
+ if (psock == NULL || psock->s_crefs <= 0)
+ {
+ return -EBADF;
+ }
+
+ /* Let logic specific to this address family handle the recvfrom()
+ * operation.
+ */
+
+ DEBUGASSERT(psock->s_sockif != NULL &&
+ (psock->s_sockif->si_recvmsg != NULL ||
+ psock->s_sockif->si_recvfrom != NULL));
+
+ if(psock->s_sockif->si_recvmsg != NULL)
+ {
+ return psock->s_sockif->si_recvmsg(psock, msg, flags);
+ }
+ else
+ {
+ /* Socket doesn't implement si_recvmsg fallback to si_recvfrom */
+ FAR void *buf = msg->msg_iov->iov_base;
+ FAR struct sockaddr *from = msg->msg_name;
+ FAR socklen_t *fromlen = (FAR socklen_t *)&msg->msg_namelen;
+ size_t len = msg->msg_iov->iov_len;
+ return psock->s_sockif->si_recvfrom(psock, buf, len, flags, from, fromlen);
+ }
+
+}
+
+/****************************************************************************
+ * Name: nx_recvfrom
+ *
+ * Description:
+ * nx_recvfrom() receives messages from a socket, and may be used to
+ * receive data on a socket whether or not it is connection-oriented.
+ * This is an internal OS interface. It is functionally equivalent to
+ * recvfrom() except that:
+ *
+ * - It is not a cancellation point, and
+ * - It does not modify the errno variable.
+ *
+ * Input Parameters:
+ * sockfd - Socket descriptor of socket
+ * msg Buffer to receive msg
+ * len - Length of buffer
+ * flags - Receive flags
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. If no data is
+ * available to be received and the peer has performed an orderly shutdown,
+ * recv() will return 0. Otherwise, on any failure, a negated errno value
+ * is returned (see comments with send() for a list of appropriate errno
+ * values).
+ *
+ ****************************************************************************/
+
+ssize_t nx_recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
+{
+ FAR struct socket *psock;
+
+ /* Get the underlying socket structure */
+
+ psock = sockfd_socket(sockfd);
+
+ /* Then let psock_recvmsg() do all of the work */
+
+ return psock_recvmsg(psock, msg, flags);
+}
+
+/****************************************************************************
+ * Function: recvmsg
+ *
+ * Description:
+ * The recvmsg() call is identical to recvfrom() with a NULL from parameter.
+ *
+ * Parameters:
+ * sockfd Socket descriptor of socket
+ * msg Buffer to receive msg
+ * len Length of buffer
+ * flags Receive flags
+ *
+ * Returned Value:
+ * On success, returns the number of characters received. On error,
+ * -1 is returned, and errno is set appropriately:
+ *
+ * EAGAIN
+ * The socket is marked non-blocking and the receive operation would block,
+ * or a receive timeout had been set and the timeout expired before data
+ * was received.
+ * EBADF
+ * The argument sockfd is an invalid descriptor.
+ * ECONNREFUSED
+ * A remote host refused to allow the network connection (typically because
+ * it is not running the requested service).
+ * EFAULT
+ * The receive buffer pointer(s) point outside the process's address space.
+ * EINTR
+ * The receive was interrupted by delivery of a signal before any data were
+ * available.
+ * EINVAL
+ * Invalid argument passed.
+ * ENOMEM
+ * Could not allocate memory.
+ * ENOTCONN
+ * The socket is associated with a connection-oriented protocol and has
+ * not been connected.
+ * ENOTSOCK
+ * The argument sockfd does not refer to a socket.
+ *
+ ****************************************************************************/
+
+ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
+{
+ FAR struct socket *psock;
+ ssize_t ret;
+
+ /* recvfrom() is a cancellation point */
+
+ enter_cancellation_point();
+
+ /* Get the underlying socket structure */
+
+ psock = sockfd_socket(sockfd);
+
+ /* Let psock_recvfrom() do all of the work */
+
+ ret = psock_recvmsg(psock, msg, flags);
+ if (ret < 0)
+ {
+ _SO_SETERRNO(psock, -ret);
+ ret = ERROR;
+ }
+
+ leave_cancellation_point();
+ return ret;
+}
+
+#endif /* CONFIG_NET_RECVMSG_CMSG */
[incubator-nuttx] 24/31: Code style fixes 3
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 8a737215fa454c176b8967e85393eb85bbd30e56
Author: Jari van Ewijk <ja...@nxp.com>
AuthorDate: Fri Mar 13 17:27:21 2020 +0100
Code style fixes 3
---
net/can/can.h | 13 ++--
net/can/can_callback.c | 21 +++---
net/can/can_conn.c | 8 +-
net/can/can_getsockopt.c | 18 +++--
net/can/can_recvfrom.c | 189 +++++++++++++++++++++++++----------------------
net/can/can_send.c | 36 ++++-----
net/can/can_setsockopt.c | 51 ++++++-------
net/can/can_sockif.c | 14 ++--
8 files changed, 185 insertions(+), 165 deletions(-)
diff --git a/net/can/can.h b/net/can/can.h
index c74fca4..7c6b614 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -104,22 +104,20 @@ struct can_conn_s
*/
struct can_poll_s pollinfo[4]; /* FIXME make dynamic */
-
+
#ifdef CONFIG_NET_CANPROTO_OPTIONS
int32_t loopback;
int32_t recv_own_msgs;
int32_t fd_frames;
struct can_filter filters[CONFIG_NET_CAN_RAW_FILTER_MAX];
int32_t filter_count;
-
+
/* TODO add filter support */
#endif
-
+
#ifdef CONFIG_NET_TIMESTAMP
FAR struct socket *psock; /* Needed to get SO_TIMESTAMP value */
#endif
-
-
};
/****************************************************************************
@@ -168,8 +166,8 @@ FAR struct can_conn_s *can_alloc(void);
* Name: can_free()
*
* Description:
- * Free a NetLink connection structure that is no longer in use. This should
- * be done by the implementation of close().
+ * Free a NetLink connection structure that is no longer in use. This
+ * should be done by the implementation of close().
*
****************************************************************************/
@@ -258,7 +256,6 @@ uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
*
****************************************************************************/
-
ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
int flags, FAR struct sockaddr *from,
FAR socklen_t *fromlen);
diff --git a/net/can/can_callback.c b/net/can/can_callback.c
index f8bff86..aab0e3e 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_callback.c
@@ -119,15 +119,18 @@ uint16_t can_callback(FAR struct net_driver_s *dev,
if (conn)
{
#ifdef CONFIG_NET_TIMESTAMP
- /* TIMESTAMP sockopt is activated, create timestamp and copy to iob */
- if(conn->psock->s_timestamp)
- {
- struct timespec *ts = (struct timespec*)&dev->d_appdata[dev->d_len];
- struct timeval *tv = (struct timeval*)&dev->d_appdata[dev->d_len];
- dev->d_len += sizeof(struct timeval);
- clock_systimespec(ts);
- tv->tv_usec = ts->tv_nsec / 1000;
- }
+ /* TIMESTAMP sockopt is activated, create timestamp and copy to iob */
+
+ if (conn->psock->s_timestamp)
+ {
+ struct timespec *ts = (struct timespec *)
+ &dev->d_appdata[dev->d_len];
+ struct timeval *tv = (struct timeval *)
+ &dev->d_appdata[dev->d_len];
+ dev->d_len += sizeof(struct timeval);
+ clock_systimespec(ts);
+ tv->tv_usec = ts->tv_nsec / 1000;
+ }
#endif
/* Perform the callback */
diff --git a/net/can/can_conn.c b/net/can/can_conn.c
index 74f2d9b..574796c 100644
--- a/net/can/can_conn.c
+++ b/net/can/can_conn.c
@@ -138,9 +138,8 @@ FAR struct can_conn_s *can_alloc(void)
/* Make sure that the connection is marked as uninitialized */
memset(conn, 0, sizeof(*conn));
-
+
/* FIXME SocketCAN default behavior enables loopback */
-
#ifdef CONFIG_NET_CANPROTO_OPTIONS
/* By default the filter is configured to catch all,
@@ -158,7 +157,6 @@ FAR struct can_conn_s *can_alloc(void)
conn->filter_count = 1;
#endif
-
/* Enqueue the connection into the active list */
dq_addlast(&conn->node, &g_active_can_connections);
@@ -172,8 +170,8 @@ FAR struct can_conn_s *can_alloc(void)
* Name: can_free()
*
* Description:
- * Free a NetLink connection structure that is no longer in use. This should
- * be done by the implementation of close().
+ * Free a NetLink connection structure that is no longer in use. This
+ * should be done by the implementation of close().
*
****************************************************************************/
diff --git a/net/can/can_getsockopt.c b/net/can/can_getsockopt.c
index e4149b6..238695c 100644
--- a/net/can/can_getsockopt.c
+++ b/net/can/can_getsockopt.c
@@ -98,7 +98,8 @@ int can_getsockopt(FAR struct socket *psock, int option,
{
ret = -EINVAL;
}
- else if (*value_len > CONFIG_NET_CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
+ else if (*value_len > CONFIG_NET_CAN_RAW_FILTER_MAX *
+ sizeof(struct can_filter))
{
ret = -EINVAL;
}
@@ -106,19 +107,20 @@ int can_getsockopt(FAR struct socket *psock, int option,
{
int count = conn->filter_count;
- if (*value_len < count * sizeof(struct can_filter))
+ if (*value_len < count * sizeof(struct can_filter))
{
count = *value_len / sizeof(struct can_filter);
}
- else
- {
- *value_len = count * sizeof(struct can_filter);
- }
+ else
+ {
+ *value_len = count * sizeof(struct can_filter);
+ }
- for(int i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
- ((struct can_filter *)value)[i] = conn->filters[i];
+ ((struct can_filter *)value)[i] = conn->filters[i];
}
+
ret = OK;
}
break;
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index 98a0b2a..2211ed0 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -50,14 +50,13 @@
#include <sys/time.h>
#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
struct can_recvfrom_s
{
- FAR struct socket *pr_sock; /* The parent socket structure */
+ FAR struct socket *pr_sock; /* The parent socket structure */
FAR struct devif_callback_s *pr_cb; /* Reference to callback instance */
sem_t pr_sem; /* Semaphore signals recv completion */
size_t pr_buflen; /* Length of receive buffer */
@@ -233,14 +232,15 @@ static inline void can_newdata(FAR struct net_driver_s *dev,
static inline int can_readahead(struct can_recvfrom_s *pstate)
{
- FAR struct can_conn_s *conn = (FAR struct can_conn_s *)pstate->pr_sock->s_conn;
+ FAR struct can_conn_s *conn =
+ (FAR struct can_conn_s *) pstate->pr_sock->s_conn;
FAR struct iob_s *iob;
int recvlen;
/* Check there is any CAN data already buffered in a read-ahead
* buffer.
*/
-
+
pstate->pr_recvlen = -1;
if ((iob = iob_peek_queue(&conn->readahead)) != NULL &&
@@ -287,15 +287,16 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
IOBUSER_NET_CAN_READAHEAD);
}
- /* do not pass frames with DLC > 8 to a legacy socket */
- if (!conn->fd_frames)
- {
- struct canfd_frame *cfd = (struct canfd_frame *)pstate->pr_buffer;
- if (cfd->len > CAN_MAX_DLEN)
- {
- return 0;
- }
- }
+ /* do not pass frames with DLC > 8 to a legacy socket */
+
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame *)pstate->pr_buffer;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ return 0;
+ }
+ }
return recvlen;
}
@@ -319,13 +320,14 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
* The network is locked.
*
****************************************************************************/
+
#ifdef CONFIG_NET_TIMESTAMP
-static inline int can_readahead_timestamp(struct can_conn_s *conn, FAR uint8_t *buffer)
+static inline int can_readahead_timestamp(struct can_conn_s *conn,
+ FAR uint8_t *buffer)
{
FAR struct iob_s *iob;
int recvlen;
-
if ((iob = iob_peek_queue(&conn->readahead)) != NULL)
{
DEBUGASSERT(iob->io_pktlen > 0);
@@ -379,26 +381,27 @@ static inline int can_readahead_timestamp(struct can_conn_s *conn, FAR uint8_t *
#ifdef CONFIG_NET_CANPROTO_OPTIONS
static int can_recv_filter(struct can_conn_s *conn, canid_t id)
{
- for(int i = 0; i < conn->filter_count; i++)
+ for (int i = 0; i < conn->filter_count; i++)
{
- if (conn->filters[i].can_id & CAN_INV_FILTER)
- {
- if((id & conn->filters[i].can_mask) !=
- ((conn->filters[i].can_id & ~CAN_INV_FILTER)
- & conn->filters[i].can_mask))
- {
- return 1;
- }
- }
- else
- {
- if((id & conn->filters[i].can_mask) ==
- (conn->filters[i].can_id & conn->filters[i].can_mask))
- {
- return 1;
- }
- }
+ if (conn->filters[i].can_id & CAN_INV_FILTER)
+ {
+ if ((id & conn->filters[i].can_mask) !=
+ ((conn->filters[i].can_id & ~CAN_INV_FILTER) &
+ conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
+ else
+ {
+ if ((id & conn->filters[i].can_mask) ==
+ (conn->filters[i].can_id & conn->filters[i].can_mask))
+ {
+ return 1;
+ }
+ }
}
+
return 0;
}
#endif
@@ -416,46 +419,50 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
{
if ((flags & CAN_NEWDATA) != 0)
{
- /* If a new packet is available, check receive filters
- * when is valid then complete the read action. */
+ /* If a new packet is available, check receive filters
+ * when is valid then complete the read action.
+ */
#ifdef CONFIG_NET_CANPROTO_OPTIONS
- if(can_recv_filter(conn,(canid_t)*dev->d_appdata) == 0)
- {
- flags &= ~CAN_NEWDATA;
- return flags;
- }
+ if (can_recv_filter(conn, (canid_t) *dev->d_appdata) == 0)
+ {
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
#endif
- /* do not pass frames with DLC > 8 to a legacy socket */
- if (!conn->fd_frames)
- {
- struct canfd_frame *cfd = (struct canfd_frame*)dev->d_appdata;
- if (cfd->len > CAN_MAX_DLEN)
- {
- /* DO WE NEED TO CLEAR FLAGS?? */
- flags &= ~CAN_NEWDATA;
- return flags;
- }
- }
+ /* do not pass frames with DLC > 8 to a legacy socket */
+
+ if (!conn->fd_frames)
+ {
+ struct canfd_frame *cfd = (struct canfd_frame *)dev->d_appdata;
+ if (cfd->len > CAN_MAX_DLEN)
+ {
+ /* DO WE NEED TO CLEAR FLAGS?? */
+
+ flags &= ~CAN_NEWDATA;
+ return flags;
+ }
+ }
/* Copy the packet */
can_newdata(dev, pstate);
#ifdef CONFIG_NET_TIMESTAMP
- if(pstate->pr_sock->s_timestamp)
- {
- if(pstate->pr_msglen == sizeof(struct timeval))
- {
- can_readahead_timestamp(conn, pstate->pr_msgbuf);
- }
- else
- {
- /* We still have to consume the data otherwise IOB gets full */
- uint8_t dummy_buf[sizeof(struct timeval)];
- can_readahead_timestamp(conn, &dummy_buf);
- }
- }
+ if (pstate->pr_sock->s_timestamp)
+ {
+ if (pstate->pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, pstate->pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
#endif
/* We are finished. */
@@ -508,6 +515,7 @@ static ssize_t can_recvfrom_result(int result,
if (pstate->pr_result < 0)
{
/* This might return EAGAIN on a timeout */
+
return pstate->pr_result;
}
@@ -592,10 +600,10 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
ret = can_readahead(&state);
if (ret > 0)
- {
+ {
goto errout_with_state;
}
-
+
ret = state.pr_recvlen;
/* Handle non-blocking CAN sockets */
@@ -610,7 +618,7 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
{
/* Nothing was received */
- ret = -EAGAIN;
+ ret = -EAGAIN;
goto errout_with_state;
}
}
@@ -675,6 +683,7 @@ errout_with_state:
* flags Receive flags (ignored)
*
****************************************************************************/
+
#ifdef CONFIG_NET_RECVMSG_CMSG
ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
size_t len, int flags)
@@ -707,20 +716,22 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
nxsem_init(&state.pr_sem, 0, 0); /* Doesn't really fail */
nxsem_setprotocol(&state.pr_sem, SEM_PRIO_NONE);
-
state.pr_buflen = msg->msg_iov->iov_len;
state.pr_buffer = msg->msg_iov->iov_base;
+
#ifdef CONFIG_NET_TIMESTAMP
- if(psock->s_timestamp && msg->msg_controllen == (sizeof(struct cmsghdr) + sizeof(struct timeval)))
+ if (psock->s_timestamp && msg->msg_controllen ==
+ (sizeof(struct cmsghdr) + sizeof(struct timeval)))
{
- struct cmsghdr* cmsg = CMSG_FIRSTHDR(msg);
- state.pr_msglen = sizeof(struct timeval);
- state.pr_msgbuf = CMSG_DATA(cmsg);
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SO_TIMESTAMP;
- cmsg->cmsg_len = state.pr_msglen;
+ struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
+ state.pr_msglen = sizeof(struct timeval);
+ state.pr_msgbuf = CMSG_DATA(cmsg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SO_TIMESTAMP;
+ cmsg->cmsg_len = state.pr_msglen;
}
#endif
+
state.pr_sock = psock;
/* Handle any any CAN data already buffered in a read-ahead buffer. NOTE
@@ -732,20 +743,22 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
if (ret > 0)
{
#ifdef CONFIG_NET_TIMESTAMP
- if(psock->s_timestamp)
- {
- if(state.pr_msglen == sizeof(struct timeval))
- {
- can_readahead_timestamp(conn, state.pr_msgbuf);
- }
- else
- {
- /* We still have to consume the data otherwise IOB gets full */
- uint8_t dummy_buf[sizeof(struct timeval)];
- can_readahead_timestamp(conn, &dummy_buf);
- }
- }
+ if (psock->s_timestamp)
+ {
+ if (state.pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, state.pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
#endif
+
goto errout_with_state;
}
diff --git a/net/can/can_send.c b/net/can/can_send.c
index be621b4..644adc3 100644
--- a/net/can/can_send.c
+++ b/net/can/can_send.c
@@ -118,8 +118,10 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
else
{
/* Copy the packet data into the device packet buffer and send it */
- //FIXME potentialy wrong function do we have a header??
- devif_can_send(dev, pstate->snd_buffer, pstate->snd_buflen);
+
+ /* FIXME potentialy wrong function do we have a header?? */
+
+ devif_can_send(dev, pstate->snd_buffer, pstate->snd_buflen);
pstate->snd_sent = pstate->snd_buflen;
}
@@ -164,10 +166,10 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
size_t len)
{
FAR struct net_driver_s *dev;
- FAR struct can_conn_s *conn;
+ FAR struct can_conn_s *conn;
struct send_s state;
int ret = OK;
-
+
conn = (FAR struct can_conn_s *)psock->s_conn;
/* Verify that the sockfd corresponds to valid, allocated socket */
@@ -184,20 +186,20 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
{
return -ENODEV;
}
-
- if(conn->fd_frames)
+
+ if (conn->fd_frames)
{
- if(len != CANFD_MTU && len != CAN_MTU)
- {
- return -EINVAL;
- }
+ if (len != CANFD_MTU && len != CAN_MTU)
+ {
+ return -EINVAL;
+ }
}
- else
+ else
{
- if(len != CAN_MTU)
- {
- return -EINVAL;
- }
+ if (len != CAN_MTU)
+ {
+ return -EINVAL;
+ }
}
/* Perform the send operation */
@@ -236,8 +238,8 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
netdev_txnotify_dev(dev);
/* Wait for the send to complete or an error to occur.
- * net_lockedwait will also terminate if a signal is received.
- */
+ * net_lockedwait will also terminate if a signal is received.
+ */
ret = net_lockedwait(&state.snd_sem);
diff --git a/net/can/can_setsockopt.c b/net/can/can_setsockopt.c
index 659d84b..6858c1a 100644
--- a/net/can/can_setsockopt.c
+++ b/net/can/can_setsockopt.c
@@ -88,29 +88,30 @@ int can_setsockopt(FAR struct socket *psock, int option,
switch (option)
{
case CAN_RAW_FILTER:
- if (value_len == 0)
- {
- conn->filter_count = 0;
- ret = OK;
- }
- else if (value_len % sizeof(struct can_filter) != 0)
+ if (value_len == 0)
+ {
+ conn->filter_count = 0;
+ ret = OK;
+ }
+ else if (value_len % sizeof(struct can_filter) != 0)
{
ret = -EINVAL;
}
- else if (value_len > CONFIG_NET_CAN_RAW_FILTER_MAX * sizeof(struct can_filter))
+ else if (value_len > CONFIG_NET_CAN_RAW_FILTER_MAX *
+ sizeof(struct can_filter))
{
ret = -EINVAL;
}
else
{
- count = value_len / sizeof(struct can_filter);
+ count = value_len / sizeof(struct can_filter);
- for(int i = 0; i < count; i++)
- {
- conn->filters[i] = ((struct can_filter *)value)[i];
- }
+ for (int i = 0; i < count; i++)
+ {
+ conn->filters[i] = ((struct can_filter *)value)[i];
+ }
- conn->filter_count = count;
+ conn->filter_count = count;
ret = OK;
}
@@ -120,28 +121,28 @@ int can_setsockopt(FAR struct socket *psock, int option,
break;
case CAN_RAW_LOOPBACK:
- if (value_len != sizeof(conn->loopback))
- return -EINVAL;
+ if (value_len != sizeof(conn->loopback))
+ return -EINVAL;
- conn->loopback = *(FAR int32_t *)value;
+ conn->loopback = *(FAR int32_t *)value;
- break;
+ break;
case CAN_RAW_RECV_OWN_MSGS:
- if (value_len != sizeof(conn->recv_own_msgs))
- return -EINVAL;
+ if (value_len != sizeof(conn->recv_own_msgs))
+ return -EINVAL;
- conn->recv_own_msgs = *(FAR int32_t *)value;
+ conn->recv_own_msgs = *(FAR int32_t *)value;
- break;
+ break;
case CAN_RAW_FD_FRAMES:
- if (value_len != sizeof(conn->fd_frames))
- return -EINVAL;
+ if (value_len != sizeof(conn->fd_frames))
+ return -EINVAL;
- conn->fd_frames = *(FAR int32_t *)value;
+ conn->fd_frames = *(FAR int32_t *)value;
- break;
+ break;
case CAN_RAW_JOIN_FILTERS:
break;
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 844ac3b..737788e 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -154,7 +154,8 @@ static uint16_t can_poll_eventhandler(FAR struct net_driver_s *dev,
#if 0
/* A poll is a sign that we are free to send data. */
- else if ((flags & CAN_POLL) != 0 && psock_udp_cansend(info->psock) >= 0)
+ else if ((flags & CAN_POLL) != 0 &&
+ psock_udp_cansend(info->psock) >= 0)
{
eventset |= (POLLOUT & info->fds->events);
}
@@ -234,6 +235,7 @@ static int can_setup(FAR struct socket *psock, int protocol)
#ifdef CONFIG_NET_TIMESTAMP
/* Store psock in conn se we can read the SO_TIMESTAMP value */
+
conn->psock = psock;
#endif
@@ -486,7 +488,8 @@ static int can_listen(FAR struct socket *psock, int backlog)
* Perform a can connection
*
* Input Parameters:
- * psock A reference to the socket structure of the socket to be connected
+ * psock A reference to the socket structure of the socket
+ * to be connected
* addr The address of the remote server to connect to
* addrlen Length of address buffer
*
@@ -615,8 +618,8 @@ static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
info->cb = cb;
/* Initialize the callback structure. Save the reference to the info
- * structure as callback private data so that it will be available during
- * callback processing.
+ * structure as callback private data so that it will be available
+ * during callback processing.
*/
cb->flags = NETDEV_DOWN;
@@ -747,7 +750,8 @@ static ssize_t can_send(FAR struct socket *psock, FAR const void *buf,
* returned when the socket was not actually connected.
*
* Input Parameters:
- * psock A reference to the socket structure of the socket to be connected
+ * psock A reference to the socket structure of the socket
+ * to be connected
* buf Data to send
* len Length of data to send
* flags Send flags (ignored)
[incubator-nuttx] 27/31: Implement NET_CAN_RAW_TX_DEADLINE in
SocketCAN and S32K1XX FlexCAN driver
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit f08151cc60ddc05b952de091aba53c68ef18c89c
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Tue Mar 17 13:57:22 2020 +0100
Implement NET_CAN_RAW_TX_DEADLINE in SocketCAN and S32K1XX FlexCAN driver
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 195 ++++++++++++++++++++++++++++-----
net/can/Kconfig | 19 ++++
net/can/can.h | 24 ++++
net/can/can_send.c | 158 +++++++++++++++++++++++++-
net/can/can_sockif.c | 4 +-
net/devif/devif_cansend.c | 4 +-
6 files changed, 372 insertions(+), 32 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 5c02aa0..0325033 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -49,7 +49,7 @@
#include "s32k1xx_pin.h"
#include "s32k1xx_flexcan.h"
-#ifdef CONFIG_NET_TIMESTAMP
+#ifdef CONFIG_NET_CMSG
#include <sys/time.h>
#endif
@@ -117,24 +117,32 @@
#define POOL_SIZE 1
-#ifdef CONFIG_NET_TIMESTAMP
+#ifdef CONFIG_NET_CMSG
#define MSG_DATA sizeof(struct timeval)
#else
#define MSG_DATA 0
#endif
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+
+# if !defined(CONFIG_SCHED_WORKQUEUE)
+# error Work queue support is required
+# endif
+
+#define TX_TIMEOUT_WQ
+#endif
+
/* Interrupt flags for RX fifo */
#define IFLAG1_RXFIFO (CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV)
static int peak_tx_mailbox_index_ = 0;
-#ifdef WORK_QUEUE
/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per
* second.
*/
#define S32K1XX_WDDELAY (1*CLK_TCK)
-#endif
+#define S32K1XX_TXTIMEOUT ((CONFIG_NET_CAN_RAW_TX_POLL/1000)*CLK_TCK)
/****************************************************************************
* Private Types
@@ -198,6 +206,18 @@ struct mb_s
#endif
};
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+#define TX_ABORT -1
+#define TX_FREE 0
+#define TX_BUSY 1
+
+struct txmbstats
+{
+ struct timeval deadline;
+ uint32_t pending; /* -1 = abort, 0 = free, 1 = busy */
+};
+#endif
+
/* The s32k1xx_driver_s encapsulates all state information for a single
* hardware interface
*/
@@ -211,6 +231,8 @@ struct s32k1xx_driver_s
uint8_t phyaddr; /* Selected PHY address */
#ifdef WORK_QUEUE
WDOG_ID txpoll; /* TX poll timer */
+#endif
+#ifdef TX_TIMEOUT_WQ
WDOG_ID txtimeout; /* TX timeout timer */
#endif
struct work_s irqwork; /* For deferring interrupt work to the work queue */
@@ -229,6 +251,10 @@ struct s32k1xx_driver_s
struct mb_s *rx;
struct mb_s *tx;
+
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+ struct txmbstats txmb[TXMBCOUNT];
+#endif
};
/****************************************************************************
@@ -285,6 +311,10 @@ static void s32k1xx_setenable(uint32_t enable);
static void s32k1xx_setfreeze(uint32_t freeze);
static uint32_t s32k1xx_waitmcr_change(uint32_t mask,
uint32_t target_state);
+#ifdef TX_TIMEOUT_WQ
+static void s32k1xx_checkandaborttx(struct s32k1xx_driver_s *priv,
+ uint32_t mbi, struct timeval *now);
+#endif
/* Interrupt handling */
@@ -301,6 +331,10 @@ static int s32k1xx_flexcan_interrupt(int irq, FAR void *context,
static void s32k1xx_poll_work(FAR void *arg);
static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...);
#endif
+#ifdef TX_TIMEOUT_WQ
+static void s32k1xx_txtimeout_work(FAR void *arg);
+static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...);
+#endif
/* NuttX callback functions */
@@ -411,6 +445,34 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
return 0; /* No transmission for you! */
}
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+ if (priv->dev.d_sndlen > priv->dev.d_len)
+ {
+ struct timeval *tv =
+ (struct timeval *)(priv->dev.d_buf + priv->dev.d_len);
+ priv->txmb[mbi].deadline = *tv;
+ }
+ else
+ {
+ /* Default TX deadline defined in NET_CAN_RAW_DEFAULT_TX_DEADLINE */
+
+ if (CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE > 0)
+ {
+ struct timespec ts;
+ clock_systimespec(&ts);
+ priv->txmb[mbi].deadline.tv_sec = ts.tv_sec +
+ CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE / 1000000;
+ priv->txmb[mbi].deadline.tv_usec = (ts.tv_nsec / 1000) +
+ CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE % 1000000;
+ }
+ else
+ {
+ priv->txmb[mbi].deadline.tv_sec = 0;
+ priv->txmb[mbi].deadline.tv_usec = 0;
+ }
+ }
+#endif
+
peak_tx_mailbox_index_ =
(peak_tx_mailbox_index_ > mbi ? peak_tx_mailbox_index_ : mbi);
@@ -514,6 +576,16 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
regval |= mb_bit;
putreg32(regval, S32K1XX_CAN0_IMASK1);
+ /* Increment statistics */
+
+ NETDEV_TXPACKETS(&priv->dev);
+
+ /* Setup the TX timeout watchdog (perhaps restarting the timer) */
+#ifdef TX_TIMEOUT_WQ
+ wd_start(priv->txtimeout, S32K1XX_TXTIMEOUT, s32k1xx_txtimeout_expiry, 1,
+ (wdparm_t)priv);
+#endif
+
return OK;
}
@@ -544,8 +616,6 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
static int s32k1xx_txpoll(struct net_driver_s *dev)
{
- #warning Missing logic
-
FAR struct s32k1xx_driver_s *priv =
(FAR struct s32k1xx_driver_s *)dev->d_private;
@@ -560,15 +630,6 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
/* Send the packet */
s32k1xx_transmit(priv);
-#if 0
- /* FIXME implement ring buffer and increment pointer just like the
- * enet driver??
- */
-
- priv->dev.d_buf =
- (uint8_t *)s32k1xx_swap32(
- (uint32_t)priv->txdesc[priv->txhead].data);
-#endif
/* Check if there is room in the device to hold another packet. If
* not, return a non-zero value to terminate the poll.
@@ -777,15 +838,20 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
#warning Missing logic
+#ifdef TX_TIMEOUT_WQ
/* We are here because a transmission completed, so the watchdog can be
* canceled.
*/
-#ifdef WORK_QUEUE
wd_cancel(priv->txtimeout);
+
+ struct timespec ts;
+ struct timeval *now = (struct timeval *)&ts;
+ clock_systimespec(&ts);
+ now->tv_usec = ts.tv_nsec / 1000; /* timespec to timeval conversion */
#endif
- /* FIXME process aborts */
+ /* FIXME First Process Error aborts */
/* Process TX completions */
@@ -796,16 +862,17 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
flags &= ~mb_bit;
-#if 0
- /* FIXME TB ABORT SUPPORT */
+ NETDEV_TXDONE(&priv->dev);
+ }
- /* const bool txok = priv->tx[mbi].cs.code != CAN_TXMB_ABORT;
- * handleTxMailboxInterrupt(mbi, txok, utc_usec);
- */
-#endif
+#ifdef TX_TIMEOUT_WQ
+ /* MB is not done, check for timeout */
- NETDEV_TXDONE(&priv->dev);
+ else
+ {
+ s32k1xx_checkandaborttx(priv, mbi, now);
}
+#endif
mb_bit <<= 1;
}
@@ -904,7 +971,6 @@ static void s32k1xx_poll_work(FAR void *arg)
1, (wdparm_t)priv);
net_unlock();
}
-#endif
/****************************************************************************
* Function: s32k1xx_polltimer_expiry
@@ -924,7 +990,6 @@ static void s32k1xx_poll_work(FAR void *arg)
*
****************************************************************************/
-#ifdef WORK_QUEUE
static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
{
#warning Missing logic
@@ -936,6 +1001,82 @@ static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
}
#endif
+/****************************************************************************
+ * Function: s32k1xx_txtimeout_work
+ *
+ * Description:
+ * Perform TX timeout related work from the worker thread
+ *
+ * Input Parameters:
+ * arg - The argument passed when work_queue() as called.
+ *
+ * Returned Value:
+ * OK on success
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+#ifdef TX_TIMEOUT_WQ
+static void s32k1xx_checkandaborttx(struct s32k1xx_driver_s *priv,
+ uint32_t mbi, struct timeval *now)
+{
+ if (priv->txmb[mbi].deadline.tv_sec != 0
+ && (now->tv_sec > priv->txmb[mbi].deadline.tv_sec
+ || now->tv_usec > priv->txmb[mbi].deadline.tv_usec))
+ {
+ NETDEV_TXTIMEOUTS(&priv->dev);
+ struct mb_s *mb = &priv->tx[mbi];
+ mb->cs.code = CAN_TXMB_ABORT;
+ priv->txmb[mbi].pending = TX_ABORT;
+ }
+}
+
+static void s32k1xx_txtimeout_work(FAR void *arg)
+{
+ FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
+
+ struct timespec ts;
+ struct timeval *now = (struct timeval *)&ts;
+ clock_systimespec(&ts);
+ now->tv_usec = ts.tv_nsec / 1000; /* timespec to timeval conversion */
+
+ for (int i = 0; i < TXMBCOUNT; i++)
+ {
+ s32k1xx_checkandaborttx(priv, i, now);
+ }
+}
+
+/****************************************************************************
+ * Function: s32k1xx_txtimeout_expiry
+ *
+ * Description:
+ * Our TX watchdog timed out. Called from the timer interrupt handler.
+ * The last TX never completed. Reset the hardware and start again.
+ *
+ * Input Parameters:
+ * argc - The number of available arguments
+ * arg - The first argument
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Global interrupts are disabled by the watchdog logic.
+ *
+ ****************************************************************************/
+
+static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
+{
+ FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
+
+ /* Schedule to perform the TX timeout processing on the worker thread
+ */
+
+ work_queue(CANWORK, &priv->irqwork, s32k1xx_txtimeout_work, priv, 0);
+}
+
+#endif
+
static void s32k1xx_setenable(uint32_t enable)
{
uint32_t regval;
@@ -1494,6 +1635,8 @@ int s32k1xx_netinitialize(int intf)
/* Create a watchdog for timing polling for and timing of transmissions */
priv->txpoll = wd_create(); /* Create periodic poll timer */
+#endif
+#ifdef TX_TIMEOUT_WQ
priv->txtimeout = wd_create(); /* Create TX timeout timer */
#endif
priv->rx = (struct mb_s *)(S32K1XX_CAN0_MB);
diff --git a/net/can/Kconfig b/net/can/Kconfig
index ac94021..00bfabd 100644
--- a/net/can/Kconfig
+++ b/net/can/Kconfig
@@ -51,6 +51,25 @@ config NET_CAN_RAW_TX_DEADLINE
CAN frame is still in the HW TX mailbox then the CAN driver will
discard the CAN frame automatically.
+config NET_CAN_RAW_TX_POLL
+ int "TX deadline polling rate (ms) "
+ default 500
+ depends on NET_CAN_RAW_TX_DEADLINE
+ ---help---
+ The polling rate on which the CAN driver checks whenever a TX deadline occurs
+
+config NET_CAN_RAW_DEFAULT_TX_DEADLINE
+ int "Default TX deadline when no deadline is given (us)"
+ default 0
+ depends on NET_CAN_RAW_TX_DEADLINE
+ ---help---
+ Some applications may not use the NET_CAN_RAW_TX_DEADLINE flag.
+ By default their deadline becomes 0 which means it becomes infinite.
+ This would mean that packets from applications without the
+ NET_CAN_RAW_TX_DEADLINE flag, can block the TX mailboxes forever.
+ This config can set the default deadline when no deadline has been
+ given.
+
config NET_CAN_RAW_FILTER_MAX
int "CAN_RAW_FILTER max filter count"
default 32
diff --git a/net/can/can.h b/net/can/can.h
index 00c297d..a727612 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -331,6 +331,30 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
size_t len);
/****************************************************************************
+ * Name: psock_can_sendmsg
+ *
+ * Description:
+ * The psock_can_sendmsg() call may be used only when the packet socket is
+ * in a connected state (so that the intended recipient is known).
+ *
+ * Input Parameters:
+ * psock An instance of the internal socket structure.
+ * msg msg to send
+ * len Length of msg to send
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. On error,
+ * a negated errno value is returned. See send() for the complete list
+ * of return values.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NET_CMSG
+ssize_t psock_can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ size_t len);
+#endif
+
+/****************************************************************************
* Name: can_readahead_signal
*
* Description:
diff --git a/net/can/can_send.c b/net/can/can_send.c
index dfb03d0..ddfa83f 100644
--- a/net/can/can_send.c
+++ b/net/can/can_send.c
@@ -61,6 +61,10 @@
#include "socket/socket.h"
#include "can/can.h"
+#ifdef CONFIG_NET_CMSG
+#include <sys/time.h>
+#endif
+
/****************************************************************************
* Private Types
****************************************************************************/
@@ -123,10 +127,15 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
{
/* Copy the packet data into the device packet buffer and send it */
- /* FIXME potentialy wrong function do we have a header?? */
-
devif_can_send(dev, pstate->snd_buffer, pstate->snd_buflen);
pstate->snd_sent = pstate->snd_buflen;
+
+ if (pstate->pr_msglen > 0) /* concat cmsg data after packet */
+ {
+ memcpy(dev->d_buf + pstate->snd_buflen, pstate->pr_msgbuf,
+ pstate->pr_msglen);
+ dev->d_sndlen = pstate->snd_buflen + pstate->pr_msglen;
+ }
}
/* Don't allow any further call backs. */
@@ -279,4 +288,149 @@ ssize_t psock_can_send(FAR struct socket *psock, FAR const void *buf,
return state.snd_sent;
}
+/****************************************************************************
+ * Name: psock_can_sendmsg
+ *
+ * Description:
+ * The psock_can_sendmsg() call may be used only when the packet socket is
+ * in a connected state (so that the intended recipient is known).
+ *
+ * Input Parameters:
+ * psock An instance of the internal socket structure.
+ * msg msg to send
+ * len Length of msg to send
+ *
+ * Returned Value:
+ * On success, returns the number of characters sent. On error,
+ * a negated errno value is retruend. See send() for the complete list
+ * of return values.
+ *
+ ****************************************************************************/
+
+ssize_t psock_can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ size_t len)
+{
+ FAR struct net_driver_s *dev;
+ FAR struct can_conn_s *conn;
+ struct send_s state;
+ int ret = OK;
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+
+ /* Verify that the sockfd corresponds to valid, allocated socket */
+
+ if (!psock || psock->s_crefs <= 0)
+ {
+ return -EBADF;
+ }
+
+ /* Get the device driver that will service this transfer */
+
+ dev = conn->dev;
+ if (dev == NULL)
+ {
+ return -ENODEV;
+ }
+
+ if (conn->fd_frames)
+ {
+ if (msg->msg_iov->iov_len != CANFD_MTU
+ && msg->msg_iov->iov_len != CAN_MTU)
+ {
+ return -EINVAL;
+ }
+ }
+ else
+ {
+ if (msg->msg_iov->iov_len != CAN_MTU)
+ {
+ return -EINVAL;
+ }
+ }
+
+ /* Perform the send operation */
+
+ /* Initialize the state structure. This is done with the network locked
+ * because we don't want anything to happen until we are ready.
+ */
+
+ net_lock();
+ memset(&state, 0, sizeof(struct send_s));
+
+ /* This semaphore is used for signaling and, hence, should not have
+ * priority inheritance enabled.
+ */
+
+ nxsem_init(&state.snd_sem, 0, 0); /* Doesn't really fail */
+ nxsem_setprotocol(&state.snd_sem, SEM_PRIO_NONE);
+
+ state.snd_sock = psock; /* Socket descriptor */
+ state.snd_buflen = msg->msg_iov->iov_len; /* bytes to send */
+ state.snd_buffer = msg->msg_iov->iov_base; /* Buffer to send from */
+
+ if (msg->msg_controllen > sizeof(struct cmsghdr))
+ {
+ struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
+ if (conn->tx_deadline && cmsg->cmsg_level == SOL_CAN_RAW
+ && cmsg->cmsg_type == CAN_RAW_TX_DEADLINE
+ && cmsg->cmsg_len == sizeof(struct timeval))
+ {
+ state.pr_msgbuf = CMSG_DATA(cmsg); /* Buffer to cmsg data */
+ state.pr_msglen = cmsg->cmsg_len; /* len of cmsg data */
+ }
+ }
+
+ /* Allocate resource to receive a callback */
+
+ state.snd_cb = can_callback_alloc(dev, conn);
+ if (state.snd_cb)
+ {
+ /* Set up the callback in the connection */
+
+ state.snd_cb->flags = CAN_POLL;
+ state.snd_cb->priv = (FAR void *)&state;
+ state.snd_cb->event = psock_send_eventhandler;
+
+ /* Notify the device driver that new TX data is available. */
+
+ netdev_txnotify_dev(dev);
+
+ /* Wait for the send to complete or an error to occur.
+ * net_lockedwait will also terminate if a signal is received.
+ */
+
+ ret = net_lockedwait(&state.snd_sem);
+
+ /* Make sure that no further events are processed */
+
+ can_callback_free(dev, conn, state.snd_cb);
+ }
+
+ nxsem_destroy(&state.snd_sem);
+ net_unlock();
+
+ /* Check for a errors, Errors are signalled by negative errno values
+ * for the send length
+ */
+
+ if (state.snd_sent < 0)
+ {
+ return state.snd_sent;
+ }
+
+ /* If net_lockedwait failed, then we were probably reawakened by a signal.
+ * In this case, net_lockedwait will have returned negated errno
+ * appropriately.
+ */
+
+ if (ret < 0)
+ {
+ return ret;
+ }
+
+ /* Return the number of bytes actually sent */
+
+ return state.snd_sent;
+}
+
#endif /* CONFIG_NET && CONFIG_NET_CAN */
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 09a61d0..497f74b 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -797,7 +797,7 @@ static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
****************************************************************************/
#ifdef CONFIG_NET_CMSG
static ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
- size_t len, int flags);
+ size_t len, int flags)
{
ssize_t ret;
@@ -807,7 +807,7 @@ static ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
{
/* Raw packet send */
- ret = psock_can_send(psock, buf, len);
+ ret = psock_can_sendmsg(psock, msg, len);
}
else
{
diff --git a/net/devif/devif_cansend.c b/net/devif/devif_cansend.c
index 60fdf38..43570f2 100644
--- a/net/devif/devif_cansend.c
+++ b/net/devif/devif_cansend.c
@@ -80,10 +80,10 @@
****************************************************************************/
/****************************************************************************
- * Name: devif_pkt_send
+ * Name: devif_can_send
*
* Description:
- * Called from socket logic in order to send a raw packet in response to
+ * Called from socket logic in order to send a can packet in response to
* an xmit or poll request from the network interface driver.
*
* This is almost identical to calling devif_send() except that the data to
[incubator-nuttx] 14/31: SocketCAN recfrom added non-blocking
behavior support FlexCAN support sending extended CAN id
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 8d24e580c2120e61248384ba3a25f26edb832c07
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Fri Mar 6 15:20:15 2020 +0100
SocketCAN recfrom added non-blocking behavior support
FlexCAN support sending extended CAN id
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 5 +++--
net/can/can_recvfrom.c | 25 ++++++++++++++++++++++---
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index f394a20..2e73dc9 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -113,6 +113,7 @@
#define CAN_FIFO_NE (1 << 5)
#define CAN_FIFO_OV (1 << 6)
#define CAN_FIFO_WARN (1 << 7)
+#define CAN_EFF_FLAG 0x80000000 /* EFF/SFF is set in the MSB */
#define POOL_SIZE 1
@@ -463,7 +464,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
{
struct can_frame *frame = (struct can_frame *)priv->dev.d_buf;
- if (0) /* FIXME detect Std or Ext id */
+ if (frame->can_id & CAN_EFF_FLAG)
{
cs.ide = 1;
mb->id.ext = frame->can_id & MASKEXTID;
@@ -489,7 +490,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
cs.edl = 1; /* CAN FD Frame */
- if (0) /* FIXME detect Std or Ext id */
+ if (frame->can_id & CAN_EFF_FLAG)
{
cs.ide = 1;
mb->id.ext = frame->can_id & MASKEXTID;
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index f83d07c..c23af93 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -231,6 +231,8 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
/* Check there is any CAN data already buffered in a read-ahead
* buffer.
*/
+
+ pstate->pr_recvlen = -1;
if ((iob = iob_peek_queue(&conn->readahead)) != NULL &&
pstate->pr_buflen > 0)
@@ -463,10 +465,27 @@ ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
ret = can_readahead(&state);
if (ret > 0)
+ {
+ goto errout_with_state;
+ }
+
+ ret = state.pr_recvlen;
+
+ /* Handle non-blocking CAN sockets */
+
+ if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0)
{
- net_unlock();
- nxsem_destroy(&state.pr_sem);
- return ret;
+ /* Return the number of bytes read from the read-ahead buffer if
+ * something was received (already in 'ret'); EAGAIN if not.
+ */
+
+ if (ret < 0)
+ {
+ /* Nothing was received */
+
+ ret = -EAGAIN;
+ goto errout_with_state;
+ }
}
/* Get the device driver that will service this transfer */
[incubator-nuttx] 31/31: Use LPO 32Khz clock for RTC
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 5f0179e5b60ca09b2aa928867e96ee7648773d76
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Mar 18 12:27:39 2020 +0100
Use LPO 32Khz clock for RTC
---
boards/arm/s32k1xx/s32k148evb/src/s32k1xx_clockconfig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boards/arm/s32k1xx/s32k148evb/src/s32k1xx_clockconfig.c b/boards/arm/s32k1xx/s32k148evb/src/s32k1xx_clockconfig.c
index d41060b..ac597ce 100644
--- a/boards/arm/s32k1xx/s32k148evb/src/s32k1xx_clockconfig.c
+++ b/boards/arm/s32k1xx/s32k148evb/src/s32k1xx_clockconfig.c
@@ -165,7 +165,7 @@ const struct clock_configuration_s g_initial_clkconfig =
},
.lpoclk = /* Low Power Clock configuration. */
{
- .rtc_source = SIM_RTCCLK_SEL_SOSCDIV1_CLK, /* RTCCLKSEL */
+ .rtc_source = SIM_RTCCLK_SEL_LPO_32K, /* RTCCLKSEL */
.lpo_source = SIM_LPO_CLK_SEL_LPO_128K, /* LPOCLKSEL */
.initialize = true, /* Initialize */
.lpo32k = true, /* LPO32KCLKEN */
[incubator-nuttx] 16/31: SocketCAN added protocol 0 to suport
netlib_ifup with NET_PKT disabled
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit d6502bcba39aa85c9614e8bf49bf24d72157a4e9
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Mon Mar 9 13:49:11 2020 +0100
SocketCAN added protocol 0 to suport netlib_ifup with NET_PKT disabled
---
net/can/can_sockif.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 573ddd8..4deef14 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -199,6 +199,7 @@ static int can_setup(FAR struct socket *psock, int protocol)
switch (protocol)
{
+ case 0: /* INET subsystem for netlib_ifup */
case CAN_RAW: /* RAW sockets */
case CAN_BCM: /* Broadcast Manager */
case CAN_TP16: /* VAG Transport Protocol v1.6 */
[incubator-nuttx] 09/31: Added CAN FD driver support
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 437ca3a3a52abd32e4b23a8293871ac7f73ae54b
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Tue Feb 25 08:28:20 2020 +0100
Added CAN FD driver support
CAN FD receive is working in SocketCAN
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 433 +++++++++++++++++----------------
include/nuttx/can/error.h | 125 ++++++++++
2 files changed, 351 insertions(+), 207 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 50a5c18..bb0d1d0 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -32,23 +32,14 @@
#include <debug.h>
#include <errno.h>
-#include <arpa/inet.h>
-
#include <nuttx/can.h>
#include <nuttx/wdog.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/wqueue.h>
#include <nuttx/signal.h>
-#include <nuttx/net/mii.h>
-#include <nuttx/net/arp.h>
-#include <nuttx/net/phy.h>
#include <nuttx/net/netdev.h>
-#ifdef CONFIG_NET_PKT
-# include <nuttx/net/pkt.h>
-#endif
-
#include "up_arch.h"
#include "chip.h"
#include "s32k1xx_config.h"
@@ -70,6 +61,7 @@
#if !defined(CONFIG_SCHED_WORKQUEUE)
# error Work queue support is required
+ //FIXME maybe for enet not sure for FLEXCAN
#else
/* Select work queue. Always use the LP work queue if available. If not,
@@ -109,17 +101,21 @@
/* Fixme nice variables/constants */
-#define RXMBCOUNT 6
-#define FILTERCOUNT 0
-#define RXANDFILTERMBCOUNT (RXMBCOUNT + FILTERCOUNT)
-#define TXMBCOUNT 12 //???????????? why 12 idk it works
-#define TOTALMBCOUNT RXANDFILTERMBCOUNT + TXMBCOUNT
-#define TXMBMASK (((1 << TXMBCOUNT)-1) << RXANDFILTERMBCOUNT)
+#define CAN_FD
+
+#define RXMBCOUNT 5
+#define TXMBCOUNT 2
+#define TOTALMBCOUNT RXMBCOUNT + TXMBCOUNT
+
+#define IFLAG1_RX ((1 << RXMBCOUNT)-1)
+#define IFLAG1_TX (((1 << TXMBCOUNT)-1) << RXMBCOUNT)
#define CAN_FIFO_NE (1 << 5)
#define CAN_FIFO_OV (1 << 6)
#define CAN_FIFO_WARN (1 << 7)
-#define FIFO_IFLAG1 (CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV)
+
+/* Interrupt flags for RX fifo */
+#define IFLAG1_RXFIFO (CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV)
static int peak_tx_mailbox_index_ = 0;
@@ -162,40 +158,14 @@ static int peak_tx_mailbox_index_ = 0;
#define FLEXCAN_ALIGN_MASK (FLEXCAN_ALIGN - 1)
#define FLEXCAN_ALIGN_UP(n) (((n) + FLEXCAN_ALIGN_MASK) & ~FLEXCAN_ALIGN_MASK)
-/* TX timeout = 1 minute */
-
-#define S32K1XX_TXTIMEOUT (60*CLK_TCK)
-#define MII_MAXPOLLS (0x1ffff)
-#define LINK_WAITUS (500*1000)
-#define LINK_NLOOPS (10)
-
-/* Interrupt groups */
-
-#define RX_INTERRUPTS (FLEXCAN_INT_RXF | FLEXCAN_INT_RXB)
-#define TX_INTERRUPTS FLEXCAN_INT_TXF
-#define ERROR_INTERRUPTS (FLEXCAN_INT_UN | FLEXCAN_INT_RL | FLEXCAN_INT_LC | \
- FLEXCAN_INT_EBERR | FLEXCAN_INT_BABT | FLEXCAN_INT_BABR)
-
-/* The subset of errors that require us to reset the hardware - this list
- * may need to be revisited if it's found that some error above leads to a
- * locking up of the Ethernet interface.
- */
-
-#define CRITICAL_ERROR (FLEXCAN_INT_UN | FLEXCAN_INT_RL | FLEXCAN_INT_EBERR )
-
-/* This is a helper pointer for accessing the contents of the Ethernet header */
-
-#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
-
-#define S32K1XX_BUF_SIZE FLEXCAN_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE)
/****************************************************************************
* Private Types
****************************************************************************/
-union txcs_e
+union cs_e
{
- volatile uint32_t w;
+ volatile uint32_t cs;
struct
{
volatile uint32_t time_stamp : 16;
@@ -205,21 +175,10 @@ union txcs_e
volatile uint32_t srr : 1;
volatile uint32_t res : 1;
volatile uint32_t code : 4;
- volatile uint32_t res2 : 4;
- };
-};
-
-union rxcs_e
-{
- volatile uint32_t cs;
- struct
- {
- volatile uint32_t time_stamp : 16;
- volatile uint32_t dlc : 4;
- volatile uint32_t rtr : 1;
- volatile uint32_t ide : 1;
- volatile uint32_t srr : 1;
- volatile uint32_t res : 9;
+ volatile uint32_t res2 : 1;
+ volatile uint32_t esi : 1;
+ volatile uint32_t brs : 1;
+ volatile uint32_t edl : 1;
};
};
@@ -241,33 +200,25 @@ union id_e
union data_e
{
- volatile uint32_t l;
- volatile uint32_t h;
+ volatile uint32_t w00;
struct
{
- volatile uint32_t b3 : 8;
- volatile uint32_t b2 : 8;
- volatile uint32_t b1 : 8;
- volatile uint32_t b0 : 8;
- volatile uint32_t b7 : 8;
- volatile uint32_t b6 : 8;
- volatile uint32_t b5 : 8;
- volatile uint32_t b4 : 8;
+ volatile uint32_t b03 : 8;
+ volatile uint32_t b02 : 8;
+ volatile uint32_t b01 : 8;
+ volatile uint32_t b00 : 8;
};
};
-struct mbtx_s
+struct mb_s
{
- union txcs_e cs;
+ union cs_e cs;
union id_e id;
- union data_e data;
-};
-
-struct mbrx_s
-{
- union rxcs_e cs;
- union id_e id;
- union data_e data;
+#ifdef CAN_FD
+ union data_e data[16];
+#else
+ union data_e data[2];
+#endif
};
/* The s32k1xx_driver_s encapsulates all state information for a single
@@ -292,8 +243,8 @@ struct s32k1xx_driver_s
struct net_driver_s dev; /* Interface understood by the network */
- struct mbrx_s *rx;
- struct mbtx_s *tx;
+ struct mb_s *rx;
+ struct mb_s *tx;
};
/****************************************************************************
@@ -324,6 +275,28 @@ static inline uint16_t s32k1xx_swap16(uint16_t value);
#endif
#endif
+/****************************************************************************
+ * Name: arm_clz
+ *
+ * Description:
+ * Access to CLZ instructions
+ *
+ * Input Parameters:
+ * value - The value to perform the Count Leading Zeros operation on
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+static inline uint32_t arm_clz(unsigned int value)
+{
+ uint32_t ret;
+
+ __asm__ __volatile__ ("clz %0, %1" : "=r"(ret) : "r"(value));
+ return ret;
+}
+
/* Common TX logic */
static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv);
@@ -340,8 +313,8 @@ static uint32_t s32k1xx_waitmcr_change(uint32_t mask,
/* Interrupt handling */
static void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv);
-static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv);
-static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv);
+static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags);
+static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags);
static void s32k1xx_flexcan_interrupt_work(FAR void *arg);
static int s32k1xx_flexcan_interrupt(int irq, FAR void *context,
@@ -363,12 +336,6 @@ static int s32k1xx_ifdown(struct net_driver_s *dev);
static void s32k1xx_txavail_work(FAR void *arg);
static int s32k1xx_txavail(struct net_driver_s *dev);
-#ifdef CONFIG_NET_MCASTGROUP
-static int s32k1xx_addmac(struct net_driver_s *dev,
- FAR const uint8_t *mac);
-static int s32k1xx_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
-#endif
-
#ifdef CONFIG_NETDEV_IOCTL
static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
unsigned long arg);
@@ -456,11 +423,12 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
if ((getreg32(S32K1XX_CAN0_ESR2) & (CAN_ESR2_IMB | CAN_ESR2_VPS)) ==
(CAN_ESR2_IMB | CAN_ESR2_VPS))
{
- mbi = (getreg32(S32K1XX_CAN0_ESR2) & CAN_ESR2_LPTM_MASK) >>
- CAN_ESR2_LPTM_SHIFT;
+ mbi = ((getreg32(S32K1XX_CAN0_ESR2) &
+ CAN_ESR2_LPTM_MASK) >> CAN_ESR2_LPTM_SHIFT);
+ mbi -= RXMBCOUNT;
}
- uint32_t mb_bit = 1 << (RXANDFILTERMBCOUNT + mbi);
+ uint32_t mb_bit = 1 << (RXMBCOUNT + mbi);
while (mbi < TXMBCOUNT)
{
@@ -474,7 +442,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mbi++;
}
- if ((mbi - RXANDFILTERMBCOUNT) == TXMBCOUNT)
+ if (mbi == TXMBCOUNT)
{
nwarn("No TX MB available mbi %i\r\n", mbi);
return 0; /* No transmission for you! */
@@ -483,9 +451,9 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
peak_tx_mailbox_index_ =
(peak_tx_mailbox_index_ > mbi ? peak_tx_mailbox_index_ : mbi);
- union txcs_e cs;
+ union cs_e cs;
cs.code = CAN_TXMB_DATAORREMOTE;
- struct mbtx_s *mb = &priv->tx[mbi];
+ struct mb_s *mb = &priv->tx[mbi];
mb->cs.code = CAN_TXMB_INACTIVE;
if (0) /* FIXME detect Std or Ext id */
@@ -506,14 +474,14 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
/* FIXME endian swap instruction or somekind takes 1.5us right now */
- mb->data.b0 = frame->data[0];
- mb->data.b1 = frame->data[1];
- mb->data.b2 = frame->data[2];
- mb->data.b3 = frame->data[3];
- mb->data.b4 = frame->data[4];
- mb->data.b5 = frame->data[5];
- mb->data.b6 = frame->data[6];
- mb->data.b7 = frame->data[7];
+ mb->data[0].b00 = frame->data[0];
+ mb->data[0].b01 = frame->data[1];
+ mb->data[0].b02 = frame->data[2];
+ mb->data[0].b03 = frame->data[3];
+ mb->data[1].b00 = frame->data[4];
+ mb->data[1].b01 = frame->data[5];
+ mb->data[1].b02 = frame->data[6];
+ mb->data[1].b03 = frame->data[7];
#if 0
/* Registering the pending transmission so we can track its deadline and
@@ -646,77 +614,142 @@ static inline void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv)
*
****************************************************************************/
-static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv)
+static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
#warning Missing logic
+ uint32_t regval;
+
s32k1xx_gpiowrite(PIN_PORTD | PIN31, 1);
- struct can_frame frame;
- uint32_t flags = getreg32(S32K1XX_CAN0_IFLAG1);
- if ((flags & FIFO_IFLAG1) == 0)
+ //FIXME naive what if multiple flags are high??
+ uint32_t mb_index = arm_clz(flags);
+
+ if (mb_index)
{
- /* Weird, IRQ is here but no data to read */
+ struct mb_s *rf = &priv->rx[31 - mb_index];
- return;
- }
+ /* Read the frame contents */
- if (flags & CAN_FIFO_OV)
- {
-#if 0
- error_cnt_++;
-#endif
- putreg32(CAN_FIFO_OV, S32K1XX_CAN0_IFLAG1);
- }
+ if(rf->cs.edl) /* CAN FD frame */
+ {
- if (flags & CAN_FIFO_WARN)
- {
-#if 0
- fifo_warn_cnt_++;
-#endif
- putreg32(CAN_FIFO_WARN, S32K1XX_CAN0_IFLAG1);
- }
+ struct canfd_frame frame;
- if (flags & CAN_FIFO_NE)
- {
- struct mbrx_s *rf = priv->rx;
+ if (rf->cs.ide)
+ {
+ frame.can_id = MASKEXTID & rf->id.ext;
+ frame.can_id |= FLAGEFF;
+ }
+ else
+ {
+ frame.can_id = MASKSTDID & rf->id.std;
+ }
- /* Read the frame contents */
+ if (rf->cs.rtr)
+ {
+ frame.can_id |= FLAGRTR;
+ }
- if (rf->cs.ide)
- {
- frame.can_id = MASKEXTID & rf->id.ext;
- frame.can_id |= FLAGEFF;
+ if(rf->cs.dlc < 9){
+ frame.len = rf->cs.dlc;
+ } else {
+ switch(rf->cs.dlc)
+ {
+ case 9:
+ frame.len = 12;
+ break;
+
+ case 10:
+ frame.len = 16;
+ break;
+
+ case 11:
+ frame.len = 20;
+ break;
+
+ case 12:
+ frame.len = 24;
+ break;
+
+ case 13:
+ frame.len = 32;
+ break;
+
+ case 14:
+ frame.len = 48;
+ break;
+
+ case 15:
+ frame.len = 64;
+ break;
+ }
+ }
+
+ int j = 0;
+ for(int i = 0; i < (frame.len + 4 - 1) / 4; i++)
+ {
+ frame.data[0+j] = rf->data[i].b00;
+ frame.data[1+j] = rf->data[i].b01;
+ frame.data[2+j] = rf->data[i].b02;
+ frame.data[3+j] = rf->data[i].b03;
+ j = j + 4;
+ }
+
+ /* Clear MB interrupt flag */
+ regval = getreg32(S32K1XX_CAN0_IFLAG1);
+ regval |= (1 << mb_index);
+ putreg32(regval, S32K1XX_CAN0_IFLAG1);
+
+ /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
+ * in priv->dev.d_len
+ */
+
+ priv->dev.d_len = sizeof(struct canfd_frame);
+ priv->dev.d_buf = (uint8_t *)s32k1xx_swap32((uint32_t)&frame); /* FIXME */
}
- else
+ else /* CAN 2.0 Frame */
{
- frame.can_id = MASKSTDID & rf->id.std;
- }
+ struct can_frame frame;
- if (rf->cs.rtr)
- {
- frame.can_id |= FLAGRTR;
- }
+ if (rf->cs.ide)
+ {
+ frame.can_id = MASKEXTID & rf->id.ext;
+ frame.can_id |= FLAGEFF;
+ }
+ else
+ {
+ frame.can_id = MASKSTDID & rf->id.std;
+ }
- frame.can_dlc = rf->cs.dlc;
+ if (rf->cs.rtr)
+ {
+ frame.can_id |= FLAGRTR;
+ }
- frame.data[0] = rf->data.b0;
- frame.data[1] = rf->data.b1;
- frame.data[2] = rf->data.b2;
- frame.data[3] = rf->data.b3;
- frame.data[4] = rf->data.b4;
- frame.data[5] = rf->data.b5;
- frame.data[6] = rf->data.b6;
- frame.data[7] = rf->data.b7;
+ frame.can_dlc = rf->cs.dlc;
- putreg32(CAN_FIFO_NE, S32K1XX_CAN0_IFLAG1);
+ frame.data[0] = rf->data[0].b00;
+ frame.data[1] = rf->data[0].b01;
+ frame.data[2] = rf->data[0].b02;
+ frame.data[3] = rf->data[0].b03;
+ frame.data[4] = rf->data[1].b00;
+ frame.data[5] = rf->data[1].b01;
+ frame.data[6] = rf->data[1].b02;
+ frame.data[7] = rf->data[1].b03;
- /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
- * in priv->dev.d_len
- */
+ /* Clear MB interrupt flag */
+ regval = getreg32(S32K1XX_CAN0_IFLAG1);
+ regval |= (1 << mb_index);
+ putreg32(regval, S32K1XX_CAN0_IFLAG1);
- priv->dev.d_len = sizeof(struct can_frame);
- priv->dev.d_buf = (uint8_t *)s32k1xx_swap32((uint32_t)&frame); /* FIXME */
+ /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
+ * in priv->dev.d_len
+ */
+
+ priv->dev.d_len = sizeof(struct can_frame);
+ priv->dev.d_buf = (uint8_t *)s32k1xx_swap32((uint32_t)&frame); /* FIXME */
+ }
/* Invalidate the buffer so that the correct packet will be re-read
* from memory when the packet content is accessed.
@@ -753,24 +786,21 @@ static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv)
*
****************************************************************************/
-static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv)
+static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
#warning Missing logic
- uint32_t tx_iflags;
- tx_iflags = getreg32(S32K1XX_CAN0_IFLAG1) & TXMBMASK;
-
/* FIXME process aborts */
/* Process TX completions */
uint32_t mb_bit = 1 << RXMBCOUNT;
- for (uint32_t mbi = 0; tx_iflags && mbi < TXMBCOUNT; mbi++)
+ for (uint32_t mbi = 0; flags && mbi < TXMBCOUNT; mbi++)
{
- if (tx_iflags & mb_bit)
+ if (flags & mb_bit)
{
putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
- tx_iflags &= ~mb_bit;
+ flags &= ~mb_bit;
#if 0
const bool txok = priv->tx[mbi].cs.code != CAN_TXMB_ABORT;
handleTxMailboxInterrupt(mbi, txok, utc_usec);
@@ -829,19 +859,19 @@ static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
FAR struct s32k1xx_driver_s *priv = &g_flexcan[0];
uint32_t flags;
flags = getreg32(S32K1XX_CAN0_IFLAG1);
- flags &= FIFO_IFLAG1;
+ flags &= IFLAG1_RX;
if (flags)
{
- s32k1xx_receive(priv);
+ s32k1xx_receive(priv, flags);
}
flags = getreg32(S32K1XX_CAN0_IFLAG1);
- flags &= TXMBMASK;
+ flags &= IFLAG1_TX;
if (flags)
{
- s32k1xx_txdone(priv);
+ s32k1xx_txdone(priv, flags);
}
}
@@ -1271,38 +1301,18 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
return -1;
}
-#if 0
- regval = getreg32(S32K1XX_CAN0_CTRL1);
- regval |= ((0 << CAN_CTRL1_PRESDIV_SHIFT) & CAN_CTRL1_PRESDIV_MASK) |
- ((46 << CAN_CTRL1_ROPSEG_SHIFT) & CAN_CTRL1_ROPSEG_MASK) |
- ((18 << CAN_CTRL1_PSEG1_SHIFT) & CAN_CTRL1_PSEG1_MASK) |
- ((12 << CAN_CTRL1_PSEG2_SHIFT) & CAN_CTRL1_PSEG2_MASK) |
- ((12 << CAN_CTRL1_RJW_SHIFT) & CAN_CTRL1_RJW_MASK) |
- CAN_CTRL1_ERRMSK |
- CAN_CTRL1_TWRNMSK |
- CAN_CTRL1_RWRNMSK;
-
- putreg32(regval, S32K1XX_CAN0_CTRL1);
-#endif
-
-#define BIT_METHOD2
-#ifdef BIT_METHOD2
- /* CAN Bit Timing (CBT) configuration for a nominal phase of 1 Mbit/s
- * with 80 time quantas,in accordance with Bosch 2012 specification,
- * sample point at 83.75%
- */
+ /* Based on 80Mhz BUS clock calc through S32DS */
regval = getreg32(S32K1XX_CAN0_CBT);
regval |= CAN_CBT_BTF | /* Enable extended bit timing configurations
* for CAN-FD for setting up separately
* nominal and data phase */
- CAN_CBT_EPRESDIV(0) | /* Prescaler divisor factor of 1 */
- CAN_CBT_EPROPSEG(46) | /* Propagation segment of 47 time quantas */
- CAN_CBT_EPSEG1(18) | /* Phase buffer segment 1 of 19 time quantas */
- CAN_CBT_EPSEG2(12) | /* Phase buffer segment 2 of 13 time quantas */
- CAN_CBT_ERJW(12); /* Resynchronization jump width same as PSEG2 */
+ CAN_CBT_EPRESDIV(3) | /* Prescaler divisor factor of 3 */
+ CAN_CBT_EPROPSEG(7) | /* Propagation segment of 7 time quantas */
+ CAN_CBT_EPSEG1(6) | /* Phase buffer segment 1 of 6 time quantas */
+ CAN_CBT_EPSEG2(3) | /* Phase buffer segment 2 of 3 time quantas */
+ CAN_CBT_ERJW(1); /* Resynchronization jump width */
putreg32(regval, S32K1XX_CAN0_CBT);
-#endif
#ifdef CAN_FD
/* Enable CAN FD feature */
@@ -1311,17 +1321,14 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
regval |= CAN_MCR_FDEN;
putreg32(regval, S32K1XX_CAN0_MCR);
- /* CAN-FD Bit Timing (FDCBT) for a data phase of 4 Mbit/s with 20 time quantas,
- * in accordance with Bosch 2012 specification, sample point at 75%
- */
-
+ /* Based on 80Mhz BUS clock calc through S32DS */
regval = getreg32(S32K1XX_CAN0_FDCBT);
regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
- CAN_FDCBT_FPROPSEG(7) | /* Propagation semgment of 7 time quantas
+ CAN_FDCBT_FPROPSEG(15) | /* Propagation semgment of 7 time quantas
* (only register that doesn't add 1) */
- CAN_FDCBT_FPSEG1(6) | /* Phase buffer segment 1 of 7 time quantas */
- CAN_FDCBT_FPSEG2(4) | /* Phase buffer segment 2 of 5 time quantas */
- CAN_FDCBT_FRJW(4); /* Resynchorinzation jump width same as PSEG2 */
+ CAN_FDCBT_FPSEG1(1) | /* Phase buffer segment 1 of 7 time quantas */
+ CAN_FDCBT_FPSEG2(1) | /* Phase buffer segment 2 of 5 time quantas */
+ CAN_FDCBT_FRJW(1); /* Resynchorinzation jump width same as PSEG2 */
putreg32(regval, S32K1XX_CAN0_FDCBT);
/* Additional CAN-FD configurations */
@@ -1351,8 +1358,20 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
putreg32(0, S32K1XX_CAN0_RXIMR(i));
}
- putreg32(FIFO_IFLAG1 | TXMBMASK, S32K1XX_CAN0_IFLAG1);
- putreg32(FIFO_IFLAG1, S32K1XX_CAN0_IMASK1);
+ for (i = 0; i < RXMBCOUNT; i++)
+ {
+ ninfo("Set MB%i to receive %p\r\n", i, &priv->rx[i]);
+ priv->rx[i].cs.edl = 0x1;
+ priv->rx[i].cs.brs = 0x1;
+ priv->rx[i].cs.esi = 0x0;
+ priv->rx[i].cs.code = 4;
+ priv->rx[i].cs.srr = 0x0;
+ priv->rx[i].cs.ide = 0x1;
+ priv->rx[i].cs.rtr = 0x0;
+ }
+
+ putreg32(IFLAG1_RX, S32K1XX_CAN0_IFLAG1);
+ putreg32(IFLAG1_RX, S32K1XX_CAN0_IMASK1);
/* Exit freeze mode */
@@ -1432,12 +1451,12 @@ static void s32k1xx_reset(struct s32k1xx_driver_s *priv)
ninfo("MB %i %p\r\n", i, &priv->rx[i].id.w);
priv->rx[i].cs.cs = 0x0;
priv->rx[i].id.w = 0x0;
- priv->rx[i].data.l = 0x0;
- priv->rx[i].data.h = 0x0;
+ priv->rx[i].data[0].w00 = 0x0;
+ priv->rx[i].data[1].w00 = 0x0;
}
regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_RFEN | CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS |
+ regval |= CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS |
CAN_MCR_IRMQ | CAN_MCR_AEN |
(((TOTALMBCOUNT - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
putreg32(regval, S32K1XX_CAN0_MCR);
@@ -1546,9 +1565,9 @@ int s32k1xx_netinitialize(int intf)
priv->txpoll = wd_create(); /* Create periodic poll timer */
priv->txtimeout = wd_create(); /* Create TX timeout timer */
- priv->rx = (struct mbrx_s *)(S32K1XX_CAN0_MB);
- priv->tx = (struct mbtx_s *)(S32K1XX_CAN0_MB +
- (sizeof(struct mbrx_s) * RXMBCOUNT));
+ priv->rx = (struct mb_s *)(S32K1XX_CAN0_MB);
+ priv->tx = (struct mb_s *)(S32K1XX_CAN0_MB +
+ (sizeof(struct mb_s) * RXMBCOUNT));
/* Put the interface in the down state. This usually amounts to resetting
* the device and/or calling s32k1xx_ifdown().
diff --git a/include/nuttx/can/error.h b/include/nuttx/can/error.h
new file mode 100644
index 0000000..3463328
--- /dev/null
+++ b/include/nuttx/can/error.h
@@ -0,0 +1,125 @@
+/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
+/*
+ * linux/can/error.h
+ *
+ * Definitions of the CAN error messages to be filtered and passed to the user.
+ *
+ * Author: Oliver Hartkopp <ol...@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ * 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 Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * 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 _UAPI_CAN_ERROR_H
+#define _UAPI_CAN_ERROR_H
+
+#define CAN_ERR_DLC 8 /* dlc for error message frames */
+
+/* error class (mask) in can_id */
+#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
+#define CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */
+#define CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */
+#define CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */
+#define CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */
+#define CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */
+#define CAN_ERR_BUSOFF 0x00000040U /* bus off */
+#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
+#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */
+
+/* arbitration lost in bit ... / data[0] */
+#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
+ /* else bit number in bitstream */
+
+/* error status of CAN-controller / data[1] */
+#define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */
+#define CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */
+#define CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */
+#define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */
+#define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */
+#define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */
+ /* (at least one error counter exceeds */
+ /* the protocol-defined level of 127) */
+#define CAN_ERR_CRTL_ACTIVE 0x40 /* recovered to error active state */
+
+/* error in CAN protocol (type) / data[2] */
+#define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_PROT_BIT 0x01 /* single bit error */
+#define CAN_ERR_PROT_FORM 0x02 /* frame format error */
+#define CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */
+#define CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */
+#define CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */
+#define CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */
+#define CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */
+#define CAN_ERR_PROT_TX 0x80 /* error occurred on transmission */
+
+/* error in CAN protocol (location) / data[3] */
+#define CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */
+#define CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */
+#define CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/
+#define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */
+#define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */
+#define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */
+#define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */
+#define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */
+#define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */
+#define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */
+#define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */
+#define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */
+#define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */
+#define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */
+#define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */
+#define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */
+#define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */
+#define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */
+#define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */
+
+/* error status of CAN-transceiver / data[4] */
+/* CANH CANL */
+#define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */
+#define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */
+#define CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */
+
+/* controller specific additional information / data[5..7] */
+
+#endif /* _UAPI_CAN_ERROR_H */
[incubator-nuttx] 29/31: NET_CAN_RAW_TX_DEADLINE use relative time
with watchdog Instead of a polling timer,
also every mailbox get its own watchdog and gets cancelled when a tx
interrupt for the corresponding mailbox occurs.
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 0fe722cc64f6d9065aecacc924d69efd3ca16998
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Mar 18 11:33:53 2020 +0100
NET_CAN_RAW_TX_DEADLINE use relative time with watchdog
Instead of a polling timer, also every mailbox get its own watchdog
and gets cancelled when a tx interrupt for the corresponding mailbox
occurs.
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 153 ++++++++++++++++-----------------
net/can/Kconfig | 7 --
2 files changed, 75 insertions(+), 85 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 0325033..b1005d7 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -142,7 +142,6 @@ static int peak_tx_mailbox_index_ = 0;
*/
#define S32K1XX_WDDELAY (1*CLK_TCK)
-#define S32K1XX_TXTIMEOUT ((CONFIG_NET_CAN_RAW_TX_POLL/1000)*CLK_TCK)
/****************************************************************************
* Private Types
@@ -224,30 +223,30 @@ struct txmbstats
struct s32k1xx_driver_s
{
- bool bifup; /* true:ifup false:ifdown */
- uint8_t txtail; /* The oldest busy TX descriptor */
- uint8_t txhead; /* The next TX descriptor to use */
- uint8_t rxtail; /* The next RX descriptor to use */
- uint8_t phyaddr; /* Selected PHY address */
+ bool bifup; /* true:ifup false:ifdown */
+ uint8_t txtail; /* The oldest busy TX descriptor */
+ uint8_t txhead; /* The next TX descriptor to use */
+ uint8_t rxtail; /* The next RX descriptor to use */
+ uint8_t phyaddr; /* Selected PHY address */
#ifdef WORK_QUEUE
- WDOG_ID txpoll; /* TX poll timer */
+ WDOG_ID txpoll; /* TX poll timer */
#endif
#ifdef TX_TIMEOUT_WQ
- WDOG_ID txtimeout; /* TX timeout timer */
+ WDOG_ID txtimeout[TXMBCOUNT]; /* TX timeout timer */
#endif
- struct work_s irqwork; /* For deferring interrupt work to the work queue */
- struct work_s pollwork; /* For deferring poll work to the work queue */
+ struct work_s irqwork; /* For deferring interrupt work to the wq */
+ struct work_s pollwork; /* For deferring poll work to the work wq */
#ifdef CAN_FD
- struct canfd_frame *txdesc; /* A pointer to the list of TX descriptor */
- struct canfd_frame *rxdesc; /* A pointer to the list of RX descriptors */
+ struct canfd_frame *txdesc; /* A pointer to the list of TX descriptor */
+ struct canfd_frame *rxdesc; /* A pointer to the list of RX descriptors */
#else
- struct can_frame *txdesc; /* A pointer to the list of TX descriptor */
- struct can_frame *rxdesc; /* A pointer to the list of RX descriptors */
+ struct can_frame *txdesc; /* A pointer to the list of TX descriptor */
+ struct can_frame *rxdesc; /* A pointer to the list of RX descriptors */
#endif
/* This holds the information visible to the NuttX network */
- struct net_driver_s dev; /* Interface understood by the network */
+ struct net_driver_s dev; /* Interface understood by the network */
struct mb_s *rx;
struct mb_s *tx;
@@ -311,10 +310,6 @@ static void s32k1xx_setenable(uint32_t enable);
static void s32k1xx_setfreeze(uint32_t freeze);
static uint32_t s32k1xx_waitmcr_change(uint32_t mask,
uint32_t target_state);
-#ifdef TX_TIMEOUT_WQ
-static void s32k1xx_checkandaborttx(struct s32k1xx_driver_s *priv,
- uint32_t mbi, struct timeval *now);
-#endif
/* Interrupt handling */
@@ -446,31 +441,41 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
}
#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
- if (priv->dev.d_sndlen > priv->dev.d_len)
+ int32_t timeout = 0;
+ struct timespec ts;
+ clock_systimespec(&ts);
+
+ if (priv->dev.d_sndlen > priv->dev.d_len)
+ {
+ struct timeval *tv =
+ (struct timeval *)(priv->dev.d_buf + priv->dev.d_len);
+ priv->txmb[mbi].deadline = *tv;
+ timeout = (tv->tv_sec - ts.tv_sec)*CLK_TCK
+ + ((tv->tv_usec - ts.tv_nsec / 1000)*CLK_TCK) / 1000000;
+ if (timeout < 0)
+ {
+ return 0; /* No transmission for you! */
+ }
+ }
+ else
+ {
+ /* Default TX deadline defined in NET_CAN_RAW_DEFAULT_TX_DEADLINE */
+
+ if (CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE > 0)
{
- struct timeval *tv =
- (struct timeval *)(priv->dev.d_buf + priv->dev.d_len);
- priv->txmb[mbi].deadline = *tv;
+ timeout = ((CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE / 1000000)
+ *CLK_TCK);
+ priv->txmb[mbi].deadline.tv_sec = ts.tv_sec +
+ CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE / 1000000;
+ priv->txmb[mbi].deadline.tv_usec = (ts.tv_nsec / 1000) +
+ CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE % 1000000;
}
else
{
- /* Default TX deadline defined in NET_CAN_RAW_DEFAULT_TX_DEADLINE */
-
- if (CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE > 0)
- {
- struct timespec ts;
- clock_systimespec(&ts);
- priv->txmb[mbi].deadline.tv_sec = ts.tv_sec +
- CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE / 1000000;
- priv->txmb[mbi].deadline.tv_usec = (ts.tv_nsec / 1000) +
- CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE % 1000000;
- }
- else
- {
- priv->txmb[mbi].deadline.tv_sec = 0;
- priv->txmb[mbi].deadline.tv_usec = 0;
- }
+ priv->txmb[mbi].deadline.tv_sec = 0;
+ priv->txmb[mbi].deadline.tv_usec = 0;
}
+ }
#endif
peak_tx_mailbox_index_ =
@@ -580,10 +585,14 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
NETDEV_TXPACKETS(&priv->dev);
- /* Setup the TX timeout watchdog (perhaps restarting the timer) */
#ifdef TX_TIMEOUT_WQ
- wd_start(priv->txtimeout, S32K1XX_TXTIMEOUT, s32k1xx_txtimeout_expiry, 1,
- (wdparm_t)priv);
+ /* Setup the TX timeout watchdog (perhaps restarting the timer) */
+
+ if (timeout > 0)
+ {
+ wd_start(priv->txtimeout[mbi], timeout + 1, s32k1xx_txtimeout_expiry,
+ 1, (wdparm_t)priv);
+ }
#endif
return OK;
@@ -838,19 +847,6 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
#warning Missing logic
-#ifdef TX_TIMEOUT_WQ
- /* We are here because a transmission completed, so the watchdog can be
- * canceled.
- */
-
- wd_cancel(priv->txtimeout);
-
- struct timespec ts;
- struct timeval *now = (struct timeval *)&ts;
- clock_systimespec(&ts);
- now->tv_usec = ts.tv_nsec / 1000; /* timespec to timeval conversion */
-#endif
-
/* FIXME First Process Error aborts */
/* Process TX completions */
@@ -863,16 +859,14 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
flags &= ~mb_bit;
NETDEV_TXDONE(&priv->dev);
- }
-
#ifdef TX_TIMEOUT_WQ
- /* MB is not done, check for timeout */
+ /* We are here because a transmission completed, so the
+ * corresponding watchdog can be canceled.
+ */
- else
- {
- s32k1xx_checkandaborttx(priv, mbi, now);
- }
+ wd_cancel(priv->txtimeout[mbi]);
#endif
+ }
mb_bit <<= 1;
}
@@ -1017,19 +1011,6 @@ static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
*
****************************************************************************/
#ifdef TX_TIMEOUT_WQ
-static void s32k1xx_checkandaborttx(struct s32k1xx_driver_s *priv,
- uint32_t mbi, struct timeval *now)
-{
- if (priv->txmb[mbi].deadline.tv_sec != 0
- && (now->tv_sec > priv->txmb[mbi].deadline.tv_sec
- || now->tv_usec > priv->txmb[mbi].deadline.tv_usec))
- {
- NETDEV_TXTIMEOUTS(&priv->dev);
- struct mb_s *mb = &priv->tx[mbi];
- mb->cs.code = CAN_TXMB_ABORT;
- priv->txmb[mbi].pending = TX_ABORT;
- }
-}
static void s32k1xx_txtimeout_work(FAR void *arg)
{
@@ -1040,9 +1021,21 @@ static void s32k1xx_txtimeout_work(FAR void *arg)
clock_systimespec(&ts);
now->tv_usec = ts.tv_nsec / 1000; /* timespec to timeval conversion */
- for (int i = 0; i < TXMBCOUNT; i++)
+ /* The watchdog timed out, yet we still check mailboxes in case the
+ * transmit function transmitted a new frame
+ */
+
+ for (int mbi = 0; mbi < TXMBCOUNT; mbi++)
{
- s32k1xx_checkandaborttx(priv, i, now);
+ if (priv->txmb[mbi].deadline.tv_sec != 0
+ && (now->tv_sec > priv->txmb[mbi].deadline.tv_sec
+ || now->tv_usec > priv->txmb[mbi].deadline.tv_usec))
+ {
+ NETDEV_TXTIMEOUTS(&priv->dev);
+ struct mb_s *mb = &priv->tx[mbi];
+ mb->cs.code = CAN_TXMB_ABORT;
+ priv->txmb[mbi].pending = TX_ABORT;
+ }
}
}
@@ -1637,7 +1630,11 @@ int s32k1xx_netinitialize(int intf)
priv->txpoll = wd_create(); /* Create periodic poll timer */
#endif
#ifdef TX_TIMEOUT_WQ
- priv->txtimeout = wd_create(); /* Create TX timeout timer */
+ for (int i = 0; i < TXMBCOUNT; i++)
+ {
+ priv->txtimeout[i] = wd_create(); /* Create TX timeout timer */
+ }
+
#endif
priv->rx = (struct mb_s *)(S32K1XX_CAN0_MB);
priv->tx = (struct mb_s *)(S32K1XX_CAN0_MB +
diff --git a/net/can/Kconfig b/net/can/Kconfig
index 00bfabd..731a12b 100644
--- a/net/can/Kconfig
+++ b/net/can/Kconfig
@@ -51,13 +51,6 @@ config NET_CAN_RAW_TX_DEADLINE
CAN frame is still in the HW TX mailbox then the CAN driver will
discard the CAN frame automatically.
-config NET_CAN_RAW_TX_POLL
- int "TX deadline polling rate (ms) "
- default 500
- depends on NET_CAN_RAW_TX_DEADLINE
- ---help---
- The polling rate on which the CAN driver checks whenever a TX deadline occurs
-
config NET_CAN_RAW_DEFAULT_TX_DEADLINE
int "Default TX deadline when no deadline is given (us)"
default 0
[incubator-nuttx] 19/31: Added support for SO_TIMESTAMP in
socketlayer and SocketCAN Cleanup FlexCAN driver driver Disabled workqueue
based TX in FlexCAN
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit e01749593b5292368c6cb5be9a2bb1dbe3798199
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Mar 11 16:13:18 2020 +0100
Added support for SO_TIMESTAMP in socketlayer and SocketCAN
Cleanup FlexCAN driver driver
Disabled workqueue based TX in FlexCAN
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 228 +++++------------------------
include/nuttx/net/net.h | 7 +
libs/libc/net/lib_recvmsg.c | 4 +-
net/bluetooth/bluetooth_sockif.c | 3 +
net/can/can.h | 28 ++++
net/can/can_callback.c | 16 +++
net/can/can_recvfrom.c | 252 +++++++++++++++++++++++++++++++++
net/can/can_sockif.c | 10 +-
net/icmp/icmp_sockif.c | 3 +
net/icmpv6/icmpv6_sockif.c | 3 +
net/ieee802154/ieee802154_sockif.c | 3 +
net/inet/inet_sockif.c | 3 +
net/local/local_sockif.c | 3 +
net/netlink/netlink_sockif.c | 3 +
net/pkt/pkt_sockif.c | 3 +
net/socket/Kconfig | 16 +++
net/socket/Make.defs | 5 +
net/socket/getsockopt.c | 13 ++
net/socket/setsockopt.c | 24 ++++
net/socket/socket.h | 2 +-
20 files changed, 430 insertions(+), 199 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 2e73dc9..8e79833 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -59,9 +59,14 @@
* is required.
*/
+
+/* FIXME A workqueue is required for enet but for FLEXCAN it increased the
+ * transmit latency by ~ 40us from 24 to 67us
+ * Therefore for now its configurable by the WORK_QUEUE define
+ * If we know for sure that a workqueue isn't required
+ * Then all WORK_QUEUE related code will be removed */
#if !defined(CONFIG_SCHED_WORKQUEUE)
-# error Work queue support is required
- //FIXME maybe for enet not sure for FLEXCAN
+//# error Work queue support is required
#else
/* Select work queue. Always use the LP work queue if available. If not,
@@ -72,28 +77,14 @@
* processing that never suspends. Suspending the high priority work queue
* may bring the system to its knees!
*/
-
-# define ETHWORK LPWORK
+//# define WORK_QUEUE
+# define CANWORK LPWORK
#endif
/* CONFIG_S32K1XX_FLEXCAN_NETHIFS determines the number of physical interfaces
* that will be supported.
*/
-#if 0
-#if CONFIG_S32K1XX_FLEXCAN_NETHIFS != 1
-# error "CONFIG_S32K1XX_FLEXCAN_NETHIFS must be one for now"
-#endif
-
-#if CONFIG_S32K1XX_FLEXCAN_NTXBUFFERS < 1
-# error "Need at least one TX buffer"
-#endif
-
-#if CONFIG_S32K1XX_FLEXCAN_NRXBUFFERS < 1
-# error "Need at least one RX buffer"
-#endif
-#endif
-
#define MASKSTDID 0x000007ff
#define MASKEXTID 0x1fffffff
#define FLAGEFF (1 << 31) /* Extended frame format */
@@ -122,45 +113,13 @@
static int peak_tx_mailbox_index_ = 0;
-/* Normally you would clean the cache after writing new values to the DMA
- * memory so assure that the dirty cache lines are flushed to memory
- * before the DMA occurs. And you would invalid the cache after a data is
- * received via DMA so that you fetch the actual content of the data from
- * the cache.
- *
- * These conditions are not fully supported here. If the write-throuch
- * D-Cache is enabled, however, then many of these issues go away: The
- * cache clean operation does nothing (because there are not dirty cache
- * lines) and the cache invalid operation is innocuous (because there are
- * never dirty cache lines to be lost; valid data will always be reloaded).
- *
- * At present, we simply insist that write through cache be enabled.
- */
-
-#if defined(CONFIG_ARMV7M_DCACHE) && !defined(CONFIG_ARMV7M_DCACHE_WRITETHROUGH)
-# error Write back D-Cache not yet supported
-#endif
-
+#ifdef WORK_QUEUE
/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per
* second.
*/
#define S32K1XX_WDDELAY (1*CLK_TCK)
-
-/* Align assuming that the D-Cache is enabled (probably 32-bytes).
- *
- * REVISIT: The size of descriptors and buffers must also be in even units
- * of the cache line size That is because the operations to clean and
- * invalidate the cache will operate on a full 32-byte cache line. If
- * CONFIG_FLEXCAN_ENHANCEDBD is selected, then the size of the descriptor is
- * 32-bytes (and probably already the correct size for the cache line);
- * otherwise, the size of the descriptors much smaller, only 8 bytes.
- */
-
-#define FLEXCAN_ALIGN ARMV7M_DCACHE_LINESIZE
-#define FLEXCAN_ALIGN_MASK (FLEXCAN_ALIGN - 1)
-#define FLEXCAN_ALIGN_UP(n) (((n) + FLEXCAN_ALIGN_MASK) & ~FLEXCAN_ALIGN_MASK)
-
+#endif
/****************************************************************************
* Private Types
@@ -235,8 +194,10 @@ struct s32k1xx_driver_s
uint8_t txhead; /* The next TX descriptor to use */
uint8_t rxtail; /* The next RX descriptor to use */
uint8_t phyaddr; /* Selected PHY address */
+#ifdef WORK_QUEUE
WDOG_ID txpoll; /* TX poll timer */
WDOG_ID txtimeout; /* TX timeout timer */
+#endif
struct work_s irqwork; /* For deferring interrupt work to the work queue */
struct work_s pollwork; /* For deferring poll work to the work queue */
#ifdef CAN_FD
@@ -276,21 +237,6 @@ static uint8_t g_rx_pool[sizeof(struct can_frame)*POOL_SIZE]
* Private Function Prototypes
****************************************************************************/
-/* Utility functions */
-
-#ifndef S32K1XX_BUFFERS_SWAP
-# define s32k1xx_swap32(value) (value)
-# define s32k1xx_swap16(value) (value)
-#else
-#if 0 /* Use builtins if the compiler supports them */
-static inline uint32_t s32k1xx_swap32(uint32_t value);
-static inline uint16_t s32k1xx_swap16(uint16_t value);
-#else
-# define s32k1xx_swap32 __builtin_bswap32
-# define s32k1xx_swap16 __builtin_bswap16
-#endif
-#endif
-
/****************************************************************************
* Name: arm_clz
*
@@ -328,21 +274,17 @@ static uint32_t s32k1xx_waitmcr_change(uint32_t mask,
/* Interrupt handling */
-static void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv);
static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv, uint32_t flags);
static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags);
-static void s32k1xx_flexcan_interrupt_work(FAR void *arg);
static int s32k1xx_flexcan_interrupt(int irq, FAR void *context,
FAR void *arg);
/* Watchdog timer expirations */
-
-static void s32k1xx_txtimeout_work(FAR void *arg);
-static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...);
-
+#ifdef WORK_QUEUE
static void s32k1xx_poll_work(FAR void *arg);
static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...);
+#endif
/* NuttX callback functions */
@@ -359,7 +301,6 @@ static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
/* Initialization */
-static void s32k1xx_initbuffers(struct s32k1xx_driver_s *priv);
static int s32k1xx_initialize(struct s32k1xx_driver_s *priv);
static void s32k1xx_reset(struct s32k1xx_driver_s *priv);
@@ -632,28 +573,6 @@ static int s32k1xx_txpoll(struct net_driver_s *dev)
return 0;
}
-/****************************************************************************
- * Function: s32k1xx_dispatch
- *
- * Description:
- * A new Rx packet was received; dispatch that packet to the network layer
- * as necessary.
- *
- * Input Parameters:
- * priv - Reference to the driver state structure
- *
- * Returned Value:
- * None
- *
- * Assumptions:
- * Global interrupts are disabled by interrupt handling logic.
- *
- ****************************************************************************/
-
-static inline void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv)
-{
- #warning Missing logic
-}
/****************************************************************************
* Function: s32k1xx_receive
@@ -841,7 +760,9 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
* canceled.
*/
+#ifdef WORK_QUEUE
wd_cancel(priv->txtimeout);
+#endif
/* FIXME process aborts */
@@ -854,7 +775,7 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
{
putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
flags &= ~mb_bit;
-#if 0
+#if 0 //FIXME TB ABORT SUPPORT
const bool txok = priv->tx[mbi].cs.code != CAN_TXMB_ABORT;
handleTxMailboxInterrupt(mbi, txok, utc_usec);
#endif
@@ -872,27 +793,6 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv, uint32_t flags)
devif_poll(&priv->dev, s32k1xx_txpoll);
}
-/****************************************************************************
- * Function: s32k1xx_flexcan_interrupt_work
- *
- * Description:
- * Perform interrupt related work from the worker thread
- *
- * Input Parameters:
- * arg - The argument passed when work_queue() was called.
- *
- * Returned Value:
- * OK on success
- *
- * Assumptions:
- * The network is locked.
- *
- ****************************************************************************/
-
-static void s32k1xx_flexcan_interrupt_work(FAR void *arg)
-{
- #warning Missing logic
-}
/****************************************************************************
* Function: s32k1xx_flexcan_interrupt
@@ -937,53 +837,6 @@ static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
}
/****************************************************************************
- * Function: s32k1xx_txtimeout_work
- *
- * Description:
- * Perform TX timeout related work from the worker thread
- *
- * Input Parameters:
- * arg - The argument passed when work_queue() as called.
- *
- * Returned Value:
- * OK on success
- *
- * Assumptions:
- *
- ****************************************************************************/
-
-static void s32k1xx_txtimeout_work(FAR void *arg)
-{
- #warning Missing logic
- ninfo("FLEXCAN: tx timeout work\r\n");
-}
-
-/****************************************************************************
- * Function: s32k1xx_txtimeout_expiry
- *
- * Description:
- * Our TX watchdog timed out. Called from the timer interrupt handler.
- * The last TX never completed. Reset the hardware and start again.
- *
- * Input Parameters:
- * argc - The number of available arguments
- * arg - The first argument
- *
- * Returned Value:
- * None
- *
- * Assumptions:
- * Global interrupts are disabled by the watchdog logic.
- *
- ****************************************************************************/
-
-static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
-{
- #warning Missing logic
- ninfo("FLEXCAN: tx timeout expiry\r\n");
-}
-
-/****************************************************************************
* Function: s32k1xx_poll_work
*
* Description:
@@ -999,7 +852,7 @@ static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
* The network is locked.
*
****************************************************************************/
-
+#ifdef WORK_QUEUE
static void s32k1xx_poll_work(FAR void *arg)
{
#warning Missing logic
@@ -1027,6 +880,7 @@ static void s32k1xx_poll_work(FAR void *arg)
1, (wdparm_t)priv);
net_unlock();
}
+#endif
/****************************************************************************
* Function: s32k1xx_polltimer_expiry
@@ -1046,6 +900,7 @@ static void s32k1xx_poll_work(FAR void *arg)
*
****************************************************************************/
+#ifdef WORK_QUEUE
static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
{
#warning Missing logic
@@ -1053,8 +908,9 @@ static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
/* Schedule to perform the poll processing on the worker thread. */
- work_queue(ETHWORK, &priv->pollwork, s32k1xx_poll_work, priv, 0);
+ work_queue(CANWORK, &priv->pollwork, s32k1xx_poll_work, priv, 0);
}
+#endif
static void s32k1xx_setenable(uint32_t enable)
{
@@ -1140,7 +996,6 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
{
FAR struct s32k1xx_driver_s *priv =
(FAR struct s32k1xx_driver_s *)dev->d_private;
- uint32_t regval;
#warning Missing logic
@@ -1150,10 +1005,12 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
return -1;
}
- /* Set and activate a timer process */
+#ifdef WORK_QUEUE
+ /* Set and activate a timer process */
wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, 1,
(wdparm_t)priv);
+#endif
priv->bifup = true;
@@ -1270,10 +1127,10 @@ static int s32k1xx_txavail(struct net_driver_s *dev)
{
/* Schedule to serialize the poll on the worker thread. */
-#ifdef WORK_QUEUE_BYPASS
- s32k1xx_txavail_work(priv);
+#ifdef WORK_QUEUE
+ work_queue(CANWORK, &priv->pollwork, s32k1xx_txavail_work, priv, 0);
#else
- work_queue(ETHWORK, &priv->pollwork, s32k1xx_txavail_work, priv, 0);
+ s32k1xx_txavail_work(priv);
#endif
}
@@ -1413,6 +1270,7 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
for (i = TXMBCOUNT; i < TOTALMBCOUNT; i++)
{
priv->rx[i].id.w = 0x0;
+ //FIXME sometimes we get a hard fault here
}
putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
@@ -1450,27 +1308,6 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
}
/****************************************************************************
- * Function: s32k1xx_initbuffers
- *
- * Description:
- * Initialize FLEXCAN buffers and descriptors
- *
- * Input Parameters:
- * priv - Reference to the private FLEXCAN driver state structure
- *
- * Returned Value:
- * None
- *
- * Assumptions:
- *
- ****************************************************************************/
-
-static void s32k1xx_initbuffers(struct s32k1xx_driver_s *priv)
-{
- #warning Missing logic
-}
-
-/****************************************************************************
* Function: s32k1xx_reset
*
* Description:
@@ -1621,14 +1458,15 @@ int s32k1xx_netinitialize(int intf)
priv->dev.d_ifdown = s32k1xx_ifdown; /* I/F down callback */
priv->dev.d_txavail = s32k1xx_txavail; /* New TX data callback */
#ifdef CONFIG_NETDEV_IOCTL
- priv->dev.d_ioctl = s32k1xx_ioctl; /* Support PHY ioctl() calls */
+ priv->dev.d_ioctl = s32k1xx_ioctl; /* Support CAN ioctl() calls */
#endif
priv->dev.d_private = (void *)g_flexcan; /* Used to recover private state from dev */
+#ifdef WORK_QUEUE
/* Create a watchdog for timing polling for and timing of transmissions */
-
priv->txpoll = wd_create(); /* Create periodic poll timer */
priv->txtimeout = wd_create(); /* Create TX timeout timer */
+#endif
priv->rx = (struct mb_s *)(S32K1XX_CAN0_MB);
priv->tx = (struct mb_s *)(S32K1XX_CAN0_MB +
(sizeof(struct mb_s) * RXMBCOUNT));
diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 8c11db7..30808b1 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -215,6 +215,10 @@ struct sock_intf_s
CODE ssize_t (*si_recvfrom)(FAR struct socket *psock, FAR void *buf,
size_t len, int flags, FAR struct sockaddr *from,
FAR socklen_t *fromlen);
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ CODE ssize_t (*si_recvmsg)(FAR struct socket *psock,
+ FAR struct msghdr *msg, int flags);
+#endif
CODE int (*si_close)(FAR struct socket *psock);
#ifdef CONFIG_NET_USRSOCK
CODE int (*si_ioctl)(FAR struct socket *psock, int cmd,
@@ -271,6 +275,9 @@ struct socket
#ifdef CONFIG_NET_SOLINGER
socktimeo_t s_linger; /* Linger timeout value (in deciseconds) */
#endif
+#ifdef CONFIG_NET_TIMESTAMP
+ int32_t s_timestamp; /* Socket timestamp enabled/disabled */
+#endif
#endif
FAR void *s_conn; /* Connection inherits from struct socket_conn_s */
diff --git a/libs/libc/net/lib_recvmsg.c b/libs/libc/net/lib_recvmsg.c
index 984a16f..2513dfa 100644
--- a/libs/libc/net/lib_recvmsg.c
+++ b/libs/libc/net/lib_recvmsg.c
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
-#ifdef CONFIG_NET
+#if defined(CONFIG_NET) && !defined(CONFIG_NET_RECVMSG_CMSG)
#include <sys/types.h>
#include <sys/socket.h>
@@ -86,4 +86,4 @@ ssize_t recvmsg(int sockfd, FAR struct msghdr *msg, int flags)
}
}
-#endif /* CONFIG_NET */
+#endif /* CONFIG_NET && !CONFIG_NET_RECVMSG_CMSG */
diff --git a/net/bluetooth/bluetooth_sockif.c b/net/bluetooth/bluetooth_sockif.c
index 41bcafa..4f4b936 100644
--- a/net/bluetooth/bluetooth_sockif.c
+++ b/net/bluetooth/bluetooth_sockif.c
@@ -109,6 +109,9 @@ const struct sock_intf_s g_bluetooth_sockif =
NULL, /* si_sendfile */
#endif
bluetooth_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
bluetooth_close /* si_close */
};
diff --git a/net/can/can.h b/net/can/can.h
index e5d45f0..c74fca4 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -115,6 +115,10 @@ struct can_conn_s
/* TODO add filter support */
#endif
+#ifdef CONFIG_NET_TIMESTAMP
+ FAR struct socket *psock; /* Needed to get SO_TIMESTAMP value */
+#endif
+
};
@@ -254,11 +258,35 @@ uint16_t can_datahandler(FAR struct can_conn_s *conn, FAR uint8_t *buffer,
*
****************************************************************************/
+
ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
int flags, FAR struct sockaddr *from,
FAR socklen_t *fromlen);
/****************************************************************************
+ * Name: can_recvmsg
+ *
+ * Description:
+ * recvmsg() receives messages from a socket, and may be used to receive
+ * data on a socket whether or not it is connection-oriented.
+ *
+ * If from is not NULL, and the underlying protocol provides the source
+ * address, this source address is filled in. The argument 'fromlen'
+ * initialized to the size of the buffer associated with from, and modified
+ * on return to indicate the actual size of the address stored there.
+ *
+ * Input Parameters:
+ * psock A pointer to a NuttX-specific, internal socket structure
+ * msg Buffer to receive msg
+ * flags Receive flags (ignored)
+ *
+ ****************************************************************************/
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ size_t len, int flags);
+#endif
+
+/****************************************************************************
* Name: can_poll
*
* Description:
diff --git a/net/can/can_callback.c b/net/can/can_callback.c
index 7b923d3..f8bff86 100644
--- a/net/can/can_callback.c
+++ b/net/can/can_callback.c
@@ -35,6 +35,10 @@
#include "devif/devif.h"
#include "can/can.h"
+#ifdef CONFIG_NET_TIMESTAMP
+#include <sys/time.h>
+#endif
+
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -114,6 +118,18 @@ uint16_t can_callback(FAR struct net_driver_s *dev,
if (conn)
{
+#ifdef CONFIG_NET_TIMESTAMP
+ /* TIMESTAMP sockopt is activated, create timestamp and copy to iob */
+ if(conn->psock->s_timestamp)
+ {
+ struct timespec *ts = (struct timespec*)&dev->d_appdata[dev->d_len];
+ struct timeval *tv = (struct timeval*)&dev->d_appdata[dev->d_len];
+ dev->d_len += sizeof(struct timeval);
+ clock_systimespec(ts);
+ tv->tv_usec = ts->tv_nsec / 1000;
+ }
+#endif
+
/* Perform the callback */
flags = devif_conn_event(dev, conn, flags, conn->list);
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
index 06b133c..98a0b2a 100644
--- a/net/can/can_recvfrom.c
+++ b/net/can/can_recvfrom.c
@@ -46,6 +46,11 @@
#include "socket/socket.h"
#include <netpacket/packet.h>
+#ifdef CONFIG_NET_TIMESTAMP
+#include <sys/time.h>
+#endif
+
+
/****************************************************************************
* Private Types
****************************************************************************/
@@ -58,6 +63,10 @@ struct can_recvfrom_s
size_t pr_buflen; /* Length of receive buffer */
FAR uint8_t *pr_buffer; /* Pointer to receive buffer */
ssize_t pr_recvlen; /* The received length */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ size_t pr_msglen; /* Length of msg buffer */
+ FAR uint8_t *pr_msgbuf; /* Pointer to msg buffer */
+#endif
int pr_result; /* Success:OK, failure:negated errno */
};
@@ -294,6 +303,79 @@ static inline int can_readahead(struct can_recvfrom_s *pstate)
return 0;
}
+/****************************************************************************
+ * Name: can_readahead
+ *
+ * Description:
+ * Copy the read-ahead data from the packet
+ *
+ * Input Parameters:
+ * pstate recvfrom state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+#ifdef CONFIG_NET_TIMESTAMP
+static inline int can_readahead_timestamp(struct can_conn_s *conn, FAR uint8_t *buffer)
+{
+ FAR struct iob_s *iob;
+ int recvlen;
+
+
+ if ((iob = iob_peek_queue(&conn->readahead)) != NULL)
+ {
+ DEBUGASSERT(iob->io_pktlen > 0);
+
+ /* Transfer that buffered data from the I/O buffer chain into
+ * the user buffer.
+ */
+
+ recvlen = iob_copyout(buffer, iob, sizeof(struct timeval), 0);
+
+ /* If we took all of the data from the I/O buffer chain is empty, then
+ * release it. If there is still data available in the I/O buffer
+ * chain, then just trim the data that we have taken from the
+ * beginning of the I/O buffer chain.
+ */
+
+ if (recvlen >= iob->io_pktlen)
+ {
+ FAR struct iob_s *tmp;
+
+ /* Remove the I/O buffer chain from the head of the read-ahead
+ * buffer queue.
+ */
+
+ tmp = iob_remove_queue(&conn->readahead);
+ DEBUGASSERT(tmp == iob);
+ UNUSED(tmp);
+
+ /* And free the I/O buffer chain */
+
+ iob_free_chain(iob, IOBUSER_NET_CAN_READAHEAD);
+ }
+ else
+ {
+ /* The bytes that we have received from the head of the I/O
+ * buffer chain (probably changing the head of the I/O
+ * buffer queue).
+ */
+
+ iob_trimhead_queue(&conn->readahead, recvlen,
+ IOBUSER_NET_CAN_READAHEAD);
+ }
+
+ return recvlen;
+ }
+
+ return 0;
+}
+#endif
+
#ifdef CONFIG_NET_CANPROTO_OPTIONS
static int can_recv_filter(struct can_conn_s *conn, canid_t id)
{
@@ -360,6 +442,22 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
can_newdata(dev, pstate);
+#ifdef CONFIG_NET_TIMESTAMP
+ if(pstate->pr_sock->s_timestamp)
+ {
+ if(pstate->pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, pstate->pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
+#endif
+
/* We are finished. */
/* Don't allow any further call backs. */
@@ -559,4 +657,158 @@ errout_with_state:
return ret;
}
+/****************************************************************************
+ * Name: can_recvmsg
+ *
+ * Description:
+ * recvmsg() receives messages from a socket, and may be used to receive
+ * data on a socket whether or not it is connection-oriented.
+ *
+ * If from is not NULL, and the underlying protocol provides the source
+ * address, this source address is filled in. The argument 'fromlen'
+ * initialized to the size of the buffer associated with from, and modified
+ * on return to indicate the actual size of the address stored there.
+ *
+ * Input Parameters:
+ * psock A pointer to a NuttX-specific, internal socket structure
+ * msg Buffer to receive msg
+ * flags Receive flags (ignored)
+ *
+ ****************************************************************************/
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
+ size_t len, int flags)
+{
+ FAR struct can_conn_s *conn;
+ FAR struct net_driver_s *dev;
+ struct can_recvfrom_s state;
+ int ret;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL && msg != NULL);
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+
+ if (psock->s_type != SOCK_RAW)
+ {
+ nerr("ERROR: Unsupported socket type: %d\n", psock->s_type);
+ ret = -ENOSYS;
+ }
+
+ net_lock();
+
+ /* Initialize the state structure. */
+
+ memset(&state, 0, sizeof(struct can_recvfrom_s));
+
+ /* This semaphore is used for signaling and, hence, should not have
+ * priority inheritance enabled.
+ */
+
+ nxsem_init(&state.pr_sem, 0, 0); /* Doesn't really fail */
+ nxsem_setprotocol(&state.pr_sem, SEM_PRIO_NONE);
+
+
+ state.pr_buflen = msg->msg_iov->iov_len;
+ state.pr_buffer = msg->msg_iov->iov_base;
+#ifdef CONFIG_NET_TIMESTAMP
+ if(psock->s_timestamp && msg->msg_controllen == (sizeof(struct cmsghdr) + sizeof(struct timeval)))
+ {
+ struct cmsghdr* cmsg = CMSG_FIRSTHDR(msg);
+ state.pr_msglen = sizeof(struct timeval);
+ state.pr_msgbuf = CMSG_DATA(cmsg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SO_TIMESTAMP;
+ cmsg->cmsg_len = state.pr_msglen;
+ }
+#endif
+ state.pr_sock = psock;
+
+ /* Handle any any CAN data already buffered in a read-ahead buffer. NOTE
+ * that there may be read-ahead data to be retrieved even after the
+ * socket has been disconnected.
+ */
+
+ ret = can_readahead(&state);
+ if (ret > 0)
+ {
+#ifdef CONFIG_NET_TIMESTAMP
+ if(psock->s_timestamp)
+ {
+ if(state.pr_msglen == sizeof(struct timeval))
+ {
+ can_readahead_timestamp(conn, state.pr_msgbuf);
+ }
+ else
+ {
+ /* We still have to consume the data otherwise IOB gets full */
+ uint8_t dummy_buf[sizeof(struct timeval)];
+ can_readahead_timestamp(conn, &dummy_buf);
+ }
+ }
+#endif
+ goto errout_with_state;
+ }
+
+ ret = state.pr_recvlen;
+
+ /* Handle non-blocking CAN sockets */
+
+ if (_SS_ISNONBLOCK(psock->s_flags) || (flags & MSG_DONTWAIT) != 0)
+ {
+ /* Return the number of bytes read from the read-ahead buffer if
+ * something was received (already in 'ret'); EAGAIN if not.
+ */
+
+ if (ret < 0)
+ {
+ /* Nothing was received */
+
+ ret = -EAGAIN;
+ goto errout_with_state;
+ }
+ }
+
+ /* Get the device driver that will service this transfer */
+
+ dev = conn->dev;
+ if (dev == NULL)
+ {
+ ret = -ENODEV;
+ goto errout_with_state;
+ }
+
+ /* Set up the callback in the connection */
+
+ state.pr_cb = can_callback_alloc(dev, conn);
+ if (state.pr_cb)
+ {
+ state.pr_cb->flags = (CAN_NEWDATA | CAN_POLL);
+ state.pr_cb->priv = (FAR void *)&state;
+ state.pr_cb->event = can_recvfrom_eventhandler;
+
+ /* Wait for either the receive to complete or for an error/timeout to
+ * occur. NOTES: (1) net_lockedwait will also terminate if a signal
+ * is received, (2) the network is locked! It will be un-locked while
+ * the task sleeps and automatically re-locked when the task restarts.
+ */
+
+ ret = net_lockedwait(&state.pr_sem);
+
+ /* Make sure that no further events are processed */
+
+ can_callback_free(dev, conn, state.pr_cb);
+ ret = can_recvfrom_result(ret, &state);
+ }
+ else
+ {
+ ret = -EBUSY;
+ }
+
+errout_with_state:
+ net_unlock();
+ nxsem_destroy(&state.pr_sem);
+ return ret;
+}
+#endif
+
#endif /* CONFIG_NET_CAN */
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 4deef14..844ac3b 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -93,6 +93,9 @@ const struct sock_intf_s g_can_sockif =
NULL, /* si_sendfile */
#endif
can_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ can_recvmsg, /* si_recvmsg */
+#endif
can_close /* si_close */
};
@@ -105,7 +108,7 @@ const struct sock_intf_s g_can_sockif =
*
* Description:
* This function is called to perform the actual CAN receive operation
- * via the device interface layer.
+ * via the device interface layer. from can_input()
*
* Input Parameters:
* dev The structure of the network driver that caused the event
@@ -229,6 +232,11 @@ static int can_setup(FAR struct socket *psock, int protocol)
return -ENOMEM;
}
+#ifdef CONFIG_NET_TIMESTAMP
+ /* Store psock in conn se we can read the SO_TIMESTAMP value */
+ conn->psock = psock;
+#endif
+
/* Initialize the connection instance */
conn->protocol = (uint8_t)protocol;
diff --git a/net/icmp/icmp_sockif.c b/net/icmp/icmp_sockif.c
index 983eb71..c81592e 100644
--- a/net/icmp/icmp_sockif.c
+++ b/net/icmp/icmp_sockif.c
@@ -102,6 +102,9 @@ const struct sock_intf_s g_icmp_sockif =
NULL, /* si_sendfile */
#endif
icmp_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
icmp_close /* si_close */
};
diff --git a/net/icmpv6/icmpv6_sockif.c b/net/icmpv6/icmpv6_sockif.c
index c99d184..29e5e47 100644
--- a/net/icmpv6/icmpv6_sockif.c
+++ b/net/icmpv6/icmpv6_sockif.c
@@ -102,6 +102,9 @@ const struct sock_intf_s g_icmpv6_sockif =
NULL, /* si_sendfile */
#endif
icmpv6_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
icmpv6_close /* si_close */
};
diff --git a/net/ieee802154/ieee802154_sockif.c b/net/ieee802154/ieee802154_sockif.c
index 216264a..d1ac29b 100644
--- a/net/ieee802154/ieee802154_sockif.c
+++ b/net/ieee802154/ieee802154_sockif.c
@@ -107,6 +107,9 @@ const struct sock_intf_s g_ieee802154_sockif =
NULL, /* si_sendfile */
#endif
ieee802154_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
ieee802154_close /* si_close */
};
diff --git a/net/inet/inet_sockif.c b/net/inet/inet_sockif.c
index 9456510..2a09c45 100644
--- a/net/inet/inet_sockif.c
+++ b/net/inet/inet_sockif.c
@@ -117,6 +117,9 @@ static const struct sock_intf_s g_inet_sockif =
inet_sendfile, /* si_sendfile */
#endif
inet_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
inet_close /* si_close */
};
diff --git a/net/local/local_sockif.c b/net/local/local_sockif.c
index f2bbcb1..62d56b5 100644
--- a/net/local/local_sockif.c
+++ b/net/local/local_sockif.c
@@ -110,6 +110,9 @@ const struct sock_intf_s g_local_sockif =
NULL, /* si_sendfile */
#endif
local_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
local_close /* si_close */
};
diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c
index 577d520..970aed4 100644
--- a/net/netlink/netlink_sockif.c
+++ b/net/netlink/netlink_sockif.c
@@ -111,6 +111,9 @@ const struct sock_intf_s g_netlink_sockif =
NULL, /* si_sendfile */
#endif
netlink_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
netlink_close /* si_close */
};
diff --git a/net/pkt/pkt_sockif.c b/net/pkt/pkt_sockif.c
index e189ddc..bbabf42 100644
--- a/net/pkt/pkt_sockif.c
+++ b/net/pkt/pkt_sockif.c
@@ -108,6 +108,9 @@ const struct sock_intf_s g_pkt_sockif =
NULL, /* si_sendfile */
#endif
pkt_recvfrom, /* si_recvfrom */
+#ifdef CONFIG_NET_RECVMSG_CMSG
+ NULL, /* si_recvmsg */
+#endif
pkt_close /* si_close */
};
diff --git a/net/socket/Kconfig b/net/socket/Kconfig
index 8b71ade..f4c9408 100644
--- a/net/socket/Kconfig
+++ b/net/socket/Kconfig
@@ -55,5 +55,21 @@ config NET_SOLINGER
Enable or disable support for the SO_LINGER socket option. Requires
write buffer support.
+config NET_TIMESTAMP
+ bool "SO_TIMESTAMP socket option"
+ default n
+ depends on NET_CAN && NET_RECVMSG_CMSG
+ ---help---
+ Enable or disable support for the SO_TIMESTAMP socket option. Currently only tested & implemented in SocketCAN but should work on all sockets
+
endif # NET_SOCKOPTS
+
+config NET_RECVMSG_CMSG
+ bool "recvmsg() control messages (CMSG) support"
+ default n
+ ---help---
+ Enable or disable support for control messages in the recvmsg function.
+ Control messages (also defined in POSIX 1003.1g as ancillary data object information).
+ Includes additional information on the packet received.
+
endmenu # Socket Support
diff --git a/net/socket/Make.defs b/net/socket/Make.defs
index 47fb4d2..2be9dbf 100644
--- a/net/socket/Make.defs
+++ b/net/socket/Make.defs
@@ -74,3 +74,8 @@ endif
DEPPATH += --dep-path socket
VPATH += :socket
+
+# Support for recvmsg() with control messages (CMSG)
+ifeq ($(CONFIG_NET_RECVMSG_CMSG),y)
+SOCK_CSRCS += recvmsg.c
+endif
diff --git a/net/socket/getsockopt.c b/net/socket/getsockopt.c
index fa58e6d..581edc0 100644
--- a/net/socket/getsockopt.c
+++ b/net/socket/getsockopt.c
@@ -278,6 +278,19 @@ static int psock_socketlevel_option(FAR struct socket *psock, int option,
}
break;
+#ifdef CONFIG_NET_TIMESTAMP
+ case SO_TIMESTAMP:
+ {
+ if (*value_len != sizeof(int))
+ {
+ return -EINVAL;
+ }
+
+ *(FAR int *)value = (int)psock->s_timestamp;
+ }
+ break;
+#endif
+
/* The following are not yet implemented
* (return values other than {0,1})
*/
diff --git a/net/socket/setsockopt.c b/net/socket/setsockopt.c
index 46e1b6e..fddf0c1 100644
--- a/net/socket/setsockopt.c
+++ b/net/socket/setsockopt.c
@@ -279,6 +279,30 @@ static int psock_socketlevel_option(FAR struct socket *psock, int option,
}
break;
#endif
+
+#ifdef CONFIG_NET_TIMESTAMP
+ case SO_TIMESTAMP: /* Generates a timestamp for each incoming packet */
+ {
+
+ /* Verify that option is at least the size of an integer. */
+
+ if (value_len < sizeof(FAR int32_t))
+ {
+ return -EINVAL;
+ }
+
+ /* Lock the network so that we have exclusive access to the socket
+ * options.
+ */
+
+ net_lock();
+
+ psock->s_timestamp = *((FAR int32_t*)value);
+
+ net_unlock();
+ }
+ break;
+#endif
/* The following are not yet implemented */
case SO_RCVBUF: /* Sets receive buffer size */
diff --git a/net/socket/socket.h b/net/socket/socket.h
index 0f809ac..80279da 100644
--- a/net/socket/socket.h
+++ b/net/socket/socket.h
@@ -80,7 +80,7 @@
/* This is the largest option value. REVISIT: belongs in sys/socket.h */
-#define _SO_MAXOPT (15)
+#define _SO_MAXOPT (29)
/* Macros to set, test, clear options */
[incubator-nuttx] 28/31: Made can/error.h nxstyle compliant
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 059d44838793ebb2520c35430619fbdf7612ce72
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Mar 18 09:13:34 2020 +0100
Made can/error.h nxstyle compliant
---
include/nuttx/can/error.h | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/include/nuttx/can/error.h b/include/nuttx/can/error.h
index d9c2396..cf5fec6 100644
--- a/include/nuttx/can/error.h
+++ b/include/nuttx/can/error.h
@@ -1,8 +1,10 @@
/* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
-/*
+
+/************************************************************************************
* linux/can/error.h
*
- * Definitions of the CAN error messages to be filtered and passed to the user.
+ * Definitions of the CAN error messages to be filtered and passed to the
+ * user.
*
* Author: Oliver Hartkopp <ol...@volkswagen.de>
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
@@ -40,7 +42,7 @@
* (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 _UAPI_CAN_ERROR_H
#define _UAPI_CAN_ERROR_H
@@ -94,18 +96,18 @@
#define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */
#define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */
#define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */
-#define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */
-#define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */
-#define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */
-#define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */
+#define CAN_ERR_PROT_LOC_ID12_05 0x0f /* ID bits 12-5 */
+#define CAN_ERR_PROT_LOC_ID04_00 0x0e /* ID bits 4-0 */
+#define CAN_ERR_PROT_LOC_RTR 0x0c /* RTR */
+#define CAN_ERR_PROT_LOC_RES1 0x0d /* reserved bit 1 */
#define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */
-#define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */
-#define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */
+#define CAN_ERR_PROT_LOC_DLC 0x0b /* data length code */
+#define CAN_ERR_PROT_LOC_DATA 0x0a /* data section */
#define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */
#define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */
#define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */
-#define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */
-#define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */
+#define CAN_ERR_PROT_LOC_ACK_DEL 0x1b /* ACK delimiter */
+#define CAN_ERR_PROT_LOC_EOF 0x1a /* end of frame */
#define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */
/* error status of CAN-transceiver / data[4] */
[incubator-nuttx] 06/31: SocketCAN initial receive working as well
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 72d10458eca8b6a3fcea4c7d3ba45883b367653d
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Thu Feb 20 16:06:15 2020 +0100
SocketCAN initial receive working as well
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 462 ++++++++++++++++++++++-----------
net/can/Make.defs | 6 +-
net/can/can.h | 28 ++
net/can/can_input.c | 129 +++++++++
net/can/can_recvfrom.c | 354 +++++++++++++++++++++++++
net/can/can_sockif.c | 55 +---
net/devif/Make.defs | 6 +-
7 files changed, 836 insertions(+), 204 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 7046050..9c7a7d7 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -115,19 +115,23 @@
# error "Need at least one RX buffer"
#endif*/
-#define MaskStdID 0x000007FF;
-#define MaskExtID 0x1FFFFFFF;
+#define MaskStdID 0x000007FF
+#define MaskExtID 0x1FFFFFFF
+#define FlagEFF (1 << 31) /* Extended frame format */
+#define FlagRTR (1 << 30) /* Remote transmission request */
//Fixme nice variables/constants
-#define RxMBCount 10
-#define TxMBCount 6
-#define TotalMBcount RxMBCount + TxMBCount
-#define TXMBMask (((1 << TxMBCount)-1) << RxMBCount)
+#define RxMBCount 6
+#define FilterCount 0
+#define RxandFilterMBCount (RxMBCount + FilterCount)
+#define TxMBCount 12 //???????????? why 12 idk it works
+#define TotalMBcount RxandFilterMBCount + TxMBCount
+#define TXMBMask (((1 << TxMBCount)-1) << RxandFilterMBCount)
#define CAN_FIFO_NE (1 << 5)
#define CAN_FIFO_OV (1 << 6)
#define CAN_FIFO_WARN (1 << 7)
-#define FIFO_IFLAG1 CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV
+#define FIFO_IFLAG1 (CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV)
static int peak_tx_mailbox_index_ = 0;
@@ -345,6 +349,12 @@ static bool s32k1xx_txringfull(FAR struct s32k1xx_driver_s *priv);
static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv);
static int s32k1xx_txpoll(struct net_driver_s *dev);
+/* Helper functions */
+static void s32k1xx_setenable(uint32_t enable);
+static void s32k1xx_setfreeze(uint32_t freeze);
+static uint32_t s32k1xx_waitmcr_change(uint32_t mask,
+ uint32_t target_state);
+
/* Interrupt handling */
static void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv);
@@ -385,6 +395,7 @@ static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
/* Initialization */
static void s32k1xx_initbuffers(struct s32k1xx_driver_s *priv);
+static int s32k1xx_initialize(struct s32k1xx_driver_s *priv);
static void s32k1xx_reset(struct s32k1xx_driver_s *priv);
/****************************************************************************
@@ -462,7 +473,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mbi = (getreg32(S32K1XX_CAN0_ESR2) & CAN_ESR2_LPTM_MASK) >> CAN_ESR2_LPTM_SHIFT;
}
- uint32_t mb_bit = 1 << (RxMBCount + mbi);
+ uint32_t mb_bit = 1 << (RxandFilterMBCount + mbi);
while (mbi < TxMBCount)
{
@@ -476,8 +487,9 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mbi++;
}
- if (mbi == TxMBCount)
+ if ((mbi-RxandFilterMBCount) == TxMBCount)
{
+ nwarn("No TX MB available mbi %i\r\n", mbi);
return 0; // No transmission for you!
}
@@ -644,7 +656,96 @@ static inline void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv)
static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv)
{
#warning Missing logic
- ninfo("FLEXCAN: receive\r\n");
+ //ninfo("FLEXCAN: receive\r\n");
+
+ s32k1xx_gpiowrite(PIN_PORTD | PIN31, 1);
+
+ struct can_frame frame;
+ uint32_t flags = getreg32(S32K1XX_CAN0_IFLAG1);
+
+ if ((flags & FIFO_IFLAG1) == 0)
+ {
+ // Weird, IRQ is here but no data to read
+ return;
+ }
+
+ if (flags & CAN_FIFO_OV)
+ {
+ //error_cnt_++;
+ putreg32(CAN_FIFO_OV, S32K1XX_CAN0_IFLAG1);
+ }
+
+ if (flags & CAN_FIFO_WARN)
+ {
+ //fifo_warn_cnt_++;
+ putreg32(CAN_FIFO_WARN, S32K1XX_CAN0_IFLAG1);
+ }
+
+ if (flags & CAN_FIFO_NE)
+ {
+ struct MbRx *rf = priv->rx;
+
+ /*
+ * Read the frame contents
+ */
+
+ if (rf->CS.ide)
+ {
+ frame.can_id = MaskExtID & rf->ID.ext;
+ frame.can_id |= FlagEFF;
+ }
+ else
+ {
+ frame.can_id = MaskStdID & rf->ID.std;
+ }
+
+ if (rf->CS.rtr)
+ {
+ frame.can_id |= FlagRTR;
+ }
+
+ frame.can_dlc = rf->CS.dlc;
+
+ frame.data[0] = rf->data.b0;
+ frame.data[1] = rf->data.b1;
+ frame.data[2] = rf->data.b2;
+ frame.data[3] = rf->data.b3;
+ frame.data[4] = rf->data.b4;
+ frame.data[5] = rf->data.b5;
+ frame.data[6] = rf->data.b6;
+ frame.data[7] = rf->data.b7;
+
+
+ putreg32(CAN_FIFO_NE, S32K1XX_CAN0_IFLAG1);
+
+ /* Copy the buffer pointer to priv->dev.d_buf. Set amount of data
+ * in priv->dev.d_len
+ */
+
+ priv->dev.d_len = sizeof(struct can_frame);
+ priv->dev.d_buf =
+ (uint8_t *)s32k1xx_swap32((uint32_t)&frame); //FIXME
+
+ /* Invalidate the buffer so that the correct packet will be re-read
+ * from memory when the packet content is accessed.
+ */
+
+ up_invalidate_dcache((uintptr_t)priv->dev.d_buf,
+ (uintptr_t)priv->dev.d_buf + priv->dev.d_len);
+
+ /* Send to socket interface */
+ NETDEV_RXPACKETS(&priv->dev);
+
+ can_input(&priv->dev);
+
+
+
+
+ /*
+ * Store with timeout into the FIFO buffer and signal update event
+ */
+
+ }
}
/****************************************************************************
@@ -736,9 +837,6 @@ static void s32k1xx_flexcan_interrupt_work(FAR void *arg)
static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
{
#warning Missing logic
-
- ninfo("FLEXCAN INT %i\r\n", irq);
-
FAR struct s32k1xx_driver_s *priv = &g_flexcan[0];
uint32_t flags;
flags = getreg32(S32K1XX_CAN0_IFLAG1);
@@ -881,6 +979,24 @@ static void s32k1xx_polltimer_expiry(int argc, uint32_t arg, ...)
work_queue(ETHWORK, &priv->pollwork, s32k1xx_poll_work, priv, 0);
}
+static void s32k1xx_setenable(uint32_t enable)
+{
+ uint32_t regval;
+ if(enable)
+ {
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval &= ~(CAN_MCR_MDIS);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
+ else
+ {
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_MDIS;
+ putreg32(regval, S32K1XX_CAN0_MCR);
+ }
+ s32k1xx_waitmcr_change(CAN_MCR_LPMACK,1);
+}
+
static void s32k1xx_setfreeze(uint32_t freeze)
{
uint32_t regval;
@@ -945,136 +1061,13 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
uint32_t regval;
#warning Missing logic
- ninfo("FLEXCAN: test ifup\r\n");
-
- /* initialize CAN device */
- //FIXME we only support a single can device for now
-
- //TEST GPIO tming
- s32k1xx_pinconfig(PIN_PORTD | PIN31 | GPIO_OUTPUT);
-
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_MDIS;
- putreg32(regval, S32K1XX_CAN0_MCR);
-
- /* Set SYS_CLOCK src */
- regval = getreg32(S32K1XX_CAN0_CTRL1);
- regval |= CAN_CTRL1_CLKSRC;
- putreg32(regval, S32K1XX_CAN0_CTRL1);
-
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval &= ~(CAN_MCR_MDIS);
- putreg32(regval, S32K1XX_CAN0_MCR);
-
-
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_RFEN | CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS
- | CAN_MCR_IRMQ | CAN_MCR_AEN |
- (((TotalMBcount - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
- putreg32(regval, S32K1XX_CAN0_MCR);
-
- regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN | CAN_CTRL2_RFFN_16MB; //FIXME TASD
- putreg32(regval, S32K1XX_CAN0_CTRL2);
-
- /* Enter freeze mode */
- s32k1xx_setfreeze(1);
- if(!s32k1xx_waitfreezeack_change(1))
+ if(!s32k1xx_initialize(priv))
{
- ninfo("FLEXCAN: freeze fail\r\n");
+ nerr("initialize failed");
return -1;
}
- /*regval = getreg32(S32K1XX_CAN0_CTRL1);
- regval |= ((0 << CAN_CTRL1_PRESDIV_SHIFT) & CAN_CTRL1_PRESDIV_MASK)
- | ((46 << CAN_CTRL1_ROPSEG_SHIFT) & CAN_CTRL1_ROPSEG_MASK)
- | ((18 << CAN_CTRL1_PSEG1_SHIFT) & CAN_CTRL1_PSEG1_MASK)
- | ((12 << CAN_CTRL1_PSEG2_SHIFT) & CAN_CTRL1_PSEG2_MASK)
- | ((12 << CAN_CTRL1_RJW_SHIFT) & CAN_CTRL1_RJW_MASK)
- | CAN_CTRL1_ERRMSK
- | CAN_CTRL1_TWRNMSK
- | CAN_CTRL1_RWRNMSK;
-
- putreg32(regval, S32K1XX_CAN0_CTRL1);*/
-
- /* CAN Bit Timing (CBT) configuration for a nominal phase of 1 Mbit/s
- * with 80 time quantas,in accordance with Bosch 2012 specification,
- * sample point at 83.75% */
- regval = getreg32(S32K1XX_CAN0_CBT);
- regval |= CAN_CBT_BTF | /* Enable extended bit timing configurations for CAN-FD
- for setting up separetely nominal and data phase */
- CAN_CBT_EPRESDIV(0) | /* Prescaler divisor factor of 1 */
- CAN_CBT_EPROPSEG(46) | /* Propagation segment of 47 time quantas */
- CAN_CBT_EPSEG1(18) | /* Phase buffer segment 1 of 19 time quantas */
- CAN_CBT_EPSEG2(12) | /* Phase buffer segment 2 of 13 time quantas */
- CAN_CBT_ERJW(12); /* Resynchronization jump width same as PSEG2 */
- putreg32(regval, S32K1XX_CAN0_CBT);
-
-#ifdef CAN_FD
-
- /* Enable CAN FD feature */
- regval = getreg32(S32K1XX_CAN0_MCR);
- regval |= CAN_MCR_FDEN;
- putreg32(regval, S32K1XX_CAN0_MCR);
-
- /* CAN-FD Bit Timing (FDCBT) for a data phase of 4 Mbit/s with 20 time quantas,
- in accordance with Bosch 2012 specification, sample point at 75% */
- regval = getreg32(S32K1XX_CAN0_FDCBT);
- regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
- CAN_FDCBT_FPROPSEG(7) | /* Propagation semgment of 7 time quantas
- (only register that doesn't add 1) */
- CAN_FDCBT_FPSEG1(6) | /* Phase buffer segment 1 of 7 time quantas */
- CAN_FDCBT_FPSEG2(4) | /* Phase buffer segment 2 of 5 time quantas */
- CAN_FDCBT_FRJW(4); /* Resynchorinzation jump width same as PSEG2 */
- putreg32(regval, S32K1XX_CAN0_FDCBT);
-
- /* Additional CAN-FD configurations */
- regval = getreg32(S32K1XX_CAN0_FDCTRL);
- regval |= CAN_FDCTRL_FDRATE | /* Enable bit rate switch in data phase of frame */
- CAN_FDCTRL_TDCEN | /* Enable transceiver delay compensation */
- CAN_FDCTRL_TDCOFF(5) | /* Setup 5 cycles for data phase sampling delay */
- CAN_FDCTRL_MBDSR0(3); /* Setup 64 bytes per message buffer (7 MB's) */
- putreg32(regval, S32K1XX_CAN0_FDCTRL);
-
- regval = getreg32(S32K1XX_CAN0_CTRL2);
- regval |= CAN_CTRL2_ISOCANFDEN;
- putreg32(regval, S32K1XX_CAN0_CTRL2);
-#endif
-
-
-
- /* Iniatilize all MB rx and tx */
- for(int i = 0; i < TotalMBcount; i++)
- {
- ninfo("MB %i %p\r\n", i, &priv->rx[i]);
- ninfo("MB %i %p\r\n", i, &priv->rx[i].ID.w);
- priv->rx[i].CS.cs = 0x0;
- priv->rx[i].ID.w = 0x0;
- priv->rx[i].data.l = 0x0;
- priv->rx[i].data.h = 0x0;
- }
-
- /* Filtering catchall */
- putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
-
- for(int i = 0; i < TotalMBcount; i++)
- {
- putreg32(0,S32K1XX_CAN0_RXIMR(i));
- }
-
- putreg32(FIFO_IFLAG1 | TXMBMask, S32K1XX_CAN0_IFLAG1);
- putreg32(FIFO_IFLAG1, S32K1XX_CAN0_IMASK1);
-
-
- /* Exit freeze mode */
- s32k1xx_setfreeze(0);
- if(!s32k1xx_waitfreezeack_change(0))
- {
- ninfo("FLEXCAN: unfreeze fail\r\n");
- return -1;
- }
-
-
/* Set and activate a timer process */
wd_start(priv->txpoll, S32K1XX_WDDELAY, s32k1xx_polltimer_expiry, 1,
@@ -1190,8 +1183,11 @@ static int s32k1xx_txavail(struct net_driver_s *dev)
if (work_available(&priv->pollwork))
{
/* Schedule to serialize the poll on the worker thread. */
-
+#ifdef WORK_QUEUE_BYPASS
+ s32k1xx_txavail_work(priv);
+#else
work_queue(ETHWORK, &priv->pollwork, s32k1xx_txavail_work, priv, 0);
+#endif
}
return OK;
@@ -1233,6 +1229,138 @@ static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,
}
#endif /* CONFIG_NETDEV_IOCTL */
+/****************************************************************************
+ * Function: s32k1xx_initalize
+ *
+ * Description:
+ * Initialize FLEXCAN device
+ *
+ * Input Parameters:
+ * priv - Reference to the private FLEXCAN driver state structure
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
+{
+ uint32_t regval;
+ uint32_t i;
+
+ /* initialize CAN device */
+ //FIXME we only support a single can device for now
+
+ //TEST GPIO tming
+ s32k1xx_pinconfig(PIN_PORTD | PIN31 | GPIO_OUTPUT);
+
+
+ s32k1xx_setenable(0);
+
+ /* Set SYS_CLOCK src */
+ regval = getreg32(S32K1XX_CAN0_CTRL1);
+ regval |= CAN_CTRL1_CLKSRC;
+ putreg32(regval, S32K1XX_CAN0_CTRL1);
+
+ s32k1xx_setenable(1);
+
+ s32k1xx_reset(priv);
+
+ /* Enter freeze mode */
+ s32k1xx_setfreeze(1);
+ if(!s32k1xx_waitfreezeack_change(1))
+ {
+ ninfo("FLEXCAN: freeze fail\r\n");
+ return -1;
+ }
+
+ /*regval = getreg32(S32K1XX_CAN0_CTRL1);
+ regval |= ((0 << CAN_CTRL1_PRESDIV_SHIFT) & CAN_CTRL1_PRESDIV_MASK)
+ | ((46 << CAN_CTRL1_ROPSEG_SHIFT) & CAN_CTRL1_ROPSEG_MASK)
+ | ((18 << CAN_CTRL1_PSEG1_SHIFT) & CAN_CTRL1_PSEG1_MASK)
+ | ((12 << CAN_CTRL1_PSEG2_SHIFT) & CAN_CTRL1_PSEG2_MASK)
+ | ((12 << CAN_CTRL1_RJW_SHIFT) & CAN_CTRL1_RJW_MASK)
+ | CAN_CTRL1_ERRMSK
+ | CAN_CTRL1_TWRNMSK
+ | CAN_CTRL1_RWRNMSK;
+
+ putreg32(regval, S32K1XX_CAN0_CTRL1);*/
+
+#define BIT_METHOD2
+#ifdef BIT_METHOD2
+ /* CAN Bit Timing (CBT) configuration for a nominal phase of 1 Mbit/s
+ * with 80 time quantas,in accordance with Bosch 2012 specification,
+ * sample point at 83.75% */
+ regval = getreg32(S32K1XX_CAN0_CBT);
+ regval |= CAN_CBT_BTF | /* Enable extended bit timing configurations for CAN-FD
+ for setting up separetely nominal and data phase */
+ CAN_CBT_EPRESDIV(0) | /* Prescaler divisor factor of 1 */
+ CAN_CBT_EPROPSEG(46) | /* Propagation segment of 47 time quantas */
+ CAN_CBT_EPSEG1(18) | /* Phase buffer segment 1 of 19 time quantas */
+ CAN_CBT_EPSEG2(12) | /* Phase buffer segment 2 of 13 time quantas */
+ CAN_CBT_ERJW(12); /* Resynchronization jump width same as PSEG2 */
+ putreg32(regval, S32K1XX_CAN0_CBT);
+#endif
+
+#ifdef CAN_FD
+
+ /* Enable CAN FD feature */
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_FDEN;
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ /* CAN-FD Bit Timing (FDCBT) for a data phase of 4 Mbit/s with 20 time quantas,
+ in accordance with Bosch 2012 specification, sample point at 75% */
+ regval = getreg32(S32K1XX_CAN0_FDCBT);
+ regval |= CAN_FDCBT_FPRESDIV(0) | /* Prescaler divisor factor of 1 */
+ CAN_FDCBT_FPROPSEG(7) | /* Propagation semgment of 7 time quantas
+ (only register that doesn't add 1) */
+ CAN_FDCBT_FPSEG1(6) | /* Phase buffer segment 1 of 7 time quantas */
+ CAN_FDCBT_FPSEG2(4) | /* Phase buffer segment 2 of 5 time quantas */
+ CAN_FDCBT_FRJW(4); /* Resynchorinzation jump width same as PSEG2 */
+ putreg32(regval, S32K1XX_CAN0_FDCBT);
+
+ /* Additional CAN-FD configurations */
+ regval = getreg32(S32K1XX_CAN0_FDCTRL);
+ regval |= CAN_FDCTRL_FDRATE | /* Enable bit rate switch in data phase of frame */
+ CAN_FDCTRL_TDCEN | /* Enable transceiver delay compensation */
+ CAN_FDCTRL_TDCOFF(5) | /* Setup 5 cycles for data phase sampling delay */
+ CAN_FDCTRL_MBDSR0(3); /* Setup 64 bytes per message buffer (7 MB's) */
+ putreg32(regval, S32K1XX_CAN0_FDCTRL);
+
+ regval = getreg32(S32K1XX_CAN0_CTRL2);
+ regval |= CAN_CTRL2_ISOCANFDEN;
+ putreg32(regval, S32K1XX_CAN0_CTRL2);
+#endif
+
+ for(i = TxMBCount; i < TotalMBcount; i++)
+ {
+ priv->rx[i].ID.w = 0x0;
+ }
+
+ putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
+
+ for(i = 0; i < TotalMBcount; i++)
+ {
+ putreg32(0,S32K1XX_CAN0_RXIMR(i));
+ }
+
+ putreg32(FIFO_IFLAG1 | TXMBMask, S32K1XX_CAN0_IFLAG1);
+ putreg32(FIFO_IFLAG1, S32K1XX_CAN0_IMASK1);
+
+
+ /* Exit freeze mode */
+ s32k1xx_setfreeze(0);
+ if(!s32k1xx_waitfreezeack_change(0))
+ {
+ ninfo("FLEXCAN: unfreeze fail\r\n");
+ return -1;
+ }
+
+ return 1;
+}
/****************************************************************************
* Function: s32k1xx_initbuffers
@@ -1273,19 +1401,57 @@ static void s32k1xx_initbuffers(struct s32k1xx_driver_s *priv)
static void s32k1xx_reset(struct s32k1xx_driver_s *priv)
{
- unsigned int i;
+ uint32_t regval;
+ uint32_t i;
- /* Set the reset bit and clear the enable bit */
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_SOFTRST;
+ putreg32(regval, S32K1XX_CAN0_MCR);
-
- #warning Missing logic
+ if(!s32k1xx_waitmcr_change(CAN_MCR_SOFTRST, 0))
+ {
+ nerr("Reset failed");
+ return;
+ }
- /* Wait at least 8 clock cycles */
+ /* TODO calculate TASD */
- for (i = 0; i < 10; i++)
- {
- asm volatile ("nop");
- }
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval &= ~(CAN_MCR_SUPV);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ /* Initialize all MB rx and tx */
+ for(i = 0; i < TotalMBcount; i++)
+ {
+ ninfo("MB %i %p\r\n", i, &priv->rx[i]);
+ ninfo("MB %i %p\r\n", i, &priv->rx[i].ID.w);
+ priv->rx[i].CS.cs = 0x0;
+ priv->rx[i].ID.w = 0x0;
+ priv->rx[i].data.l = 0x0;
+ priv->rx[i].data.h = 0x0;
+ }
+
+ regval = getreg32(S32K1XX_CAN0_MCR);
+ regval |= CAN_MCR_RFEN | CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS
+ | CAN_MCR_IRMQ | CAN_MCR_AEN |
+ (((TotalMBcount - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
+ putreg32(regval, S32K1XX_CAN0_MCR);
+
+ regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN | CAN_CTRL2_RFFN_16MB; //FIXME TASD
+ putreg32(regval, S32K1XX_CAN0_CTRL2);
+
+
+ for(i = 0; i < TotalMBcount; i++)
+ {
+ putreg32(0,S32K1XX_CAN0_RXIMR(i));
+ }
+
+ /* Filtering catchall */
+ putreg32(0x3FFFFFFF, S32K1XX_CAN0_RX14MASK);
+ putreg32(0x3FFFFFFF, S32K1XX_CAN0_RX15MASK);
+ putreg32(0x3FFFFFFF, S32K1XX_CAN0_RXMGMASK);
+ putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
}
/****************************************************************************
diff --git a/net/can/Make.defs b/net/can/Make.defs
index f8488c0..d078a05 100644
--- a/net/can/Make.defs
+++ b/net/can/Make.defs
@@ -26,13 +26,15 @@ ifeq ($(CONFIG_NET_CAN),y)
SOCK_CSRCS += can_sockif.c
SOCK_CSRCS += can_send.c
+SOCK_CSRCS += can_recvfrom.c
NET_CSRCS += can_conn.c
-NET_CSRCS += can_poll.c
+NET_CSRCS += can_input.c
NET_CSRCS += can_callback.c
+NET_CSRCS += can_poll.c
# Include can build support
DEPPATH += --dep-path can
VPATH += :can
-endif
+endif # CONFIG_NET_CAN
diff --git a/net/can/can.h b/net/can/can.h
index 3fed49b..c2b6857 100644
--- a/net/can/can.h
+++ b/net/can/can.h
@@ -166,6 +166,34 @@ uint16_t can_callback(FAR struct net_driver_s *dev,
FAR struct can_conn_s *conn, uint16_t flags);
/****************************************************************************
+ * Name: can_recvfrom
+ *
+ * Description:
+ * Implements the socket recvfrom interface pkt_recvfrom() receives messages from
+ * a socket, and may be used to receive data on a socket whether or not it
+ * is connection-oriented.
+ *
+ * Input Parameters:
+ * psock A pointer to a NuttX-specific, internal socket structure
+ * buf Buffer to receive data
+ * len Length of buffer
+ * flags Receive flags
+ * from Address of source (may be NULL)
+ * fromlen The length of the address structure
+ *
+ * Returned Value:
+ * On success, returns the number of characters received. If no data is
+ * available to be received and the peer has performed an orderly shutdown,
+ * recv() will return 0. Otherwise, on errors, a negated errno value is
+ * returned (see recvfrom() for the list of appropriate error values).
+ *
+ ****************************************************************************/
+
+ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
+ int flags, FAR struct sockaddr *from,
+ FAR socklen_t *fromlen);
+
+/****************************************************************************
* Name: can_poll
*
* Description:
diff --git a/net/can/can_input.c b/net/can/can_input.c
new file mode 100644
index 0000000..32dcebf
--- /dev/null
+++ b/net/can/can_input.c
@@ -0,0 +1,129 @@
+/****************************************************************************
+ * net/can/can_input.c
+ * Handling incoming packet input
+ *
+ * Copyright (C) 2014, 2020 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Adapted for NuttX from logic in uIP which also has a BSD-like license:
+ *
+ * Original author Adam Dunkels <ad...@dunkels.com>
+ * Copyright () 2001-2003, Adam Dunkels.
+ * All rights reserved.
+ *
+ * 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 <nuttx/config.h>
+#if defined(CONFIG_NET) && defined(CONFIG_NET_CAN)
+
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/net/netdev.h>
+#include <nuttx/net/can.h>
+
+#include "devif/devif.h"
+#include "can/can.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: can_input
+ *
+ * Description:
+ * Handle incoming packet input
+ *
+ * Input Parameters:
+ * dev - The device driver structure containing the received packet
+ *
+ * Returned Value:
+ * OK The packet has been processed and can be deleted
+ * -EAGAIN There is a matching connection, but could not dispatch the packet
+ * yet. Useful when a packet arrives before a recv call is in
+ * place.
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+int can_input(struct net_driver_s *dev)
+{
+ FAR struct can_conn_s *conn;
+ int ret = OK;
+
+ conn = can_nextconn(NULL); //FIXME
+ if (conn)
+ {
+ uint16_t flags;
+
+ /* Setup for the application callback */
+
+ dev->d_appdata = dev->d_buf;
+ dev->d_sndlen = 0;
+
+ /* Perform the application callback */
+
+ flags = can_callback(dev, conn, CAN_NEWDATA);
+
+ /* If the operation was successful, the CAN_NEWDATA flag is removed
+ * and thus the packet can be deleted (OK will be returned).
+ */
+
+ if ((flags & CAN_NEWDATA) != 0)
+ {
+ /* No.. the packet was not processed now. Return -EAGAIN so
+ * that the driver may retry again later. We still need to
+ * set d_len to zero so that the driver is aware that there
+ * is nothing to be sent.
+ */
+
+ nwarn("WARNING: Packet not processed\n");
+ ret = -EAGAIN;
+ }
+ }
+ else
+ {
+ ninfo("No CAN listener\n");
+ }
+
+ return ret;
+}
+
+#endif /* CONFIG_NET && CONFIG_NET_CAN */
diff --git a/net/can/can_recvfrom.c b/net/can/can_recvfrom.c
new file mode 100644
index 0000000..4062ed3
--- /dev/null
+++ b/net/can/can_recvfrom.c
@@ -0,0 +1,354 @@
+/****************************************************************************
+ * net/can/can_recvfrom.c
+ *
+ * Copyright (C) 2007-2009, 2011-2017, 2020 Gregory Nutt. All rights
+ * reserved.
+ * Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * 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 <nuttx/config.h>
+
+#ifdef CONFIG_NET_CAN
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+#include <debug.h>
+#include <assert.h>
+
+#include <arch/irq.h>
+
+#include <nuttx/semaphore.h>
+#include <nuttx/net/net.h>
+#include <nuttx/net/netdev.h>
+
+#include "netdev/netdev.h"
+#include "devif/devif.h"
+#include "can/can.h"
+#include "socket/socket.h"
+#include <netpacket/packet.h>
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct can_recvfrom_s
+{
+ FAR struct devif_callback_s *pr_cb; /* Reference to callback instance */
+ sem_t pr_sem; /* Semaphore signals recv completion */
+ size_t pr_buflen; /* Length of receive buffer */
+ FAR uint8_t *pr_buffer; /* Pointer to receive buffer */
+ ssize_t pr_recvlen; /* The received length */
+ int pr_result; /* Success:OK, failure:negated errno */
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: can_add_recvlen
+ *
+ * Description:
+ * Update information about space available for new data and update size
+ * of data in buffer, This logic accounts for the case where
+ * recvfrom_udpreadahead() sets state.pr_recvlen == -1 .
+ *
+ * Input Parameters:
+ * pstate recvfrom state structure
+ * recvlen size of new data appended to buffer
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+static inline void can_add_recvlen(FAR struct can_recvfrom_s *pstate,
+ size_t recvlen)
+{
+ if (pstate->pr_recvlen < 0)
+ {
+ pstate->pr_recvlen = 0;
+ }
+
+ pstate->pr_recvlen += recvlen;
+ pstate->pr_buffer += recvlen;
+ pstate->pr_buflen -= recvlen;
+}
+
+/****************************************************************************
+ * Name: can_recvfrom_newdata
+ *
+ * Description:
+ * Copy the read data from the packet
+ *
+ * Input Parameters:
+ * dev The structure of the network driver that caused the event.
+ * pstate recvfrom state structure
+ *
+ * Returned Value:
+ * None.
+ *
+ * Assumptions:
+ * The network is locked.
+ *
+ ****************************************************************************/
+
+static void can_recvfrom_newdata(FAR struct net_driver_s *dev,
+ FAR struct can_recvfrom_s *pstate)
+{
+ size_t recvlen;
+
+ if (dev->d_len > pstate->pr_buflen)
+ {
+ recvlen = pstate->pr_buflen;
+ }
+ else
+ {
+ recvlen = dev->d_len;
+ }
+
+ /* Copy the new packet data into the user buffer */
+
+ memcpy(pstate->pr_buffer, dev->d_buf, recvlen);
+ //ninfo("Received %d bytes (of %d)\n", (int)recvlen, (int)dev->d_len);
+
+ /* Update the accumulated size of the data read */
+
+ can_add_recvlen(pstate, recvlen);
+}
+
+static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
+ FAR void *pvconn,
+ FAR void *pvpriv, uint16_t flags)
+{
+ struct can_recvfrom_s *pstate = (struct can_recvfrom_s *)pvpriv;
+
+ //ninfo("flags: %04x\n", flags);
+
+ /* 'priv' might be null in some race conditions (?) */
+
+ if (pstate)
+ {
+ /* If a new packet is available, then complete the read action. */
+
+ if ((flags & CAN_NEWDATA) != 0)
+ {
+ /* Copy the packet */
+
+ can_recvfrom_newdata(dev, pstate);
+
+ /* We are finished. */
+
+ //ninfo("CAN done\n");
+
+ /* Don't allow any further call backs. */
+
+ pstate->pr_cb->flags = 0;
+ pstate->pr_cb->priv = NULL;
+ pstate->pr_cb->event = NULL;
+
+ /* Save the sender's address in the caller's 'from' location */
+
+ //pkt_recvfrom_sender(dev, pstate);
+
+ /* indicate that the data has been consumed */
+
+ flags &= ~CAN_NEWDATA;
+
+ /* Wake up the waiting thread, returning the number of bytes
+ * actually read.
+ */
+
+ nxsem_post(&pstate->pr_sem);
+ }
+ }
+
+ return flags;
+}
+
+/****************************************************************************
+ * Name: can_recvfrom_result
+ *
+ * Description:
+ * Evaluate the result of the recv operations
+ *
+ * Input Parameters:
+ * result The result of the net_lockedwait operation (may indicate EINTR)
+ * pstate A pointer to the state structure to be initialized
+ *
+ * Returned Value:
+ * The result of the recv operation with errno set appropriately
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+static ssize_t can_recvfrom_result(int result,
+ FAR struct can_recvfrom_s *pstate)
+{
+ /* Check for a error/timeout detected by the event handler. Errors are
+ * signaled by negative errno values for the rcv length
+ */
+
+ if (pstate->pr_result < 0)
+ {
+ /* This might return EAGAIN on a timeout or ENOTCONN on loss of
+ * connection (TCP only)
+ */
+
+ return pstate->pr_result;
+ }
+
+ /* If net_lockedwait failed, then we were probably reawakened by a signal.
+ * In this case, net_lockedwait will have returned negated errno
+ * appropriately.
+ */
+
+ if (result < 0)
+ {
+ return result;
+ }
+
+ return pstate->pr_recvlen;
+}
+
+/****************************************************************************
+ * Name: can_recvfrom
+ *
+ * Description:
+ * recvfrom() receives messages from a socket, and may be used to receive
+ * data on a socket whether or not it is connection-oriented.
+ *
+ * If from is not NULL, and the underlying protocol provides the source
+ * address, this source address is filled in. The argument 'fromlen'
+ * initialized to the size of the buffer associated with from, and modified
+ * on return to indicate the actual size of the address stored there.
+ *
+ * Input Parameters:
+ * psock A pointer to a NuttX-specific, internal socket structure
+ * buf Buffer to receive data
+ * len Length of buffer
+ * flags Receive flags (ignored)
+ * from Address of source (may be NULL)
+ * fromlen The length of the address structure
+ *
+ ****************************************************************************/
+
+ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
+ size_t len, int flags,
+ FAR struct sockaddr *from,
+ FAR socklen_t *fromlen)
+{
+ FAR struct can_conn_s *conn;
+ FAR struct net_driver_s *dev;
+ struct can_recvfrom_s state;
+ int ret;
+
+ DEBUGASSERT(psock != NULL && psock->s_conn != NULL && buf != NULL);
+ DEBUGASSERT(from == NULL ||
+ (fromlen != NULL && *fromlen >= sizeof(struct sockaddr_can)));
+
+ conn = (FAR struct can_conn_s *)psock->s_conn;
+
+ if (psock->s_type != SOCK_RAW)
+ {
+ nerr("ERROR: Unsupported socket type: %d\n", psock->s_type);
+ ret = -ENOSYS;
+ }
+
+
+ net_lock();
+
+ /* Initialize the state structure. */
+
+ memset(&state, 0, sizeof(struct can_recvfrom_s));
+
+ /* This semaphore is used for signaling and, hence, should not have
+ * priority inheritance enabled.
+ */
+
+ nxsem_init(&state.pr_sem, 0, 0); /* Doesn't really fail */
+ nxsem_setprotocol(&state.pr_sem, SEM_PRIO_NONE);
+
+ state.pr_buflen = len;
+ state.pr_buffer = buf;
+
+ /* Get the device driver that will service this transfer */
+
+ dev = conn->dev;
+ if (dev == NULL)
+ {
+ ret = -ENODEV;
+ goto errout_with_state;
+ }
+
+ /* Set up the callback in the connection */
+
+ state.pr_cb = can_callback_alloc(dev, conn);
+ if (state.pr_cb)
+ {
+ state.pr_cb->flags = (CAN_NEWDATA | CAN_POLL);
+ state.pr_cb->priv = (FAR void *)&state;
+ state.pr_cb->event = can_recvfrom_eventhandler;
+
+ /* Wait for either the receive to complete or for an error/timeout to
+ * occur. NOTES: (1) net_lockedwait will also terminate if a signal
+ * is received, (2) the network is locked! It will be un-locked while
+ * the task sleeps and automatically re-locked when the task restarts.
+ */
+
+ ret = net_lockedwait(&state.pr_sem);
+
+ /* Make sure that no further events are processed */
+
+ can_callback_free(dev, conn, state.pr_cb);
+ ret = can_recvfrom_result(ret, &state);
+ }
+ else
+ {
+ ret = -EBUSY;
+ }
+
+
+errout_with_state:
+ net_unlock();
+ nxsem_destroy(&state.pr_sem);
+ return ret;
+}
+
+#endif /* CONFIG_NET_CAN */
diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c
index 1de95d9..0cd389a 100644
--- a/net/can/can_sockif.c
+++ b/net/can/can_sockif.c
@@ -69,9 +69,6 @@ static ssize_t can_send(FAR struct socket *psock,
static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
size_t len, int flags, FAR const struct sockaddr *to,
socklen_t tolen);
-static ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
- size_t len, int flags, FAR struct sockaddr *from,
- FAR socklen_t *fromlen);
static int can_close(FAR struct socket *psock);
/****************************************************************************
@@ -99,12 +96,13 @@ const struct sock_intf_s g_can_sockif =
can_close /* si_close */
};
+
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
- * Name: inet_setup
+ * Name: can_setup
*
* Description:
* Called for socket() to verify that the provided socket type and
@@ -684,55 +682,6 @@ static ssize_t can_sendto(FAR struct socket *psock, FAR const void *buf,
}
/****************************************************************************
- * Name: can_recvfrom
- *
- * Description:
- * recvfrom() receives messages from a socket, and may be used to receive
- * data on a socket whether or not it is connection-oriented.
- *
- * If from is not NULL, and the underlying protocol provides the source
- * address, this source address is filled in. The argument 'fromlen'
- * initialized to the size of the buffer associated with from, and modified
- * on return to indicate the actual size of the address stored there.
- *
- * Input Parameters:
- * psock A pointer to a NuttX-specific, internal socket structure
- * buf Buffer to receive data
- * len Length of buffer
- * flags Receive flags (ignored)
- * from Address of source (may be NULL)
- * fromlen The length of the address structure
- *
- ****************************************************************************/
-
-static ssize_t can_recvfrom(FAR struct socket *psock, FAR void *buf,
- size_t len, int flags,
- FAR struct sockaddr *from,
- FAR socklen_t *fromlen)
-{
- FAR struct can_conn_s *conn;
- int ret;
-
- DEBUGASSERT(psock != NULL && psock->s_conn != NULL && buf != NULL);
- DEBUGASSERT(from == NULL ||
- (fromlen != NULL && *fromlen >= sizeof(struct sockaddr_can)));
-
- conn = (FAR struct can_conn_s *)psock->s_conn;
-#warning Missing logic
-
- switch (conn->protocol)
- {
-#warning Missing logic
-
- default:
- ret = -EOPNOTSUPP;
- break;
- }
-
- return ret;
-}
-
-/****************************************************************************
* Name: can_close
*
* Description:
diff --git a/net/devif/Make.defs b/net/devif/Make.defs
index b2dca4a..57aac89 100644
--- a/net/devif/Make.defs
+++ b/net/devif/Make.defs
@@ -62,7 +62,11 @@ endif
# Raw packet socket support
-ifeq ($(filter y,$(CONFIG_NET_PKT) $(CONFIG_NET_CAN)),)
+ifeq ($(CONFIG_NET_PKT),y)
+NET_CSRCS += devif_pktsend.c
+endif
+
+ifeq ($(CONFIG_NET_CAN),y)
NET_CSRCS += devif_pktsend.c
endif
[incubator-nuttx] 05/31: Added GPIO code to test SocketCAN
performance
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 5076da1aabb04f3ff7ee8c9cb176b33700aa03ce
Author: Peter van der Perk <pe...@nxp.com>
AuthorDate: Wed Feb 19 17:46:37 2020 +0100
Added GPIO code to test SocketCAN performance
---
arch/arm/src/s32k1xx/s32k1xx_flexcan.c | 94 ++++++++++++++++------------------
1 file changed, 43 insertions(+), 51 deletions(-)
diff --git a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
index 74a21b8..7046050 100644
--- a/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
+++ b/arch/arm/src/s32k1xx/s32k1xx_flexcan.c
@@ -115,20 +115,19 @@
# error "Need at least one RX buffer"
#endif*/
-#define S32K1XX_FLEXCAN_FIRST_TX_MB 10
-
#define MaskStdID 0x000007FF;
#define MaskExtID 0x1FFFFFFF;
//Fixme nice variables/constants
-#define NumMBinFiFoAndFilters 10 //FIXME
-#define NumTxMesgBuffers 6
-#define HWMaxMB 16
-#define TXMBMask (0b111111 << NumMBinFiFoAndFilters)
+#define RxMBCount 10
+#define TxMBCount 6
+#define TotalMBcount RxMBCount + TxMBCount
+#define TXMBMask (((1 << TxMBCount)-1) << RxMBCount)
#define CAN_FIFO_NE (1 << 5)
#define CAN_FIFO_OV (1 << 6)
#define CAN_FIFO_WARN (1 << 7)
+#define FIFO_IFLAG1 CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV
static int peak_tx_mailbox_index_ = 0;
@@ -449,12 +448,12 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
struct can_frame *frame = (struct can_frame*)priv->dev.d_buf;
- /*printf("CAN id: %i dlc: %i", frame->can_id, frame->can_dlc);
+ /*ninfo("CAN id: %i dlc: %i", frame->can_id, frame->can_dlc);
for(int i = 0; i < frame->can_dlc; i++){
- printf(" %02X", frame->data[i]);
+ ninfo(" %02X", frame->data[i]);
}
- printf("\r\n");*/
+ ninfo("\r\n");*/
/* Attempt to write frame */
uint32_t mbi = 0;
@@ -463,9 +462,9 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mbi = (getreg32(S32K1XX_CAN0_ESR2) & CAN_ESR2_LPTM_MASK) >> CAN_ESR2_LPTM_SHIFT;
}
- uint32_t mb_bit = 1 << (NumMBinFiFoAndFilters + mbi);
+ uint32_t mb_bit = 1 << (RxMBCount + mbi);
- while (mbi < NumTxMesgBuffers)
+ while (mbi < TxMBCount)
{
if (priv->tx[mbi].CS.code != CAN_TXMB_DATAORREMOTE)
@@ -477,7 +476,7 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
mbi++;
}
- if (mbi == NumTxMesgBuffers)
+ if (mbi == TxMBCount)
{
return 0; // No transmission for you!
}
@@ -502,7 +501,8 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
//cs.rtr = frame.isRemoteTransmissionRequest();
cs.dlc = frame->can_dlc;
- //FIXME endian swap instruction or somekind
+
+ //FIXME endian swap instruction or somekind takes 1.5us right now
mb->data.b0 = frame->data[0];
mb->data.b1 = frame->data[1];
mb->data.b2 = frame->data[2];
@@ -522,6 +522,9 @@ static int s32k1xx_transmit(FAR struct s32k1xx_driver_s *priv)
txi.abort_on_error = (flags & uavcan::CanIOFlagAbortOnError) != 0;
txi.pending = TxItem::busy;*/
+
+ s32k1xx_gpiowrite(PIN_PORTD | PIN31, 0);
+
mb->CS = cs; // Go.
uint32_t regval;
@@ -641,7 +644,7 @@ static inline void s32k1xx_dispatch(FAR struct s32k1xx_driver_s *priv)
static void s32k1xx_receive(FAR struct s32k1xx_driver_s *priv)
{
#warning Missing logic
- printf("FLEXCAN: receive\r\n");
+ ninfo("FLEXCAN: receive\r\n");
}
/****************************************************************************
@@ -673,14 +676,14 @@ static void s32k1xx_txdone(FAR struct s32k1xx_driver_s *priv)
/* Process TX completions */
- uint32_t mb_bit = 1 << NumMBinFiFoAndFilters;
- for(uint32_t mbi = 0; tx_iflags && mbi < NumTxMesgBuffers; mbi++)
+ uint32_t mb_bit = 1 << RxMBCount;
+ for(uint32_t mbi = 0; tx_iflags && mbi < TxMBCount; mbi++)
{
if (tx_iflags & mb_bit)
{
putreg32(mb_bit, S32K1XX_CAN0_IFLAG1);
tx_iflags &= ~mb_bit;
- const bool txok = priv->tx[mbi].CS.code != CAN_TXMB_ABORT;
+ //const bool txok = priv->tx[mbi].CS.code != CAN_TXMB_ABORT;
//handleTxMailboxInterrupt(mbi, txok, utc_usec);
}
mb_bit <<= 1;
@@ -734,8 +737,9 @@ static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
{
#warning Missing logic
+ ninfo("FLEXCAN INT %i\r\n", irq);
+
FAR struct s32k1xx_driver_s *priv = &g_flexcan[0];
- uint32_t FIFO_IFLAG1 = CAN_FIFO_NE | CAN_FIFO_WARN | CAN_FIFO_OV;
uint32_t flags;
flags = getreg32(S32K1XX_CAN0_IFLAG1);
flags &= FIFO_IFLAG1;
@@ -773,7 +777,7 @@ static int s32k1xx_flexcan_interrupt(int irq, FAR void *context, FAR void *arg)
static void s32k1xx_txtimeout_work(FAR void *arg)
{
#warning Missing logic
- printf("FLEXCAN: tx timeout work\r\n");
+ ninfo("FLEXCAN: tx timeout work\r\n");
}
/****************************************************************************
@@ -798,7 +802,7 @@ static void s32k1xx_txtimeout_work(FAR void *arg)
static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
{
#warning Missing logic
- printf("FLEXCAN: tx timeout expiry\r\n");
+ ninfo("FLEXCAN: tx timeout expiry\r\n");
}
/****************************************************************************
@@ -821,7 +825,7 @@ static void s32k1xx_txtimeout_expiry(int argc, uint32_t arg, ...)
static void s32k1xx_poll_work(FAR void *arg)
{
#warning Missing logic
- //printf("FLEXCAN: poll work\r\n");
+ //ninfo("FLEXCAN: poll work\r\n");
FAR struct s32k1xx_driver_s *priv = (FAR struct s32k1xx_driver_s *)arg;
@@ -941,11 +945,14 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
uint32_t regval;
#warning Missing logic
- printf("FLEXCAN: test ifup\r\n");
+ ninfo("FLEXCAN: test ifup\r\n");
/* initialize CAN device */
//FIXME we only support a single can device for now
+ //TEST GPIO tming
+ s32k1xx_pinconfig(PIN_PORTD | PIN31 | GPIO_OUTPUT);
+
regval = getreg32(S32K1XX_CAN0_MCR);
regval |= CAN_MCR_MDIS;
@@ -964,7 +971,7 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
regval = getreg32(S32K1XX_CAN0_MCR);
regval |= CAN_MCR_RFEN | CAN_MCR_SLFWAK | CAN_MCR_WRNEN | CAN_MCR_SRXDIS
| CAN_MCR_IRMQ | CAN_MCR_AEN |
- (((HWMaxMB - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
+ (((TotalMBcount - 1) << CAN_MCR_MAXMB_SHIFT) & CAN_MCR_MAXMB_MASK);
putreg32(regval, S32K1XX_CAN0_MCR);
regval = CAN_CTRL2_RRS | CAN_CTRL2_EACEN | CAN_CTRL2_RFFN_16MB; //FIXME TASD
@@ -974,7 +981,7 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
s32k1xx_setfreeze(1);
if(!s32k1xx_waitfreezeack_change(1))
{
- printf("FLEXCAN: freeze fail\r\n");
+ ninfo("FLEXCAN: freeze fail\r\n");
return -1;
}
@@ -1035,50 +1042,35 @@ static int s32k1xx_ifup(struct net_driver_s *dev)
#endif
- /* Filtering catchall */
- putreg32(0, S32K1XX_CAN0_RXFGMASK);
/* Iniatilize all MB rx and tx */
- /*for(int i = 0; i < HWMaxMB; i++)
+ for(int i = 0; i < TotalMBcount; i++)
{
+ ninfo("MB %i %p\r\n", i, &priv->rx[i]);
+ ninfo("MB %i %p\r\n", i, &priv->rx[i].ID.w);
priv->rx[i].CS.cs = 0x0;
priv->rx[i].ID.w = 0x0;
priv->rx[i].data.l = 0x0;
priv->rx[i].data.h = 0x0;
- }*/
+ }
+
+ /* Filtering catchall */
+ putreg32(0x0, S32K1XX_CAN0_RXFGMASK);
- //FIXME max mb
- for(int i = 0; i < HWMaxMB; i++)
+ for(int i = 0; i < TotalMBcount; i++)
{
putreg32(0,S32K1XX_CAN0_RXIMR(i));
}
- putreg32(0,S32K1XX_CAN0_RXIMR0);
- putreg32(0,S32K1XX_CAN0_RXIMR1);
- putreg32(0,S32K1XX_CAN0_RXIMR2);
- putreg32(0,S32K1XX_CAN0_RXIMR3);
- putreg32(0,S32K1XX_CAN0_RXIMR4);
- putreg32(0,S32K1XX_CAN0_RXIMR5);
- putreg32(0,S32K1XX_CAN0_RXIMR6);
- putreg32(0,S32K1XX_CAN0_RXIMR7);
- putreg32(0,S32K1XX_CAN0_RXIMR8);
- putreg32(0,S32K1XX_CAN0_RXIMR9);
- putreg32(0,S32K1XX_CAN0_RXIMR10);
- putreg32(0,S32K1XX_CAN0_RXIMR11);
- putreg32(0,S32K1XX_CAN0_RXIMR12);
- putreg32(0,S32K1XX_CAN0_RXIMR13);
- putreg32(0,S32K1XX_CAN0_RXIMR14);
- putreg32(0,S32K1XX_CAN0_RXIMR15);
-
- putreg32(CAN_IFLAG1(1) | TXMBMask, S32K1XX_CAN0_IFLAG1); //FIXME dynamic MXMB
- putreg32(CAN_IFLAG1(1), S32K1XX_CAN0_IMASK1);
+ putreg32(FIFO_IFLAG1 | TXMBMask, S32K1XX_CAN0_IFLAG1);
+ putreg32(FIFO_IFLAG1, S32K1XX_CAN0_IMASK1);
/* Exit freeze mode */
s32k1xx_setfreeze(0);
if(!s32k1xx_waitfreezeack_change(0))
{
- printf("FLEXCAN: unfreeze fail\r\n");
+ ninfo("FLEXCAN: unfreeze fail\r\n");
return -1;
}
@@ -1381,7 +1373,7 @@ int s32k1xx_netinitialize(int intf)
priv->txtimeout = wd_create(); /* Create TX timeout timer */
priv->rx = (struct MbRx *)(S32K1XX_CAN0_MB);
priv->tx = (struct MbTx *)(S32K1XX_CAN0_MB + (sizeof(struct MbRx)
- * S32K1XX_FLEXCAN_FIRST_TX_MB) );
+ * RxMBCount) );
/* Put the interface in the down state. This usually amounts to resetting
* the device and/or calling s32k1xx_ifdown().