Ref: https://man7.org/linux/man-pages/man7/packet.7.html
1. For `socket(AF_PACKET, int socket_type, int protocol)`: When `protocol` is set to `htons(ETH_P_ALL)`, then all protocols are received. If `protocol` is set to zero, no packets are received.
2. For `bind`: `bind` can optionally be called with a nonzero `sll_protocol` to start receiving packets for the protocols specified.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
When app send a pkt-packet, then it will read back it and case some problem. Connection should not read back the message sent by itself.
Signed-off-by: gaohedong <gaohedong@xiaomi.com>
note/note_driver.c:2440:45: error: implicit declaration of function 'note_find_taskname'; did you mean 'note_get_taskname'? [-Werror=implicit-function-declaration]
2440 | FAR struct note_taskname_info_s *ti = note_find_taskname(pid);
| ^~~~~~~~~~~~~~~~~~
| note_get_taskname
note/note_driver.c:2440:45: error: initialization of 'struct note_taskname_info_s *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
note/note_driver.c:2444:26: error: invalid use of undefined type 'struct note_taskname_info_s'
2444 | strlcpy(buf, ti->name, len);
| ^~
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
The function sched_note_add should not be in the code
section of #ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
When tcb may has been released in caller, the return pointer to tcb->name is dangling pointer. So add a buffer in caller, even if tcb is released, buffer is still valid.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
When opening the file succeeds but reading the file fails in
modlib_initialize, this will result in the open file not be closed.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
The clang compiler has also defined `__GNUC__`, which can't be used to
decide the compiler version.
And the version used to decide whether the builtin function
`__builtin_dynamic_object_size` exist is not correct.
Signed-off-by: chenxiaoyi <chenxiaoyi@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>
Disable configuration options that are not needed for MCUboot loader
- Disable floating point and long long support in libc
- Disable libm
- Disable POSIX features: environment variables, message queues, timers
and pthreads
- Disable RAMTEST app to save code space
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.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>
The specific Cortex-R52 implementation could be configured with
a Single-Precision-only FPU (SP-only) and no Neon unit.
Executing double-precision instructions (e.g., `vadd.f64`) triggers
an Undefined Instruction exception.
The standard `-mfpu=fp-armv8` implicitly enables double-precision,
which is unsafe for this hardware.
`-mfpu=fpv5-sp-d16` is selected as the closest architectural match.
- It enforces Single Precision code generation (preventing crashes).
- It enables VFPv4/FPv5 features like FMA (Fused Multiply-Add) supported by the CR52 FPU.
- It restricts the register set to d0-d15, matching the hardware constraints.
This ensures the compiler utilizes hardware FPU and FMA acceleration
without emitting illegal double-precision instructions.
Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
Initial commit for adding rs-485 support to serial driver. More is needed as well as testing.
Style fixes.
Added unconfigure functionality.
Added Unconfigure configs to CONFIG.
More style fixes.
Changed depend spacing from 4 spaces to tab.
Fixed priv types, changed serialin to getreg.
Do not unconfigure tx/rx/dir pins by default.
Signed-off-by: kywwilson11 <kwilson@2g-eng.com>