13 Commits

Author SHA1 Message Date
Piyush Patle 0dccc8ba21 include/debug.h: Move to include/nuttx/debug.h
debug.h is a NuttX-specific, non-POSIX header. Placing it in the
top-level include/ directory creates naming conflicts with external
projects that define their own debug.h.
This commit moves the canonical header to include/nuttx/debug.h,
following the NuttX convention for non-POSIX/non-standard headers,
and updates all in-tree references.

A backward-compatibility shim is left at include/debug.h that
emits a deprecation #warning and re-includes <nuttx/debug.h>,
allowing out-of-tree code to continue building while migrating.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-07 07:50:06 -03:00
guoshichao 3d45550da9 can_sendmsg_buffered: fix can_sendmsg param type mismatch error
Update the can_sendmsg() signature from "struct msghdr *msg" to
"const struct msghdr *msg" to match the updated sendmsg() prototype
and resolve compilation errors due to parameter type inconsistency.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:11:39 +08:00
zhanghongyu 8f41613374 net: replace net_sem*wait with conn_dev_sem*wait to simplify code logic
optimize the current code format according to the previous net_xxx_wait
implementation to reduce multiple calls of similar code

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-02 07:48:06 -03:00
zhanghongyu c481374fb8 devif_poll: only call the corresponding xxx_poll when there is data to be sent
reduce the execution consumption of irrelevant code

testing the TX rates of TCP and UDP based on the Infineon board can
increase them by 13%.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-02 00:04:16 +08:00
zhanghongyu a0b847bf1b net/devif_callback: change flags type from uint16_t to uint32_t
increase the size of the flag to prepare for precise xxx_POLL.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-02 00:04:16 +08:00
zhanghongyu d377f6b788 net: use netdev_lock to protect netdev_txnotify_dev
since the type of sconn lock is rmutex, there is no need to release
sconn lock before TX

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-02 00:04:16 +08:00
zhanghongyu 02e7ed7cc4 net/can: replace net_lock with conn_lock and conn_lock_dev
Protect can resources through netdev_lock, conn_lock, and can_list_lock

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-29 09:42:18 +08:00
wangjinjing1 4fa74e4d18 net/can: add write_q free for callback alloc error handling
Release the corresponding resources held when the alloc fails

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-29 09:42:18 +08:00
wangjinjing1 99584588fc net/can: modify net_unlock location before txnotify for can_sendmsg_buffered.c
Release the lock early to reduce the number of thread switches.

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-29 09:42:18 +08:00
wangjinjing1 3bd4748bc3 net/can: repair callback alloc error handling
Release the corresponding resources held when the alloc fails

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-29 09:42:18 +08:00
zhanghongyu 3e025b5a03 net/can: can protocol uses a separate buffer to cache can data
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>
2025-12-25 08:56:12 -03:00
wangjinjing1 7b528d903c net/can: fix compile error
variable "conn" not define if CONFIG_NET_SEND_BUFSIZE > 0

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-25 10:04:42 +08:00
wangjinjing1 8c92be874f net/can: add write buffer to support nonblock send
The sending of can socket can support more scenarios

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-15 10:19:15 +08:00