mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 13:52:22 +08:00
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:
+1
-2
@@ -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
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user