net/pkt: fix build error when NET_PKT_WRITE_BUFFERS disable

fix build error.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2025-04-29 21:37:44 +08:00
committed by Xiang Xiao
parent e2525f61b1
commit 8d7ce77247
4 changed files with 5 additions and 8 deletions
+1 -2
View File
@@ -90,9 +90,8 @@ struct pkt_conn_s
FAR struct devif_callback_s *sndcb;
# if CONFIG_NET_SEND_BUFSIZE > 0
int32_t sndbufs; /* Maximum amount of bytes queued in send */
sem_t sndsem; /* Semaphore signals send completion */
# endif
sem_t sndsem; /* Semaphore signals send completion */
#endif
/* Read-ahead buffering.
+1 -1
View File
@@ -139,7 +139,7 @@ void pkt_free(FAR struct pkt_conn_s *conn)
dq_rem(&conn->sconn.node, &g_active_pkt_connections);
#ifdef CONFIG_NET_CAN_WRITE_BUFFERS
#ifdef CONFIG_NET_PKT_WRITE_BUFFERS
/* Free the write queue */
iob_free_queue(&conn->write_q);
-4
View File
@@ -66,7 +66,6 @@
*
****************************************************************************/
#if CONFIG_NET_SEND_BUFSIZE > 0
static void pkt_sendbuffer_notify(FAR struct pkt_conn_s *conn)
{
int val = 0;
@@ -77,7 +76,6 @@ static void pkt_sendbuffer_notify(FAR struct pkt_conn_s *conn)
nxsem_post(&conn->sndsem);
}
}
#endif
/****************************************************************************
* Name: psock_send_eventhandler
@@ -175,9 +173,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
flags &= ~PKT_POLL;
#if CONFIG_NET_SEND_BUFSIZE > 0
pkt_sendbuffer_notify(conn);
#endif
}
return flags;
+3 -1
View File
@@ -125,8 +125,10 @@ static int pkt_sockif_alloc(FAR struct socket *psock)
conn->type = psock->s_proto;
#if defined(CONFIG_NET_PKT_WRITE_BUFFERS) && CONFIG_NET_SEND_BUFSIZE > 0
#ifdef CONFIG_NET_PKT_WRITE_BUFFERS
# if CONFIG_NET_SEND_BUFSIZE > 0
conn->sndbufs = CONFIG_NET_SEND_BUFSIZE;
# endif
nxsem_init(&conn->sndsem, 0, 0);
#endif