In `drivers/rptun/rptun.c`, we have a `rptun_is_recursive` function,
which lets rptun thread run recursively. Then the `usrsock_rpmsg_ept_cb`
may be called inside `usrsock_rpmsg_ept_cb`, which can cause some
unexpected behavior, so we add a queue to keep the order of incoming
messages to reduce the complexity.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
When tun_txavail_work is running, switch to tun_close thread and priv->lock will be destroyed, then switch back to tun_txavail_work thread, an error will occur when nxmutex_unlock(&priv->lock)
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
There is a risk that interfaces such as psock_ioctl/psock_setsockopt
will cause paramete to be not four-byte aligned after calculating the
offset, so align the length of the structure with parameters by four
bytes.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
When tun_txavail_work is running, switch to tun_close thread and priv->lock will be destroyed, then switch back to tun_txavail_work thread, an error will occur when nxmutex_unlock(&priv->lock)
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
In previous versions, during the teardown phase, the "open_blockdriver" would call the "mtd proxy" causing the "file mtd" node to be registered in the ftl. " node is registered in ftl.
Therefore, we changed the behavior to find the corresponding inode by node name.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Add the Sim WiFi function, which can provide the wifi operating on nuttx sim emulator,
and support two modes that simulate wifi, HWSIM and RNC(real network card).
- In the HWSIM mode, we simulates two wlan interfaces. The wlan0 is STA and
the wlan1 is AP. The wlan0 can connect to the wlan1 in the nuttx simulator.
- In the RNC mode, we can use the same wlan interface name on the nuttx simulator
to control the connection behavior of the real wireless card.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
The BIT macro is widely used in NuttX,
and to achieve a unified strategy,
we have placed the implementation of the BIT macro
in bits.h to simplify code implementation.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
so the user could register fb device directly instead
go through the sequence of up_fbinitialize/up_fbgetvplane
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
forget from patch:
commit bbf5b0bb6d
Author: jianglianfang <jianglianfang@xiaomi.com>
Date: Tue Aug 15 19:47:14 2023 +0800
driver/video: adapting Goldfish FB to VSync optimized FB driver
The circbuf part is implemented by the fb driver, and goldfish needs to
delete the part related to circbuf and adapt to the interface of the fb
driver.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
==2787216==ERROR: AddressSanitizer: heap-use-after-free on address 0xf4702448 at pc 0x0136c544 bp 0x9f54d358 sp 0x9f54d348
READ of size 4 at 0xf4702448 thread T0
0 0x136c543 in rpmsg_destroy_ept open-amp/lib/rpmsg/rpmsg.c:357
1 0x1252b29 in sensor_rpmsg_ns_unbind_cb sensors/sensor_rpmsg.c:1216
2 0x1371de5 in rpmsg_virtio_ns_callback open-amp/lib/rpmsg/rpmsg_virtio.c:663
3 0x1371026 in rpmsg_virtio_rx_callback open-amp/lib/rpmsg/rpmsg_virtio.c:583
4 0x137c105 in virtqueue_notification open-amp/lib/virtio/virtqueue.c:711
5 0x1368604 in rproc_virtio_notified open-amp/lib/remoteproc/remoteproc_virtio.c:433
6 0x1363abe in remoteproc_get_notification open-amp/lib/remoteproc/remoteproc.c:10
Signed-off-by: yintao <yintao@xiaomi.com>
convert from body coordinate system to right-hand
coordinate system.
Example:
Compared to the standard coordinate system,
the x-axis and y-axis are interchanged and have opposite directions,
the z-axis remains normal.
body coordinate ----> right-hand coordinate
+x +y
| |
| |
| |
| |
-y<-------. .------>+x
/ /
/ /
/ /
/ /
+z +z
So for the above conversion, using "P3" to represent transformation relationships
The front is 1 0 2, which represents the y x z axis.
The standard order is 0 1 2, so y and x are interchanged.
The following -1 1 1 indicates the direction of the axis.
The standard is 1 1 1. Because the current y-axis is opposite to
the standard x-axis, it is -1.
static const struct sensor_axis_map_s g_remap_tbl[] =
{
{ 0, 1, 2, 1, 1, 1 }, /* P0 */
{ 1, 0, 2, 1, -1, 1 }, /* P1 */
{ 0, 1, 2, -1, -1, 1 }, /* P2 */
{ 1, 0, 2, -1, 1, 1 }, /* P3 */
{ 0, 1, 2, -1, 1, -1 }, /* P4 */
{ 1, 0, 2, -1, -1, -1 }, /* P5 */
{ 0, 1, 2, 1, -1, -1 }, /* P6 */
{ 1, 0, 2, 1, 1, -1 }, /* P7 */
};
you can call the function sensor_remap_vector_raw16 and pass P3 parameters
to perform the conversion.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
When the application calls poll and returns the POLLIN event,
QPOLL will be called again during the read operation,
causing rx_length to change and data to be lost.
Therefore, read only need to actively call qpoll to collect driver
data when rx length is 0.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
I added a function that I didn't use when I upstream another patch. Delete it
https://github.com/apache/nuttx/pull/10709
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>