net/tcp/tcp_connect.c: move txnotify after setup_callback

otherwise, when tx is modified to direct mode, wait will not be awakened

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2025-07-18 19:03:50 +08:00
committed by Xiang Xiao
parent 9ce35caf4e
commit 5c61672185
+8 -4
View File
@@ -349,10 +349,6 @@ int psock_tcp_connect(FAR struct socket *psock,
}
#endif /* CONFIG_NET_IPv4 */
/* Notify the device driver that new connection is available. */
netdev_txnotify_dev(conn->dev);
/* Non-blocking connection ? set the socket error
* and start the monitor
*/
@@ -377,6 +373,10 @@ int psock_tcp_connect(FAR struct socket *psock,
info.tc_sem = &state.tc_sem;
tls_cleanup_push(tls_get_info(), tcp_callback_cleanup, &info);
/* Notify the device driver that new connection is available. */
netdev_txnotify_dev(conn->dev);
/* Wait for either the connect to complete or for an
* error/timeout to occur.
* NOTES: net_sem_wait will also terminate if a
@@ -430,6 +430,10 @@ int psock_tcp_connect(FAR struct socket *psock,
tcp_stop_monitor(conn, TCP_ABORT);
ret = ret2;
}
/* Notify the device driver that new connection is available. */
netdev_txnotify_dev(conn->dev);
}
}