This is an automated email from the ASF dual-hosted git repository.
anchao 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 7897729bec9 net/tcp: improve tcp_send_txnotify
7897729bec9 is described below
commit 7897729bec9e564b4c8c4f243d9510601e66d67d
Author: shichunma <[email protected]>
AuthorDate: Fri Apr 17 09:40:16 2026 +0800
net/tcp: improve tcp_send_txnotify
Use conn->dev directly when it is already available
Signed-off-by: Jerry Ma <[email protected]>
---
net/tcp/tcp_send.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/tcp/tcp_send.c b/net/tcp/tcp_send.c
index 963d05df79e..c5303688176 100644
--- a/net/tcp/tcp_send.c
+++ b/net/tcp/tcp_send.c
@@ -685,8 +685,8 @@ void tcp_synack(FAR struct net_driver_s *dev, FAR struct
tcp_conn_s *conn,
* Name: tcp_send_txnotify
*
* Description:
- * Notify the appropriate device driver that we are have data ready to
- * be send (TCP)
+ * Notify the appropriate device driver that we have data ready to
+ * send (TCP)
*
* Input Parameters:
* psock - Socket state structure
@@ -700,6 +700,12 @@ void tcp_synack(FAR struct net_driver_s *dev, FAR struct
tcp_conn_s *conn,
void tcp_send_txnotify(FAR struct socket *psock,
FAR struct tcp_conn_s *conn)
{
+ if (conn->dev != NULL)
+ {
+ netdev_txnotify_dev(conn->dev, TCP_POLL);
+ return;
+ }
+
#ifdef CONFIG_NET_IPv4
#ifdef CONFIG_NET_IPv6
/* If both IPv4 and IPv6 support are enabled, then we will need to select