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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3759cc72abc arch/xtensa: properly set carrier on/off on espnow driver
3759cc72abc is described below

commit 3759cc72abc76789b9231c9c352392ed638202d3
Author: Filipe Cavalcanti <[email protected]>
AuthorDate: Mon Apr 20 15:22:32 2026 -0300

    arch/xtensa: properly set carrier on/off on espnow driver
    
    In esp_espnow_pktradio.c, after ESP-NOW is successfully initialized in 
espnow_ifup, call netdev_carrier_on(dev).
    In espnow_ifdown, call netdev_carrier_off(dev).
    
    Signed-off-by: Filipe Cavalcanti <[email protected]>
---
 arch/xtensa/src/common/espressif/esp_espnow_pktradio.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/xtensa/src/common/espressif/esp_espnow_pktradio.c 
b/arch/xtensa/src/common/espressif/esp_espnow_pktradio.c
index c9fa483e098..02ca3721e1a 100644
--- a/arch/xtensa/src/common/espressif/esp_espnow_pktradio.c
+++ b/arch/xtensa/src/common/espressif/esp_espnow_pktradio.c
@@ -42,6 +42,7 @@
 #include <nuttx/net/ip.h>
 #include <nuttx/spinlock.h>
 #include <nuttx/net/radiodev.h>
+#include <nuttx/net/netdev.h>
 #include <nuttx/net/sixlowpan.h>
 #include <nuttx/wireless/pktradio.h>
 #include <nuttx/wdog.h>
@@ -1098,6 +1099,11 @@ static int espnow_ifup(FAR struct net_driver_s *dev)
 
   priv->txblocked = false;
   priv->bifup = true;
+
+  /* Link is ready for 6LoWPAN; set IFF_RUNNING (ifconfig "RUNNING"). */
+
+  netdev_carrier_on(dev);
+
   return OK;
 }
 
@@ -1148,6 +1154,8 @@ static int espnow_ifdown(FAR struct net_driver_s *dev)
 
   priv->bifup = false;
 
+  netdev_carrier_off(dev);
+
   return OK;
 }
 

Reply via email to