add net_lock in the tcp_callback_cleanup & Set the devif_callback_s of
tcp_callback_s to a two-dimensional pointer.
Signed-off-by: wangchen <wangchen41@xiaomi.com>
Optimize the processing logic of UDP TXDrain, reduce thread switching,
and improve timeliness and CPU consumption.
Signed-off-by: wangchen <wangchen41@xiaomi.com>
use netdev_list_lock to protect all network card traversal, registration,
and deregistration operations.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
the maximum retransmission interval allowed for car projects
cannot exceed 6 seconds, and allows for fixed retransmission intervals.
according to the previous algorithm, the retransmission interval
may be 0.5 * 2 ^ 4 = 8 seconds, which does not meet the requirements.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
CLOSE-WAIT - represents waiting for a connection termination request
from the local user.
TCP A TCP B
1. ESTABLISHED ESTABLISHED
2. (Close)
FIN-WAIT-1 --> <SEQ=100><ACK=300><CTL=FIN,ACK> --> CLOSE-WAIT
3. FIN-WAIT-2 <-- <SEQ=300><ACK=101><CTL=ACK> <-- CLOSE-WAIT
4. (Close)
TIME-WAIT <-- <SEQ=300><ACK=101><CTL=FIN,ACK> <-- LAST-ACK
5. TIME-WAIT --> <SEQ=101><ACK=301><CTL=ACK> --> CLOSED
6. (2 MSL)
CLOSED
in the current state, we can continue to send data until the user
calls shutdown or close, then directly enter the TCP_LAST_ACK state
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
According to RFC768 page 2, length feild is the length in octets of this user datagram including this header and the data.
Signed-off-by: gaohedong <gaohedong@xiaomi.com>
Documentation for the NuttX Unit Test Selection (NUTS) app. Includes
information about the configuration options, build dependencies,
currently included test cases and how to extend the test collection with
new unit tests.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
According to RFC768 page2 and referring to the Linux implementation, the message with udp length of 0 is supported.
Signed-off-by: gaohedong <gaohedong@xiaomi.com>
This duplicates the up_invalidate_dcache_all as vexriscv's DBUS cache
does not distinguish between flushing and invalidation.
Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
Reduce the downloads of esp-hal-3rdparty when using nxtmpdir to store
esp-hal-3rdparty and speedup compilation after `make distclean`.
Usage:
```
~/nuttxspace/nuttx/make distclean
~/nuttxspace/nuttx/./tools/configure.sh -l -S esp32-devkitc:nsh
~/nuttxspace/nuttx/make flash -j 8 ESPTOOL_PORT=/dev/ttyUSB0
~/nuttxspace/nuttx/picocom /dev/ttyUSB0 --baud 115200
```
Result:
```
load:0x40080000,len:30516
entry 0x40082880
*** Booting NuttX ***
dram: lma 0x00001020 vma 0x3ffb2020 len 0xe30 (3632)
iram: lma 0x00001e58 vma 0x40080000 len 0x7734 (30516)
padd: lma 0x00009598 vma 0x00000000 len 0x6a60 (27232)
imap: lma 0x00010000 vma 0x400e0000 len 0x11e50 (73296)
padd: lma 0x00021e58 vma 0x00000000 len 0xe1a0 (57760)
dmap: lma 0x00030000 vma 0x3f410000 len 0x2d3c (11580)
total segments stored 6
WARNING: NuttX supports ESP32 chip revision >= v3.0 (chip is v1.0).
Ignoring this error and continuing because `ESP32_IGNORE_CHIP_REVISION_CHECK` is set...
THIS MAY NOT WORK! DON'T USE THIS CHIP IN PRODUCTION!
NuttShell (NSH) NuttX-12.8.0
nsh> uname -a
NuttX 12.8.0 edf89ddedd-dirty Dec 22 2025 09:21:37 xtensa esp32-devkitc
nsh>
Terminating...
```
Any new `make distclean` and configure for a different espressif device
no longer requires the downloading of modules or patching.
Signed-off-by: Laczen JMS <laczenjms@gmail.com>
According to the feedback from SPDX community we should use
LicenseRef-NuttX-PublicDomain because NuttX-PublicDomain
is not a valid SPDX id, so it will fail tests for SPDX spec compliance.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This interface needs to be called in the libc library, but the interface is implemented in the kernel, so this interface needs to be exposed
Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
To avoid memory waste, can add support for using an independent iob buffer
The IP protocol often configures CONFIG_IOB_BUFSIZE to be relatively large,
such as 512, for higher throughput. However, the buffer required by CAN is
fixed at a length of 16 or 64. If the system's IOB is directly used,
a lot of memory will be wasted.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Includes an introduction to the interface, and details about the input parameters and return values.
Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
there is no need to call arp_out again to perform layer 2 header filling
in the arp_send process, so we should directly call the driver's callback.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
otherwise, if the mld timers are not cancelled, an illegal address will
be accessed after timeout. to avoid this scenario, when the network card
is unregistered, all MLD timers must be attempted to be synchronously
cancelled.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
insufficient IOB during IP fragment is a normal scenario and should
not crash directly. The assert needs to be removed and corresponding
error handling needs to be added.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
When SOL_SOCKET options (e.g., SO_BINDTODEVICE via ping -I) hit ICMP sockets, icmp_{get,set}sockopt logged “Unrecognized ICMP option: 17” before fallback. Handle SOL_SOCKET explicitly by returning -ENOPROTOOPT so psock_* routes to the socket-level handler. Removes noisy logs without changing behavior (invalid devices still return -ENODEV).
Signed-off-by: wangchen <wangchen41@xiaomi.com>
The description includes an introduction to paho_mqtt, configuration management, tool usage, etc.
Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
This interface allows different protocol modules to use their own unique IOB
buffer sources and allocation strategies without interfering with each other.
Representative examples are the IP protocol and the CAN protocol. The IP
protocol generally transmits packets of varying lengths and requires
relatively high peak throughput. In this case, to ensure higher performance,
IOB_BUFSIZE is often configured to be relatively large, such as greater than
500. The CAN protocol generally transmits short packets of fixed length.
In this case, to improve memory utilization, IOB_BUFSIZE is often configured
to be relatively small, such as 16 or 64. To optimize the memory utilization
when the IP protocol and the CAN protocol share the same core,
this interface was added.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
when dev is down, tcp_pollsetup returns the value 'OK' and sets the connection status to 'down' and eventset to POLLERR & POLLUP
Signed-off-by: wangchen <wangchen41@xiaomi.com>