Skip to content

Commit cf7b711

Browse files
committed
net/tcp: improve tcp_send_txnotify
Use conn->dev directly when it is already available Signed-off-by: shichunma <masc2008@gmail.com>
1 parent 5c9de46 commit cf7b711

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

net/tcp/tcp_send.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,8 @@ void tcp_synack(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
685685
* Name: tcp_send_txnotify
686686
*
687687
* Description:
688-
* Notify the appropriate device driver that we are have data ready to
689-
* be send (TCP)
688+
* Notify the appropriate device driver that we have data ready to
689+
* send (TCP)
690690
*
691691
* Input Parameters:
692692
* psock - Socket state structure
@@ -700,6 +700,12 @@ void tcp_synack(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
700700
void tcp_send_txnotify(FAR struct socket *psock,
701701
FAR struct tcp_conn_s *conn)
702702
{
703+
if (conn->dev != NULL)
704+
{
705+
netdev_txnotify_dev(conn->dev, TCP_POLL);
706+
return;
707+
}
708+
703709
#ifdef CONFIG_NET_IPv4
704710
#ifdef CONFIG_NET_IPv6
705711
/* If both IPv4 and IPv6 support are enabled, then we will need to select

0 commit comments

Comments
 (0)