Commit Graph

49347 Commits

Author SHA1 Message Date
zhanghongyu
fc0ecd4e9e if_arp: add arphdr definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:37:58 +08:00
zhanghongyu
586c89b754 icmp6: add icmp6-related definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:37:21 +08:00
zhanghongyu
e565868eb4 udp: add udphdr definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:36:27 +08:00
zhanghongyu
0acd3078ff ip6: add ip6-related definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:35:43 +08:00
zhanghongyu
f387b138d9 ip: add iphdr definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:35:16 +08:00
zhanghongyu
88d62a1157 if: add net device type
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:34:39 +08:00
zhanghongyu
89eb41797d route: add struct in6_rtmsg definition
adapts to third-party code compilation. in the process of porting ConnMan,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 19:34:06 +08:00
zhanghongyu
c288752bef recvmsg: control msg support multi-attribute return
adapts to third-party code compilation. in the process of porting ConnMan,
multiple control message options are enabled, such as IPV6_RECVPKTINFO and
IPV6_RECVHOPLIMIT, so I changed the Filling implementation of the control
message.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-04 12:04:11 +02:00
Alan Carvalho de Assis
bac304afc0 boards: Fix CONFIG_[START_DATE,START_MONTH] cannot start with 0
Run:
$ ./tools/refresh.sh --silent --defaults all

It will report that CONFIG_START_DATE and/or CONFIG_START_MONTH
are using invalid value starting with 0, so 03 should be 3, and so
on.
2023-05-04 10:11:36 +08:00
simbit18
b1404f486e include: Fix nxstyle errors
error: Long line found
2023-05-04 02:07:01 +08:00
zouboan
e7df243a4a boards/nucleo-f429zi: update CONFIG name to keep up with the CONFIG in arch/stm32 2023-05-03 15:05:25 -03:00
Tiago Medicci Serrano
24ce51f137 documentation/esp32_esp32s3: update informations about Wi-Fi
Add links for `wapi` referencing and links through documentation
pages that indicate Wi-Fi behavior on ESP32 and ESP32-S3.
2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
28361a295d esp32/wifi: add support to WPA3 on Station Mode
Add support to select WPA3-SAE while connecting to an AP. Please
note that STA mode sets a security threshold, i.e, it was able to
connect to a WPA3-SAE network prior to this change because it
connects to an equally or more secure network than the set
threshold. Considering this patch, the device is now able to
ignore WPA2-PSK APs when WPA3 is set.
2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
6e76229df2 esp32/wifi: remove debug features from Wi-Fi-related defconfigs 2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
9ede7d4650 esp32s3/wifi: add support to WPA3 on Station Mode
Add support to select WPA3-SAE while connecting to an AP. Please
note that STA mode sets a security threshold, i.e, it was able to
connect to a WPA3-SAE network prior to this change because it
connects to an equally or more secure network than the set
threshold. Considering this patch, the device is now able to
ignore WPA2-PSK APs when WPA3 is set.
2023-05-03 23:23:31 +08:00
Tiago Medicci Serrano
a86a9dc09e esp32s3/wifi: fix Wi-Fi's NVS-like storage long filename error
While using NVS-like storage of the Wi-Fi driver, an error was
thrown while trying to access a file whose name was longer than
the mounted SPIFFS `CONFIG_SPIFFS_NAME_MAX`.
2023-05-03 23:23:31 +08:00
Xiang Xiao
a514c0a13e mtd/nand: Implement isbad and markbad callback
these new callbacks are added by:
https://github.com/apache/nuttx/pull/8683

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:18 +03:00
Xiang Xiao
3e1ddb3de9 mtd/nand: Return -EUCLEAN when the bit error happen but fixed by ecc
follow how Linux report the correction information from ecc:
http://www.infradead.org/pipermail/linux-mtd/2012-March/040305.html
since this information is very useful to file system(e.g. yaffs, ubi/buifs)
which is specially designed for nand flash.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:18 +03:00
Xiang Xiao
74e2b75857 net: Simplify the tcp/udp existence check
Replace defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK) with NET_TCP_HAVE_STACK
Replace defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK) with NET_UDP_HAVE_STACK

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:00 +03:00
Xiang Xiao
5de49d2939 net: Remove the extra space
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 15:18:21 +02:00
Xiang Xiao
df246461ec net/can: Remove the unnecessary "ret = OK;" in can_getsockopt
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 15:18:21 +02:00
liuhaitao
db84cd2e59 tools: add git pre-commit hook based on checkpatch.sh
tools/pre-commit should be copied to .git/hooks/pre-commit to take
effect.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2023-05-03 14:42:34 +02:00
fangxinyong
f1e37a4987 libs/libxx: remove redundant code
Follow the change: https://github.com/apache/nuttx/pull/9151,
that is no need to deal with zero size in C++ allocator.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-05-03 19:54:19 +08:00
zhangyuan21
884be2bdb9 assert: Distinguish between assert and exception
CURRENT_REGS may change during assert handling, so pass
in the 'regs' parameter at the entry point of _assert.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-03 14:49:32 +08:00
Tiago Medicci Serrano
5a1efdecfd documentation: add references to RTP Tools' defconfigs
Added examples of using the RTP Tools (`rtpdump`, in particular)
to receive RTP packets and 1) print the data and/or 2) playback
audio content through I2S.
2023-05-03 07:57:11 +02:00
Tiago Medicci Serrano
0f808a352a boards/esp32-lyrat/configs: add defconfig for RTP Tools
RTP Tools is a set of small applications that can be used for
processing RTP data. This application is able to receive RTP
packets and write the content to a FIFO. `nxplayer` then reads
from the FIFO, enabling using NuttX as a RTP receiver for audio
applications.

This is particularly useful to stream uncompressed audio through
Wi-Fi to remote speakers.
2023-05-03 07:57:11 +02:00
Tiago Medicci Serrano
34dbfa0370 boards/sim/configs: add defconfig for RTP Tools
RTP Tools is a set of small applications that can be used for
processing RTP data. This `defconfig` builds the `rtpdump` and
is able to receive RTP packets and print the contents.
2023-05-03 07:57:11 +02:00
Lwazi Dube
e2083354f1 arch/arm/sama5: Use a recursive mutex to fix OHCI deadlock.
Unplugging a USB device from an OHCI root hub will cause
a deadlock if DRVR_EPFREE is called from sam_rhsc_bottomhalf. A
typical call chain looks like this: sam_rhsc_bottomhalf->
CLASS_DISCONNECTED->usbhost_destroy->DRVR_EPFREE. In this case
DRVR_EPFREE tries to lock a locked mutex. A recursive mutex
prevents this deadlock.
2023-05-03 12:53:30 +08:00
simbit18
79574c18d8 arch: Fix nxstyle errors
error: Long line found
2023-05-02 18:31:40 -06:00
Petro Karashchenko
fa07c90522 mm/tlsf: fix compilation warnings
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-02 18:29:29 -06:00
Petro Karashchenko
5a298e8685 mm: memory allocations return valid pointer when request 0 size
This change introduce 2 items:
1. If the size of the space requested is 0, the behavior is implementation-defined:
   either a null pointer shall be returned, or the behavior shall be as if the size
   were some non-zero value, except that the behavior is undefined if the returned
   pointer is used to access an object.

   Change the behavior to be similar to Linux and Android and allocates an object
   of a minimum size instead of returning null pointer.

   https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/calloc.html
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html

2. The description of realloc() has been modified from previous versions of this
   standard to align with the ISO/IEC 9899:1999 standard. Previous versions explicitly
   permitted a call to realloc (p, 0) to free the space pointed to by p and return
   a null pointer. While this behavior could be interpreted as permitted by this
   version of the standard, the C language committee have indicated that this
   interpretation is incorrect. Applications should assume that if realloc() returns
   a null pointer, the space pointed to by p has not been freed. Since this could lead
   to double-frees, implementations should also set errno if a null pointer actually
   indicates a failure, and applications should only free the space if errno was changed.

   Do not free memory of zero-length reallocation is requested

   https://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html

Co-authored-by: fangxinyong <fangxinyong@xiaomi.com>
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-02 18:29:29 -06:00
Tiago Medicci Serrano
ea276b20ef audio/pcm_decode: fix warnings regarding unused functions and vars
* 'pcm_dump' available if 'CONFIG_DEBUG_AUDIO_INFO' is set
instead of using the 'CONFIG_PCM_DEBUG'.
* 'pcm_leuint16' and 'pcm_leuint32' available if
'CONFIG_AUDIO_FORMAT_RAW' is not set (once 'pcm_parsewav', which
is available under the same condition, use them).
* 'headersize' var, from 'pcm_enqueuebuffer' declared only if
'CONFIG_AUDIO_FORMAT_RAW' is not set (as it's used by the code
defined by the same condition).
2023-05-02 19:19:14 +03:00
Xiang Xiao
7a725019bc mtd/nand: Add nand_raw_initialize to skip the probing
Since not all nand devices follow ONFI spec, nand_raw_initialize could be used to skip ONFI special action

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-02 15:02:38 +02:00
Xiang Xiao
b4814811f5 mtd/nand: Implement MTDIOC_ERASESECTORS ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-02 12:15:56 +02:00
Xiang Xiao
3fc882df9e mtd/nand: Implement MTDIOC_ERASESTATE ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-02 12:15:56 +02:00
Xiang Xiao
3c54e66683 mtd/nand: Fix the comment and remove the uneeded inclusion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-01 22:47:00 +03:00
Xiang Xiao
25a1191763 mtd/nand: Correct the check of erasing bad blocks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-01 22:47:00 +03:00
Xiang Xiao
c1680d2f03 mtd/nand: Call nandmodel_getdevpagesize directly to get the page number
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-01 22:47:00 +03:00
Stuart Ianna
4e2a8d4492 libc: Add setbuffer to stdio.
The setbuffer() function is a wrapper around setvbuf() which
enables full buffering on a buffer allocated by the caller, assuming
buffer is not a null pointer.
2023-05-01 11:24:41 +03:00
Stuart Ianna
a9fc76c848 include/err: Enforce c linkage for err and warn functions.
This change ensures that xx_func names are not mangled by a c++ compiler
and can be correctly resolved when loaded at runtime.
2023-05-01 12:48:55 +08:00
Tiago Medicci Serrano
f7d64fec9f boards/esp32-devkitc: substitute ramtest to mm on defconfigs
The defconfigs that test PSRAM on ESP32 contain the `ramtest` app,
but it doesn't test the memory correctly as it try to access the
memory directly. The memory, however, is being used by the system's
heap and `ramtest` can mess with it. Therefore, it makes sense to
test using `mm` testing app.
2023-04-30 11:31:23 +08:00
Tiago Medicci Serrano
a49a367226 signal: add macro NSIG 2023-04-30 11:18:29 +08:00
Lwazi Dube
0356d1403d wireless/bluetooth: Initialize private bt_driver_s member. 2023-04-30 00:41:22 +08:00
anjiahao
78bff8e9c5 sig_timewait:changes the macro for waitticks
use SYSTEM_TIME64 inside of LONG LONG better

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-04-30 00:41:06 +08:00
Michal Lenc
02aa7bcefe mtd: add support for MTDIOC_ERASESECTORS ioctl
Current driver supports MTDIOC_BULKERASE ioctl that erases the entire
device. The added ioctl MTDIOC_ERASESECTORS adds possibility to erase
just sectors defined by the user.

This is similar to MEMERASE call in Linux kernel.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-04-29 21:23:08 +08:00
Tiago Medicci Serrano
5afa727eef documentantion/applications: add WAPI documentation
Initial documentation of the WAPI (Wireless API). Currently, `wapi`
is the only interface provided to handle Wi-Fi networking from the
userspace.
2023-04-29 14:35:09 +08:00
Tiago Medicci Serrano
bec4ed482d wireless: add IW_AUTH_WPA_VERSION_WPA3 to support WPA3
Add the `IW_AUTH_WPA_VERSION_WPA3` bit field to support selecting
WPA3-SAE networks using the `IW_AUTH_WPA_VERSION` command.

This commit is necessary to enable `wapi`'s support for WPA3.
2023-04-29 14:35:09 +08:00
anjiahao
0c9ca52f37 tty:support tty c_cc VMIN & VTIME
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-04-29 13:48:52 +08:00
yanghuatao
e9dfa0094f libm/libmcs: add math library libmcs support
add math library libmcs support
(1)open menuconfig  (2)close math.h:build setup->Customize Header Files->math.h (3) select libmcs:Library Rountines->Select math library->Math Library fram LibmCS (4)build

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-04-29 13:47:28 +08:00
TimJTi
9c66f14e38 SAMA5D2 Class D 2023-04-29 13:46:04 +08:00