Commit Graph

4549 Commits

Author SHA1 Message Date
Xiang Xiao
5708015674 netlink: Sync the macro with Linux definition
Change-Id: I0c0895fa17e167c67fb12acfdfc6dc3a7fb63b3b
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-10 08:18:07 -06:00
ligd
ef360394c7 mm/mm_heap: fix mm_heap not support BUILD_FLAT
1. change ifdef __KERNEL__ to:
   if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)

2. change mm_delaylist to *mm_delaylist

3. change FAR struct mm_delaynode_s *new to:
   FAR struct mm_delaynode_s *tmp

4. should check mm_trysemaphore() return values

Change-Id: I57ba991f13c3eaf56dc2d71ac946c11669e32dfa
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-10 07:49:32 -06:00
ligd
cbf31bca5c global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd
231ad202ee global change: repace sched_xfree() to kxmm_free()
Changes:
sched_xfree() => kxmm_free()
remove garbage related APIs
remove ARCH_HAVE_GARBAGE

Cause garbage feature move to mm_heap, then don't need
garbage anymore.

Change-Id: If310790a3208155ca8ab319e8d038cb6ff92c518
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd
cec53bb133 include/nuttx/mm/mm.h: fix MM_IS_ALLOCATED(n) define error
Change-Id: Iceba05c2114813f34bdd6a8a2c59c372c9889f10
2020-04-09 10:29:28 -06:00
ligd
1d2396353e mm/mm_heap: add mm_delaylist to mm_heap_s struct
Change-Id: I2ffaec5557bf2dd2021baa6cda84bb5318425caa
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
hartmannathan
bfc153ca27
Fix typos in comments and documentation (#750)
* Fix typos in comments and documentation
2020-04-08 06:45:35 -06:00
Gregory Nutt
f2e6e131d4 include/nuttx/wdog.h: Add some additional comments. 2020-04-07 17:40:46 +01:00
Gregory Nutt
f9a7417be4 include/nuttx/semaphore.h: Add a NOTE to the uninterruptible wait functions. 2020-04-06 17:08:46 +01:00
YAMAMOTO Takashi
70b1b51ac9 modlib.h: Improve comments 2020-04-06 12:35:02 +08:00
Gregory Nutt
89578b3a89 nxsem_wait_uninterruptble: Now returns if the task is canceled.
See Issue 619.

Also removed inline functions from include/nuttx/semaphore.h.  They just cause too many problems.
2020-04-05 18:10:32 +01:00
Gregory Nutt
a6e69a82ad SDIO: Make interface field names conform to standard.
The SDIO interface structure includes fields with names like recvR1 and others.  These cause "Mixed case identifier" errors from nxstyle in all places they are uses.
This change performs a mass substition of recvR with recv_r to correct this coding standard violation.
2020-04-04 18:15:25 +01:00
raiden00pl
abfb074110 libs/libdsp: fix nxstyle issues 2020-04-03 22:51:39 +01:00
chao.an
55907b0062 netlink: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-03 10:33:31 +02:00
chao.an
9a9d76744b netlink: add NLMSG_OK definition
Change-Id: I4ab4cabd1e6950802eda360d972d2ef5cea30da2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-03 10:33:31 +02:00
chao.an
80c90399e6 netlink: fix typo
Change-Id: Ic4e44374945c925b880ba4058f795317f2816107
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-03 10:33:31 +02:00
Nakamura, Yuuichi
d7352eb855 fix long line comment 2020-04-02 22:08:41 +08:00
Nakamura, Yuuichi
9aee1407f1 fix INTPTR_MAX define 2020-04-02 22:08:41 +08:00
Xiang Xiao
0b662d60fc libc/netdb: Add hostent_s to avoid the change of hostent
and let other function call the new internal function gethostentbyname_r

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic6137d6cf03f75d6ed33e23bf04ae74b7264e682
2020-04-01 16:09:28 -06:00
Xiang Xiao
8d66a316da libc/netdb: Support save the mix of IPv4/IPv6 address into hostent
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I704d38afde14b6d90a7726096fd1f483f96ba237
2020-04-01 16:09:28 -06:00
Alan Carvalho de Assis
c6b01c321c
Check return from nxsem_wait_initialize() (#661)
* Check return from nxsem_wait_initialize()

Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.

This commit is only for those files under drivers/eeprom.
2020-03-30 20:59:47 -06:00
Xiang Xiao
15fac7743c libc/netdb: Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Gregory Nutt
0558aa0a78 "Uninterruptible" semaphore waits must return when canceled.
nxsem_timedwait_uninterruptible() must return -ECANCELED if the thread is canceled:

        include/nuttx/semaphore.h:  Return if nxsem_wait() returns ECANCELED meaning that the thread waiting for the semaphore has been canceled.
        sched/semaphore/sem_timedwait.c:  Same change (the inline version is in semaphore.h, the non-inlined version is in sem_tickwait.c).
        drivers/sensors/lps25h.c and drivers/wireless/bluetooth/bt_uart_bcm4343x.c:  Make sure that the caller deals correctly with the -ECANCELED return value.

    Refer to issue 619.
2020-03-29 11:58:28 -03:00
Gregory Nutt
44b8f3e467 include/nuttx/sched.h: Move prototype for sched_releasetcb()
Move the prototype for the internal OS from from sched/sched/sched.h to include/nuttx/sched.h.  This was done because binfmt/binfmt/excecmodule.c requires the prototype for sched_releasetcb() and was illegally including sched/sched/sched.h.  That is a blatant violation of the OS modular design and the person that did this should be hung up by their thumbs.  Oh... I did that back in a bad moment in 2014.  Now that is made right.
2020-03-26 14:12:34 -03:00
YAMAMOTO Takashi
27aa16111c sim: hostfs: Stop assuming CONFIG_NAME_MAX=32 2020-03-25 20:31:32 -06:00
YAMAMOTO Takashi
c65bdde5ac include/nuttx/fs/hostfs.h: Appease nxstyle errors 2020-03-25 20:31:32 -06:00
Gregory Nutt
547a3cb3d9 Run all .c and .h files in previous commits through nxstyle. 2020-03-22 08:24:07 -05:00
Gregory Nutt
d22b22a23f syscall/: Remove support for CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Gregory Nutt
74ce4ab0ee include/: Remove support for CONFIG_FS_WRITABLE 2020-03-22 08:24:07 -05:00
Andrey Zabolotnyi
73b655f3b2
stm32h7_qspi: support for custom clock (not just HCLK) and support for DUAL/QUAD commands (#582)
* stm32h7_qspi: Board.h now may define the BOARD_QSPI_CLK macro to select one of
RCC_D1CCIPR_QSPISEL_{HCLK,PLL1,PLL2,PER} clocks to use with QUADSPI peripherial.
Defaults to HCLK for backward compatibility.
New macros in qspi.h: QSPICMD_IDUAL and QSPICMD_IQUAD for selecting the bit
width for instruction code (1,2 or 4 bits) of a qspi_cmdinfo_s, and
QSPIMEM_IDUAL and QSPIMEM_IQUAD for selecting the bit width of a qspi_meminfo_s.

* NX style fixes
2020-03-19 05:59:18 -07:00
Nathan Hartman
a5e643b0cd Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
YAMAMOTO Takashi
061b796d47 Adapt dlfcn/modlib to use the instruction memory allocator 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
855751b534 Introduce instruction memory allocator
Necessary for dlfcn etc on ESP32, which has separate memory regions
for instruction and data.

known issues/todo
 * consider something similar to dual heaps for PROTOECTED
 * consider to adapt binfmt as well
2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
d624434282 include/elf.h: Add EM_XTENSA 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
39725109fa include/nuttx/compiler.h: Fix a C99 check
The lack of __STDC_VERSION__ means we don't have C99.
2020-03-11 03:56:39 -05:00
YAMAMOTO Takashi
14d037b8d5 include/nuttx/compiler.h: Appease nxstyle errors 2020-03-11 01:14:15 -05:00
Pelle Windestam
1d3afe943a include/nuttx/analog/ads1242.h: fix nxstyle warnings 2020-03-10 07:20:38 -06:00
Pelle Windestam
b6fd522699 drivers/analog: fix nxstyle warnings 2020-03-10 07:20:38 -06:00
YAMAMOTO Takashi
da71a0d0b3 include/nuttx/arch.h: Wrap long lines to make nxstyle happy 2020-03-10 03:54:21 -05:00
YAMAMOTO Takashi
b39ce514ea dlfcn, modlib: Appease nxstyle complaints 2020-03-10 01:53:49 -05:00
YAMAMOTO Takashi
63395b295f include/elf.h: Appease nxstyle errors 2020-03-10 01:48:01 -05:00
Petro Karashchenko
3fa6baec98 spi: change spi_send() interface to support of 32-bit word transfer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2020-03-09 08:03:35 -06:00
YAMAMOTO Takashi
c85cb17f3a nuttx/arch.h: Several nxstyle fixes 2020-03-06 01:41:47 -06:00
Juha Niskanen
83b6953624 drivers/sensors/sgp30.c: Reset I2C in case init msg takes too long
We have experimentally found out that this change helps with somewhat quirky CO2/VOC-sensor.
2020-03-05 08:01:43 -06:00
chao.an
0376cddd6d net: move the _SF*/_SS* definitions to net.h
Build break caused by 23b8b39799
2020-03-04 21:37:34 -06:00
Gregory Nutt
432f8b1e8d include/nuttx/cache.h: Fix a copy-paste error. 2020-03-04 12:37:21 -03:00
Gregory Nutt
cd0a23e50e include/nuttx/cache.h: Fix errors in previous commit
Commit 3b53cd1e57, " Fix improper use of inline" missed conversion of several inline functions.  Also, some functions that require arguments were not handled correctly,

This was noted because there were still hundreds of implementations of the cache stubs in the ez80 build.  This commit adds the missing conversions and fixes the bad function arguments.
2020-03-04 12:09:48 -03:00
Juha Niskanen
f3490e42c3 Fix typos in comments 2020-03-03 09:11:57 -06:00
Gregory Nutt
3b53cd1e57 include/nuttx: Fix improper use of inline
I finally figured out why the ez80 code has gotten so big.  It is because people have been put putting big inline functions in header files.  That is a violation of the coding standard, since only c89 compatibility is required in all common code. But we have been tolerating inline function it because include/nuttx/compiler.h defines 'inline' to be nothing for C89 compilers.

As a result, static inline functions declared within a C file not so bad; the inline qualifier is ignored, if not supported, but otherwise all is well.

But it is catastrophic in header files.  Those static inline functions are included as static functions and implemented in EVERY file that includes those header files, even if the functions are never called.  That makes the code base huge!So there is another PR coming to fix some of the worst offenders.

This commit fixes two of the worst offenders I have encountered so far:  include/nuttx/sempahore.h and cache.h.  But there may be a few other changes needed.  Under include/nuttx there are still inline functions thread.h, inclue/nuttx/list.h, mutex.h, tree.h, and include/nuttx/crypto/blake2s.h with no protection for compilers that do not handler the inline qualifier.  Otherwise we are clean.

With the changes to these two header files, the size of the z20x build is reduced by about 40%.  And incredible size savings.
2020-03-02 22:06:04 +01:00
Xiang Xiao
7794214a7d fs/nfs: Support both IPv6 and TCP
And correctly handle the retransmission
2020-03-02 15:04:07 -06:00
macman88
43dfbdb348 Battery monitor support (#404)
* Adding support for BQ769x0 Battery Monitor IC (Work In Progress)
* Additional changes to support BQ769x0
* Store cell count and chip type when setting up
* Added shutdown, limits, charge/discharge switch, and clear faults operations
* Added support for current measurement; some cleanup
* Updated temperature reporting.  Fixed negative current reporting.
* When setting safety limits, update limit structure with actual values used.
* Added note on battery limit structure
* Updates to BQ769x0.  Re-ordered fault reporting, added fault cache, added ordered fault clearing
2020-02-28 18:18:50 -06:00
macman88
922e67c7cc MCP9844 shutdown mode support (#403)
* Added shutdown support to the MCP9844 sensor driver.
* Clean up debug messages
* Clean up comments and formatting
2020-02-28 16:21:56 -06:00
Masayuki Ishikawa
0bd17b2c9c include: audio: Remove packed_struct from struct ap_buffer_s
NOTE: This change suppresses unaligned access warnings with arm gcc9

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-27 23:31:41 -06:00
Xiang Xiao
46e22d7fd9 syslog/rpmsg: Don't overwrite up_putc
Hook into syslog subsystem like ramlog approach
2020-02-24 08:47:13 -06:00
Xiang Xiao
cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao
bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
YAMAMOTO Takashi
3923a8401f Remove bare greek letters in comments 2020-02-21 06:39:23 -06:00
chao.an
c06adf06b8 binfmt/exec: Make the spawn attribute take effect 2020-02-20 08:55:14 -06:00
chao.an
d07afc934e fcntl: add O_CLOEXEC/FD_CLOEXEC support 2020-02-20 08:20:38 -06:00
chao.an
58599e8e2e fs/vfs/fs_ioctl.c: Add FIONBIO support 2020-02-19 12:08:08 -06:00
Nicholas Chin
0f284c3025 driver/ioexpander: adds driver for the PCA9538 I2C ioexpander 2020-02-19 11:53:08 -06:00
chao.an
5b750fdda0 inclue/sys/file.h: Dummy header for POSIX compliance 2020-02-19 11:48:49 -06:00
Nicholas Chin
85caee63b4 drivers/analog: Adds driver for the ADS7828 I2C analog to digital converter 2020-02-18 14:19:40 -06:00
Xiang Xiao
51a2171c71 ramlog: Remove g_ramlog_syslog_channel since it's same as g_default_channel
And remove syslog_init_e because all initialization is later now and we don't
distinguish the initialition phase anymore after ramlog don't need special
initialize.
2020-02-18 13:04:45 -06:00
Xiang Xiao
dcaaf2d912 ramlog: Remove all ramlog_consoleinit related code
Because we can get the same function by CONSOLE_SYSLOG/syslog_console_init.
BTW, it isn't a good choice to use g_ramlogfops as /dev/console since nsh
will read back what it send out which will surprise most people.
2020-02-18 12:57:43 -06:00
Xiang Xiao
e7d9260014 arch: Customize the typedef of size_t instead of intptr_t
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG.  The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
2020-02-18 07:15:19 -06:00
Gregory Nutt
f5e0bb2d30 Run all files modified by PR274 through nxstyle. 2020-02-15 07:17:22 -06:00
Xiang Xiao
20a9a62fdf Make compare_timespec public so timer driver could reuse it 2020-02-15 07:17:07 -06:00
Juha Niskanen
15b78abccf Fix typos in comments 2020-02-14 08:50:45 -06:00
YAMAMOTO Takashi
c1a32fb9dd compiler.h: clang actually has long long 2020-02-13 08:21:18 -06:00
YAMAMOTO Takashi
710da6022d Fix comment typos 2020-02-12 20:39:47 -06:00
Gregory Nutt
3c0b49448a Network Loopback Driver: A configuration option to control packet size.
Historically, the loopback driver used the largest packet size of all enabled link layer protocols.  This permitted packets to be forward via the loopbak device with no major loss of performance.  However, in experimenting with configurations where no other link layer protocols were enabled, this means the loopback packet size was set to the smallest possible size, to the SLIP minimum of 296 bytes.  This resulted in terrible loopback performance.

    This commit adds an option to increase the loopback packet size with the option CONFIG_NET_LOOPBACK_PACKETSIZE.

    The loopback driver packet buffer should be quite large.  The larger the loopback packet buffer, the better will be TCP performance of the loopback transfers.  The Linux loopback device historically used packet buffers of size 16Kb, but that was increased in recent Linux versions to 64Kb.  Those sizes may be excessive for resource constrained MCUs, however.

    The network still enforces the lower limit that is the maximum packet size of all enabled link layer protocols.  But this new option permits the loopback packet size to be increased from that.

    * net/Kconfig:  Adds CONFIG_NET_LOOPBACK_PKTSIZE option
    * include/nuttx/net/netconfig.h:  Assures that the packet size that is used is at least as large as the largest packet size of other link layer protocols.
    * drivers/net/loopback.c:  Use that larger packet size.
    * boards/sim/sim/sim/configs/tcploop/defconfig:  Set the loopback packet size to 1500
2020-02-10 22:17:32 -03:00
Gregory Nutt
934f468e4a Run all .c and .h files in PR235 through tools/nxstyle. 2020-02-09 07:34:24 -06:00
Xiang Xiao
ac53600e44 sched: Rename sched_cpu_count to sched_cpucount 2020-02-09 07:33:59 -06:00
Xiang Xiao
c34a73e780 syscall: Expose sched_getaffinity and sched_setaffinity 2020-02-09 07:33:38 -06:00
Xiang Xiao
6d69439f58 Call xxx_timer_initialize from clock subsystem
Call xxx_timer_initialize from clock subsystem to make timer ready for use as soon as possiblei and revert the workaround:

commit 0863e771a9
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Apr 26 07:24:57 2019 -0600

    Revert "sched/clock/clock_initialize.c:  clock_inittime() needs to be done with CONFIG_SCHED_TICKLESS and clock_initialize should skip clock_inittime() for external RTC case since the RTC isn't ready yet."

    This reverts commit 2bc709d4b9.

    Commit 2bc709d4b9 was intended to handle the case where up_timer_gettime may not start from zero case.  However, this change has the side-effect of breaking every implementation of tickless mode:  After this change the tickless timer structures are used before they are initialized in clock_inittime().  Initialization happens later when up_initialize is called() when arm_timer_initialize().

    Since the tickless mode timer is very special, one solution might be to

    1. Rename xxx_timer_initialize to up_timer_initialize
    2  Move up_timer_initialize to include/nuttx/arch.h
    3.  Call it from clock subsystem instead up_initialize

    Basically, this change make timer initialization almost same as rtc initialization(up_rtc_initialize).

    For now, however, we just need to revert the change.
2020-02-08 07:40:06 -06:00
Xiang Xiao
76bbed07a4 Call up_irqinitialize from irq subsystem
Call up_irqinitialize from irq subsystem to make the irq ready for use as soon as possible
2020-02-08 07:39:22 -06:00
Xiang Xiao
a8de37fbec Ensure all source code end with one and only one newline
by this command:
git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2020-02-08 07:25:56 -06:00
Masayuki Ishikawa
81f1133174 ELF64 support (#220)
* include: Introduce elf64.h and elf.h

    Added elf64.h for 64bit ELF support and moved common definitions
    from elf32.h to elf.h. Also introduced Elf_xxx to be used in
    common libraries such as binfmt.

  * binfmt, include, modlib, module: Add support for ELF64

    Elf_xxx must be used instead of Elf32_xxx to support ELF64.
    To use ELF64, CONFIG_ELF_64BIT must be enabled.

  * binfmt, modlib: Add support for relocate address

  * arch: risc-v: Add include/elf.h

  * libs: machine: Add risc-v related files.

    NOTE: Currently only supports ELF64

  * boards: maix-bit: Add elf and posix_spawn configurations

  * boards: maix-bit: Add support for module configuration
2020-02-07 17:10:23 -06:00
Peter van der Perk
513475c11c Kinetis renamed TJA1100 to TJA110X registers 2020-02-07 10:04:48 +01:00
Xiang Xiao
1321c34022 drivers/net/phy_notify.c: Use IFNAMSIZ for interface name size
Replace CONFIG_PHY_NOTIFICATION_MAXINTFLEN with IFNAMSIZ
2020-02-02 11:02:39 -06:00
Xiang Xiao
c5b1554d84 Remove NETDEV_LOOPBACK option, NET_LOOPBACK is enough 2020-02-02 08:25:06 -06:00
Xiang Xiao
2d7c072723 Remove duplicated NET_SLIP option from drivers/net/Kconfig 2020-02-02 08:24:50 -06:00
Xiang Xiao
5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
liuguo09
67ae5b3e7f include/nuttx/net/igmp.h: fix build break by previous network changes (#196) 2020-02-01 11:31:23 +00:00
patacongo
e86b516f9d
include/netinet/arp.h: Previous network changes broke the build test (#193) 2020-01-31 21:23:15 +01:00
Xiang Xiao
4a238f2e7b Fix the wrong IPv6 TCP MSS calculation
1280(MTU) - 40(IPv6_HDRLEN) - 20(TCP_HDRLEN) = 1220
2020-01-31 13:45:15 -06:00
Xiang Xiao
3ae5f52757 Add FAR for pointer type for socket header files 2020-01-31 13:45:15 -06:00
Xiang Xiao
c1b0aa118c Remove psock_send and sockfd_socket from net/socket/socket.h
Since both is already declared in include/nuttx/net/net.h and fix other minor issue in network socket layer.
2020-01-31 13:45:15 -06:00
Xiang Xiao
9f9566c0eb Rename net_clone/net_dupsd[2] to psock_dup2/net_dup[2] like vfs 2020-01-31 13:45:14 -06:00
Gregory Nutt
2def8035db sched/sched/sched_getcpu.c: Implement non-standard interface.
If SMP is enabled this function will return the number of the CPU that the thread is running on.  This is non-standard but follows GLIBC if __GNU_SOURCE is enabled.  The returned CPU number is, however, worthless since it returns the CPU number of the CPU that was executing the task when the function was called.  The application can never know the true CPU number of the CPU tht it is running on since that value is volatile and change change at any time.
2020-01-31 20:25:15 +00:00
Xiang Xiao
80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Xiang Xiao
68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Xiang Xiao
affc32c9d1 net/: Fix net checksum related issue
1. Remove the unused and unimplemented ipv6_chksum declaration
2. Update NET_ARCH_CHKSUM description to align with the implementation
3. Declare all checksum function prototype regardless CONFIG_NET_ARCH_CHKSUM
4. Remove the CONFIG_NET_ARCH_CHKSUM guard for tcp_ipv[4|6]_chksum
2020-01-30 07:44:36 -06:00
Gregory Nutt
f27152a1af Fix several coding standard issues in the generic SPI LCD driver. 2020-01-28 12:00:02 -03:00
Dave Marples
e99a8d192d Generic SPI interface for controlling an LCD display 2020-01-28 11:32:35 -03:00
YAMAMOTO Takashi
83354983c3 Fix "with with" typos
In many cases, remove one of them.
In a few places, it looks like a typo of "width" actually.
2020-01-27 08:46:46 +01:00
patacongo
ecb2f99dfb drivers/rwbuffer.c: Fix coding style issues. (#164)
Run .c and .h files affected by PR163 through nxstyle and fix all coding style complaints.

Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
2020-01-25 15:26:42 +01:00
Xiang Xiao
1e3f457c9e Remove TIME_EXTENDED option to more conform C standard
Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files modified in this PR through nxstyle and correct all coding standard problems.

Xiang Xiao <xiaoxiang@xiaomi.com>

    Remove TIME_EXTENDED option to more conform C standard

    Note: the code/data size increment is small
2020-01-23 08:17:22 -06:00
Juha Niskanen
a762c06ed9 Fix typos and some incorrect comments
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run nxstyle against .c and .h files and fix it

Author: Juha Niskanen <juha.niskanen@haltian.com>

    Fix typos and some incorrect comments
2020-01-20 09:32:36 -03:00
cuichaochao
e7b3635a2a include/nuttx/list.h: fix typos 2020-01-18 21:44:07 -06:00
Gregory Nutt
7f888534e3 include/sys/un.h: Remove an incorrect comment and fix some types. Bad comment reported by Junmin Kim <trimind0210@gmail.com> via email. 2020-01-18 15:23:42 -03:00
Oleg
41efa2ae72 drivers/can/can.c: Fix errors with pointers when using internal OS interface (#118)
Author: Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files in last PR through tools/nxstyle and correct all coding standard complaints.

Author: Oleg <ev.mipt@gmail.com>

    * Fix CAN driver to work with internal OS interfaces.  Store internal file pointer in f_priv and use it then to distinct readers (See issue #111)
    * Store reader pointer in f_priv instead of filep
    * Don't need in filep in can_reader_s
2020-01-17 09:46:39 -06:00
raiden00pl
e23d58e86d drivers/sensors/lsm303agr: fix compilation warnings and run through nxstyle; drivers/sensors/lsm6dsl: run through nxstyle 2020-01-16 12:27:18 -03:00
Xiang Xiao
5c5c08efcd network: simplify the timeout process logic
1.Consolidate absolute to relative timeout conversion into one place(_net_timedwait)
2.Drive the wait timeout logic by net_timedwait instead of devif_timer
This patch help us remove devif_timer(period tick) to save the power in the future.

Change-Id: I534748a5d767ca6da8a7843c3c2f993ed9ea77d4
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-11 08:24:49 -06:00
Xiang Xiao
346336bb9e Make the read ahead buffer unselectable
Here is the email loop talk about why it is better to remove the option:
https://groups.google.com/forum/#!topic/nuttx/AaNkS7oU6R0

Change-Id: Ib66c037752149ad4b2787ef447f966c77aa12aad
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-11 08:24:49 -06:00
junmin-kim
db3826bf2c Fix typo in the sockfd_socket description 2020-01-09 07:38:02 -03:00
junmin-kim
3abdc352a8 Update the file_write description in fs.h
Replace with the description taken from fs_write.c

Signed-off-by: junmin-kim <junmindd.kim@samsung.com>
2020-01-08 13:33:43 +08:00
Xiang Xiao
981d7004fa Remove inet_setipid since nobody use it
Change-Id: I8c1ed7308678d9d2e11cadedd78f7755b8f7aa99
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-06 07:45:59 -06:00
Mateusz Szafoni
d644567dff sx127x: fix some coding standard problems (#36) 2020-01-04 08:58:47 -03:00
Xiang Xiao
6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Xiang Xiao
90c52e6f8f Squashed commit of the following:
Author: Gregory Nutt <gnutt@nuttx.org>

    Run all .h and .c files modified in last PR through nxstyle.

Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    Net cleanup (#17)

    * Fix the semaphore usage issue found in tcp/udp

    1. The count semaphore need disable priority inheritance
    2. Loop again if net_lockedwait return -EINTR
    3. Call nxsem_trywait to avoid the race condition
    4. Call nxsem_post instead of sem_post

    * Put the work notifier into free list to avoid the heap fragment in the long run.  Since the allocation strategy is encapsulated internally, we can even refine the implementation later.

    * Network stack shouldn't allocate memory in the poll implementation to avoid the heap fragment in the long run, other modification include:

    1. Select MM_IOB automatically since ICMP[v6] socket can't work without the read ahead buffer
    2. Remove the net lock since xxx_callback_free already do the same thing
    3. TCP/UDP poll should work even the read ahead buffer isn't enabled at all

    * Add NET_ prefix for UDP_NOTIFIER and TCP_NOTIFIER option to align with other UDP/TCP option convention

    * Remove the unused _SF_[IDLE|ACCEPT|SEND|RECV|MASK] flags since there are code to set/clear these flags, but nobody check them.
2019-12-31 09:26:14 -06:00
Xiang Xiao
78904cdb1c wireless: remove unnecessary flags (#10)
Some flags (e.g. IW_TXPOW_NFLAGS) is wrong actually
2019-12-31 07:49:16 -06:00
Xiang Xiao
87cf5c58ae Correct some problems with network timed events when there are multiple network devices in the configuration.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>

    Ran nxstyle against many of the affected files.  But this job was too big for today.  Many of the network drivers under arch are highly non-compiant and generate many, many faults from nxstyle.  Those will have to be visited again another day.

Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    This effects all network drivers as well as timing related portions of net/: devif_poll_tcp_timer shouldn't be skipped in the multiple card case.  devif_timer will be called multiple time in one period if the multiple card exist, the elapsed time calculated for the first callback is right, but the flowing callback in the same period is wrong(very short) because the global variable g_polltimer is used in the calculation.  So let's pass the delay time to devif_timer and remove g_polltimer.
2019-12-24 10:37:30 -06:00
liuhuahang
ce634578dd This change implements the SO_ERROR socket option that is used to obtain the last error reported by the network.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>

    net/: Trivial changes to PR from review.  Biggest difference:  type of s_error changed to int16_t to save a byte or two.

Author: liuhuahang <liuhuahang@xiaomi.com>

    Implement SO_ERROR for getsockopt()
2019-12-24 08:09:55 -06:00
chao.an
fed50a1070 include/nuttx/wireless/wireless.h: Correct number of network commands. 2019-12-17 08:47:52 -06:00
Gregory Nutt
a4a23ef584 arch/sim/src/sim/up_hostfs.c, fs/hostfs/hostfs_rpmsg.c, include/nuttx/fs/hostfs.h: Sync nuttx_stat_s consistent with standard struct. Standard struct stat layout changed with commit ea577f1ddd31b3f67405cbb2a57806c47dd4dd63. 2019-12-13 08:35:00 -06:00
chao.an
eb63227559 include/net, include/nuttx/fs, include/nuttx/wireless: Make wireless definitions more consistent with Linux. 2019-12-13 08:20:07 -06:00
Junmin Kim
e06329f5e7 fs/vfs/fs_open.c: Fix description of nx_open and nx_vopen comments indicate that they return zero on success when, in fact, they return the new file descriptor. 2019-12-12 08:24:14 -06:00
Nathan Hartman
9655730ef8 Fix various typos and spelling errors. 2019-12-12 07:41:51 -06:00
Gregory Nutt
594734e0ae include/nuttx/net/w5500.h: Finishes off register bitfield definitions. Driver will follow. 2019-12-08 10:53:52 -06:00
Gregory Nutt
53cefb812b include/nuttx/net/w5500.h: Header file for the WIZnet S5500 Ethernet chip. Still missing register bit definitions. Driver will follow. 2019-12-08 09:57:42 -06:00
Gregory Nutt
cbde36e406 drivers/analog: Run all wireless drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-05 15:13:55 -06:00
kyChu
db49e62118 Merged in kyChuGit/nuttx/aht10_sensor (pull request #1084)
add new driver support for the ASAIR AHT10 temperature and humidity sensor

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-12-02 14:36:09 +00:00
Gregory Nutt
4ae09a3b80 net/netlink: Redesign the logic that handles notifications of when response data is available. Signal handlers are sub-optimal inside the OS (especially after the preceding change which forces the hand). Instead, use the work queue notifiers as is done with all other network notifiers. 2019-11-28 14:20:40 -06:00
Gregory Nutt
69318b1024 Re-implements reverted commit 344f7bc9f6 in a way that should not have the undesired side-effect. include/nuttx/sched.h: Add a bit to the TCB flags to indicat the thread is a user thread in a syscall. sched/nuttx/nxsig_dispatch.c: Delay dispatching to signal handlers if within a system call. In all syscall implementations: Process delayed signal handling when exiting system call. 2019-11-28 12:47:36 -06:00
Gregory Nutt
cbdd590c82 Revert "include/nuttx/sched.h: Add storage for a previous signal mask. arch/: In all syscall implementations, block all signals before dispatching a system call; resotre signal mask when the system call returns."
Using the sigprocmask() for this purpose has too many side-effects.

This reverts commit 344f7bc9f6.
2019-11-28 11:57:54 -06:00
Gregory Nutt
344f7bc9f6 include/nuttx/sched.h: Add storage for a previous signal mask. arch/: In all syscall implemenations, block all signals before dispatching a system call; resotre signal mask when the system call returnes. 2019-11-28 10:51:29 -06:00
Xiang Xiao
e1e192fc33 net/: icmp[v6] fix ping[6] complain 'WARNING: Received after timeout'. The root cause is that icmp[v6]_pollsetup monitors ICMP[v6]_NEWDATA, but icmp[v6]_input reports ICMP[v6]_ECHOREPLY. This change lets icmp[v6]_input report report ICMP[v6]_NEWDATA to fix this issue and remove ICMP[v6]_ECHOREPLY to avoid the wrong usage in the future. 2019-11-27 08:09:51 -06:00
Xiang Xiao
cf9f2c56cb et/devif/devif_callback.c: devif_event_trigger shouldn't return true if triggers & DEVPOLL_MASK equal zero() 2019-11-24 10:11:19 -06:00
Gregory Nutt
9efadaefc1 net/tcp: Be consistent with units of TIME_WAIT. Units were unspecified in tcp/Kconfig, but assumed to be in units of half seconds in tcp/timer.h. include/nuttx/netconfig does not indicate the units but is apparently assuming seconds. This commit unifies all delays to clearly specified units of seconds. 2019-11-24 09:19:54 -06:00
Gregory Nutt
677b0bf47e Remove all support for the ancient Pascal compiler and pcode interpreter. 2019-11-21 06:58:38 -06:00
kyChu
261a6ff758 Author: Gregory Nutt <gnutt@nuttx.org>
Misc changes made following recommendatinos of tools/nxstyle.

Author: kyChu <hello.kychu@gmail.com>

    drivers/mtd/w25qxxxjv.c:  Add QSPI-based Winbond NOR FLASH driver
    drivers/mtd/Kconfig:  include w25qxxxjv mtd driver to menuconfig
    mtd/mtd.h:  add function prototype of w25qxxxjv_initialize
2019-11-20 17:25:40 -06:00
Gregory Nutt
bc8d964cb9 net/netlink: Add some comments about 'Input Parameters' 2019-11-19 20:46:43 -06:00
Xiang Xiao
b58ccc96e4 include/sys/stat.h and include/sys/types.h: Update struct stat to confirm opengroup spec:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html
2019-11-19 09:54:57 -06:00
Gregory Nutt
936d69da1f net/netlink and include/nuttx/net/netlink.h: Make netlink_add_response() a globally access part of the network interface. This is necesssary to support netlink components that reside outside of the net/ sandbox. 2019-11-18 21:12:50 -06:00
Gregory Nutt
ab78f0ca0a include/netpacket/netlink.h: Backout some preliminary NETLINK_CRYPTO definitions. These are premature (but may come back). 2019-11-17 10:47:24 -06:00
Xiang Xiao
ac9a69384d include/netinet: Add IP and TCP socket options needed by iperf3. 2019-11-17 07:37:12 -06:00
Gregory Nutt
e5812beaf9 syscall/ and include/sys/syscall.h: Fix an inconsistency. In someplaces, getitimer() and setitimer() depend on CONFIG_DISABLE_POSIX_TIMERS=n and in other places they depend on nothing. As a result, there are link failures when CONFIG_DISABLE_POSIX_TIMERS=y. Which is correct? On one hand, these interfaces are not POSIX timers, so conditioning them on on CONFIG_DISABLE_POSIX_TIMERS. I opted to keep the dependence and just apply it consistently. I did this because setitimer() and getitimer() are seldom used so it is really best if a system call is no generated for them in all cases. 2019-11-14 15:10:04 -06:00
Gregory Nutt
8f726181ed include/sys/syscall.h: Should be SYS_getitimer and SYS_setitimer, not SYS_getitime and SYS_setitime. 2019-11-14 10:47:11 -06:00
Gregory Nutt
46818f4064 include/netpacket/netlink.h: NETLINK_CRYPTO messages numbers must no overlap NETLINK_ROUTE message numbers. 2019-11-14 10:00:41 -06:00
Gregory Nutt
741fa461c1 syscall/: Implementation of sysclal for new getitimer and setitimer were incomplete. 2019-11-14 09:48:56 -06:00
Gregory Nutt
82a4111a2b include/netpacket/netlink.h: Add definitions that will be needed for future NETLINK_CRYPTO support. 2019-11-14 09:18:11 -06:00
Juha Niskanen
99a501b668 drivers/syslog/ramlog.c: Fix ramlog readers never woken up when using ramlog as syslog or console.
We also make an attempt to avoid the thundering herd problem if there are multiple readers/pollers.

Patch also removes forcing CONFIG_RAMLOG_CRLF in nuttx/syslog/ramlog.h as there is no point of wasting precious RAM for useless characters.
2019-11-14 07:40:35 -06:00
Gregory Nutt
ace25a78d9 include/cxx/ctime: Remove gititimer and setitimer. These are prototyped in sys/time.h, not time.h. Alternatively, ctime could include sys/time.h. Those APIs should also be in the std namespace. 2019-11-13 14:01:25 -06:00
liuhaitao
9b75ef06ea include/sys/time.h, libs/libc/unistd, sched/timer: Implement alarm(), setitimer() and getitimer() APIs. 2019-11-13 08:10:16 -06:00
Gregory Nutt
0820af5f8d libs/libc/stdio/lib_getdelim.c: Add implementations of the POSIX functions getdelim() and getline(). 2019-11-12 18:58:50 -06:00
Gregory Nutt
5344fff515 include/netpacket/netlink.h: Additional general clean-up. 2019-11-12 14:21:18 -06:00
Gregory Nutt
73b86ee458 include/netpacket/netlink.h: General clean-up and re-organization. 2019-11-12 13:27:19 -06:00
Gregory Nutt
ecbd5a85d7 net/netlink: Fixes from testing with new apps/examples/netlink_route. 2019-11-11 13:38:11 -06:00