You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/12/13 13:01:07 UTC
(nuttx) 01/02: openamp: Add the virtio_negotiate_features interface for virtio-net.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 681b84b15d340d5fe749d32a0cad1adae3010d84
Author: liqinhui <li...@xiaomi.com>
AuthorDate: Wed Dec 13 16:22:29 2023 +0800
openamp: Add the virtio_negotiate_features interface for virtio-net.
Signed-off-by: liqinhui <li...@xiaomi.com>
---
...d-the-virtio_negotiate_features-interface.patch | 41 ++++++++++++++++++++++
openamp/open-amp.cmake | 2 ++
openamp/open-amp.defs | 1 +
3 files changed, 44 insertions(+)
diff --git a/openamp/0020-virtio-Add-the-virtio_negotiate_features-interface.patch b/openamp/0020-virtio-Add-the-virtio_negotiate_features-interface.patch
new file mode 100644
index 0000000000..83aaa6bc76
--- /dev/null
+++ b/openamp/0020-virtio-Add-the-virtio_negotiate_features-interface.patch
@@ -0,0 +1,41 @@
+From 49e9be3fee1c3f56e1891959965420550bbafa92 Mon Sep 17 00:00:00 2001
+From: liqinhui <li...@xiaomi.com>
+Date: Mon, 4 Dec 2023 19:35:59 +0800
+Subject: [PATCH] virtio: Add the virtio_negotiate_features interface.
+
+Add the interface for the VIRTIO_NET_F_MAC feature.
+
+Change-Id: I51fcb0e5388a908ebf43912b793c061c9488e226
+Signed-off-by: liqinhui <li...@xiaomi.com>
+---
+ lib/include/openamp/virtio.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/lib/include/openamp/virtio.h open-amp/lib/include/openamp/virtio.h
+index 6ef1746..e32dc16 100644
+--- a/lib/include/openamp/virtio.h
++++ open-amp/lib/include/openamp/virtio.h
+@@ -299,6 +299,20 @@ static inline void virtio_set_features(struct virtio_device *vdev,
+ return vdev->func->set_features(vdev, features);
+ }
+
++/**
++ * @brief Negotiate features between virtio device and driver.
++ *
++ * @param dev Pointer to device structure.
++ * @param features Supported features.
++ *
++ * @return The final features after negotiate.
++ */
++static inline uint32_t virtio_negotiate_features(struct virtio_device *vdev,
++ uint32_t features)
++{
++ return vdev->func->negotiate_features(vdev, features);
++}
++
+ /**
+ * @brief Reset virtio device.
+ *
+--
+2.34.1
+
diff --git a/openamp/open-amp.cmake b/openamp/open-amp.cmake
index a687d0c98a..1c7b7d3edb 100644
--- a/openamp/open-amp.cmake
+++ b/openamp/open-amp.cmake
@@ -74,6 +74,8 @@ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/open-amp)
${CMAKE_CURRENT_LIST_DIR}/0018-virtio-decoupling-the-transport-layer-and-virtio-dev.patch
&& patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
${CMAKE_CURRENT_LIST_DIR}/0019-virtio.h-add-version-in-device-id-table.patch
+ && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
+ ${CMAKE_CURRENT_LIST_DIR}/0020-virtio-Add-the-virtio_negotiate_features-interface.patch
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)
diff --git a/openamp/open-amp.defs b/openamp/open-amp.defs
index 3bc27629ef..548906d254 100644
--- a/openamp/open-amp.defs
+++ b/openamp/open-amp.defs
@@ -66,6 +66,7 @@ open-amp.zip:
$(Q) patch -p0 < 0017-virtio-follow-virtio-1.2-spec-add-more-virtio-status.patch
$(Q) patch -p0 < 0018-virtio-decoupling-the-transport-layer-and-virtio-dev.patch
$(Q) patch -p0 < 0019-virtio.h-add-version-in-device-id-table.patch
+ $(Q) patch -p0 < 0020-virtio-Add-the-virtio_negotiate_features-interface.patch