This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit c7fbdf0d5fd49b3aa12c22b3d2c195b96320f40a
Author: dongjiuzhu1 <[email protected]>
AuthorDate: Thu Apr 2 10:03:13 2026 +0800

    drivers/net/vlan: add txpoll support for netpoll passthrough
    
    Delegate txpoll to the real (underlying) network device so that
    netpoll-based features (notenet, syslog, etc.) work correctly
    when bound to a VLAN interface.
    
    Signed-off-by: dongjiuzhu1 <[email protected]>
---
 drivers/net/vlan.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vlan.c b/drivers/net/vlan.c
index 68450e14028..4252d4277a4 100644
--- a/drivers/net/vlan.c
+++ b/drivers/net/vlan.c
@@ -74,6 +74,9 @@ static int vlan_ioctl(FAR struct netdev_lowerhalf_s *dev, int 
cmd,
                       unsigned long arg);
 #endif
 static void vlan_reclaim(FAR struct netdev_lowerhalf_s *dev);
+#ifdef CONFIG_NET_NETPOLL
+static void vlan_txpoll(FAR struct netdev_lowerhalf_s *dev);
+#endif
 
 /****************************************************************************
  * Private Data
@@ -92,7 +95,10 @@ static const struct netdev_ops_s g_vlan_ops =
 #ifdef CONFIG_NETDEV_IOCTL
   vlan_ioctl,    /* ioctl */
 #endif
-  vlan_reclaim   /* reclaim */
+  vlan_reclaim,  /* reclaim */
+#ifdef CONFIG_NET_NETPOLL
+  vlan_txpoll,   /* txpoll */
+#endif
 };
 
 /****************************************************************************
@@ -256,6 +262,19 @@ static void vlan_reclaim(FAR struct netdev_lowerhalf_s 
*dev)
     }
 }
 
+#ifdef CONFIG_NET_NETPOLL
+static void vlan_txpoll(FAR struct netdev_lowerhalf_s *dev)
+{
+  FAR struct vlan_device_s      *vlan = (FAR struct vlan_device_s *)dev;
+  FAR struct netdev_lowerhalf_s *real = vlan->real;
+
+  if (real->ops->txpoll)
+    {
+      real->ops->txpoll(real);
+    }
+}
+#endif
+
 /****************************************************************************
  * Public Functions
  ****************************************************************************/

Reply via email to