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>
Ignore unsupported telnet subnegotiation payload until `IAC SE` so
option bytes do not leak into the first NSH command.
Keep existing NAWS handling intact and also treat `IAC IAC` inside
subnegotiation payload as an escaped `0xFF` data byte rather than a
subnegotiation terminator.
This makes subnegotiation parsing RFC-compliant for both unsupported
options and NAWS payload processing.
Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
since the judgment for network card selection was changed from IS_UP to
IS_RUNNING, drivers that lack carrier_on need to add the carrier_on
operation; otherwise, network access issues will occur.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
If the serial port is set to isconsole,
\n will be escaped as \r\n, causing communication failure.
Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
avoid race conditions when the rpmsg thread and network card thread
access the rxqueue simultaneously.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
It's the first simple version of rpmsg-net, include:
- Transfer command with data copy (maybe optimize later), no need to ack
- Control command with ack, but only ifup/ifdown no need to ack
- Client side: Another module can call `net_rpmsg_drv_alloc` to
create netdev and register it.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Add WLAN_STA_STATE_DISCONNECTED state to prevent race conditions or invalid state handling during disconnect.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
modify the code of the adapted protocol stack to avoid deadlocks and the
logic that cannot be protected by locks after modification.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
avoid packet processing delays caused by task switching,
to support those applications that are extremely time-sensitive.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
The loopback network driver sending task is placed in the LPWORK queue, which may result in delayed scheduling when the CPU usage reaches 100%, leading to the timely sending of cached messages from the loopback network driver and causing issues with post waitsem being too late.we decied to set loopback sending task to the HPWORK queue.
Signed-off-by: wangchen <wangchen41@xiaomi.com>
avoid packet processing delays caused by task switching,
to support those applications that are extremely time-sensitive.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Upperhalf supports multiple working modes at the same time,
which is specified by NIC when register
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Remove the previously supported polling mode. If necessary in the
future, switch to a new solution for implementation.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
avoid illegal address access caused by removing vlan
network cards during the traversal of vlan network cards
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
1. We add default PCP because some of our apps may not want to set PCP
manually (e.g. Our user may just ping with pre-set PCP)
2. The `vlan_qos` is used as PCP when setting Linux's priority mapping:
https://github.com/torvalds/linux/blob/v6.12/net/8021q/vlan.c#L590
Although `vlan_qos` is not used when creating VLAN on Linux, we can
use it as PCP on creating VLAN (without changing its meaning), and
keep compatible with Linux's creating (Exactly the same when
`vlan_qos` is 0).
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Inspired by Linux's way, we also create VLAN devices for managing VLAN,
which will become interfaces like `eth0.58`.
QinQ is also supported, we can create VLAN devices above another VLAN
devices, like `eth0.100.101` (or even `eth0.1.2.3.4`, also supported on
Linux).
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
after the network card is turned off, read and write operations need
to return -ENETDOWN, and it is necessary to wake up the waiting read
and write operations.
Signed-off-by: wangchen <wangchen41@xiaomi.com>
Nuttx currently has 2 types of sleep interfaces:
1. Signal-scheduled sleep: nxsig_sleep() / nxsig_usleep() / nxsig_nanosleep()
Weaknesses:
a. Signal-dependent: The signal-scheduled sleep method is bound to the signal framework, while some driver sleep operations do not depend on signals.
b. Timespec conversion: Signal-scheduled sleep involves timespec conversion, which has a significant impact on performance.
2. Busy sleep: up_mdelay() / up_udelay()
Weaknesses:
a. Does not actively trigger scheduling, occupy the CPU loading.
3. New interfaces: Scheduled sleep: nxsched_sleep() / nxsched_usleep() / nxsched_msleep() / nxsched_ticksleep()
Strengths:
a. Does not depend on the signal framework.
b. Tick-based, without additional computational overhead.
Currently, the Nuttx driver framework extensively uses nxsig_* interfaces. However, the driver does not need to rely on signals or timespec conversion.
Therefore, a new set of APIs is added to reduce dependencies on other modules.
(This PR also aims to make signals optional, further reducing the code size of Nuttx.)
Signed-off-by: chao an <anchao.archer@bytedance.com>
Currently the mdio communication is part of the monolithic 'full netdevs'.
This commit serves as an way to add modularity for the netdevs drivers.
A new upperhalf/lowerhalf mdio device comes with this commit that manages the data transfer ofer mdio interface.
Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
Add driver for the LAN865x 10BASE-T1S SPI MAC-PHY.
The driver is a lower-half driver to the OA-TC6 base driver.
Signed-off-by: michal matias <mich4l.matias@gmail.com>
Add driver for the Onsemi NCV7410 10BASE-T1S SPI MAC-PHY.
The driver also works for the NCN26010, which is an identical chip.
The driver is a lower-half driver to the OA-TC6 base driver.
Signed-off-by: michal matias <mich4l.matias@gmail.com>
Add base driver common for OPEN Alliance 10BASE-T1x MAC-PHY Serial Interface (OA-TC6)
protocol SPI MAC-PHYs.
Signed-off-by: michal matias <mich4l.matias@gmail.com>
Instead of verifying MMD indirect access by checking
EEE ADVERTISEMENT register has value 0x6 (which may be changed),
the verification is done by write and check LED MODE register.
1. Backup current LED_MODE register value
2. Write value Single-LED mode (0x10) to LED_MODE
3. Read LED_MODE register and verify it returns value 0x10
4. Write original (backup) value to LED_MODE
From the ksz9477 errata, setup the configuration which is tested to work.
- Improve PHY receive performance
- Disable EEE for ports 1-5
- Fix supply current values
Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
This commit removes existing support for the NCV7410 10BASE-T1S MAC-PHY.
The driver will be replaced by its generalized version with different organization.
The new driver has naming clashes with the old, therefore the old has to be removed first.
Signed-off-by: michal matias <mich4l.matias@gmail.com>