mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
net/devif_callback: change flags type from uint16_t to uint32_t
increase the size of the flag to prepare for precise xxx_POLL. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
+6
-6
@@ -806,7 +806,7 @@ int tcp_start_monitor(FAR struct socket *psock);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void tcp_stop_monitor(FAR struct tcp_conn_s *conn, uint16_t flags);
|
||||
void tcp_stop_monitor(FAR struct tcp_conn_s *conn, uint32_t flags);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tcp_lost_connection
|
||||
@@ -832,7 +832,7 @@ void tcp_stop_monitor(FAR struct tcp_conn_s *conn, uint16_t flags);
|
||||
****************************************************************************/
|
||||
|
||||
void tcp_lost_connection(FAR struct tcp_conn_s *conn,
|
||||
FAR struct devif_callback_s *cb, uint16_t flags);
|
||||
FAR struct devif_callback_s *cb, uint32_t flags);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tcp_close
|
||||
@@ -1399,8 +1399,8 @@ void tcp_ipv6_input(FAR struct net_driver_s *dev, unsigned int iplen);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint16_t tcp_callback(FAR struct net_driver_s *dev,
|
||||
FAR struct tcp_conn_s *conn, uint16_t flags);
|
||||
uint32_t tcp_callback(FAR struct net_driver_s *dev,
|
||||
FAR struct tcp_conn_s *conn, uint32_t flags);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tcp_datahandler
|
||||
@@ -1939,7 +1939,7 @@ int tcp_wrbuffer_test(void);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
void tcp_event_handler_dump(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv,
|
||||
uint16_t flags,
|
||||
uint32_t flags,
|
||||
FAR struct tcp_conn_s *conn);
|
||||
#endif
|
||||
|
||||
@@ -2381,7 +2381,7 @@ void tcp_cc_recv_ack(FAR struct tcp_conn_s *conn, FAR struct tcp_hdr_s *tcp);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void tcp_set_zero_probe(FAR struct tcp_conn_s *conn, uint16_t flags);
|
||||
void tcp_set_zero_probe(FAR struct tcp_conn_s *conn, uint32_t flags);
|
||||
|
||||
#endif /* NET_TCP_HAVE_STACK */
|
||||
#endif /* __NET_TCP_TCP_H */
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint16_t
|
||||
static inline uint32_t
|
||||
tcp_data_event(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
||||
uint16_t flags)
|
||||
uint32_t flags)
|
||||
{
|
||||
uint16_t recvlen;
|
||||
|
||||
@@ -109,9 +109,9 @@ tcp_data_event(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_TCP_OUT_OF_ORDER
|
||||
static uint16_t tcp_ofoseg_data_event(FAR struct net_driver_s *dev,
|
||||
static uint32_t tcp_ofoseg_data_event(FAR struct net_driver_s *dev,
|
||||
FAR struct tcp_conn_s *conn,
|
||||
uint16_t flags)
|
||||
uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_ofoseg_s *seg;
|
||||
uint32_t rcvseq;
|
||||
@@ -257,11 +257,11 @@ int tcp_ofoseg_bufsize(FAR struct tcp_conn_s *conn)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint16_t tcp_callback(FAR struct net_driver_s *dev,
|
||||
FAR struct tcp_conn_s *conn, uint16_t flags)
|
||||
uint32_t tcp_callback(FAR struct net_driver_s *dev,
|
||||
FAR struct tcp_conn_s *conn, uint32_t flags)
|
||||
{
|
||||
#if defined(CONFIG_NET_TCP_NOTIFIER) || defined(CONFIG_NET_TCP_OUT_OF_ORDER)
|
||||
uint16_t orig = flags;
|
||||
uint32_t orig = flags;
|
||||
#endif
|
||||
|
||||
/* Prepare device buffer */
|
||||
@@ -277,7 +277,7 @@ uint16_t tcp_callback(FAR struct net_driver_s *dev,
|
||||
* must be explicitly set in the callback.
|
||||
*/
|
||||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
ninfo("flags: %" PRIx32 "\n", flags);
|
||||
|
||||
/* Perform the data callback. When a data callback is executed from
|
||||
* 'list', the input flags are normally returned, however, the
|
||||
|
||||
+3
-3
@@ -70,12 +70,12 @@ static void tcp_close_work(FAR void *param)
|
||||
* Name: tcp_close_eventhandler
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t tcp_close_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t tcp_close_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_conn_s *conn = pvpriv;
|
||||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
ninfo("flags: %" PRIx32 "\n", flags);
|
||||
|
||||
/* TCP_DISCONN_EVENTS:
|
||||
* TCP_ABORT: The remote host has aborted the connection
|
||||
|
||||
@@ -72,8 +72,8 @@ static inline int psock_setup_callbacks(FAR struct socket *psock,
|
||||
FAR struct tcp_connect_s *pstate);
|
||||
static void psock_teardown_callbacks(FAR struct tcp_connect_s *pstate,
|
||||
int status);
|
||||
static uint16_t psock_connect_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags);
|
||||
static uint32_t psock_connect_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -159,13 +159,13 @@ static void psock_teardown_callbacks(FAR struct tcp_connect_s *pstate,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t psock_connect_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t psock_connect_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
struct tcp_connect_s *pstate = pvpriv;
|
||||
FAR struct tcp_conn_s *conn;
|
||||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
ninfo("flags: %" PRIx32 "\n", flags);
|
||||
|
||||
/* 'priv' might be null in some race conditions (?) */
|
||||
|
||||
|
||||
+3
-3
@@ -50,12 +50,12 @@
|
||||
|
||||
void tcp_event_handler_dump(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv,
|
||||
uint16_t flags,
|
||||
uint32_t flags,
|
||||
FAR struct tcp_conn_s *conn)
|
||||
{
|
||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
nerr("ERROR: conn->dev == NULL:"
|
||||
" dev=%p pvpriv=%p flags=0x%04x"
|
||||
" dev=%p pvpriv=%p flags=0x%" PRIx32
|
||||
" conn->dev=%p conn->flags=0x%04x tcpstateflags=0x%02x crefs=%d"
|
||||
" isn=%" PRIu32 " sndseq=%" PRIu32
|
||||
" tx_unacked=%" PRId32 " sent=%" PRId32
|
||||
@@ -67,7 +67,7 @@ void tcp_event_handler_dump(FAR struct net_driver_s *dev,
|
||||
conn, conn->sconn.s_flags);
|
||||
#else
|
||||
nerr("ERROR: conn->dev == NULL:"
|
||||
" dev=%p pvpriv=%p flags=0x%04x"
|
||||
" dev=%p pvpriv=%p flags=0x%" PRIx32
|
||||
" conn->dev=%p conn->flags=0x%04x tcpstateflags=0x%02x crefs=%d"
|
||||
" sndseq=%" PRIu32
|
||||
" tx_unacked=%" PRId32
|
||||
|
||||
+1
-1
@@ -696,8 +696,8 @@ static void tcp_input(FAR struct net_driver_s *dev, uint8_t domain,
|
||||
FAR struct tcp_hdr_s *tcp;
|
||||
union ip_binding_u uaddr;
|
||||
unsigned int tcpiplen;
|
||||
uint32_t flags;
|
||||
uint16_t tmp16;
|
||||
uint16_t flags;
|
||||
uint16_t result;
|
||||
int len;
|
||||
|
||||
|
||||
+11
-10
@@ -44,9 +44,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
static void tcp_close_connection(FAR struct tcp_conn_s *conn,
|
||||
uint16_t flags);
|
||||
static uint16_t tcp_monitor_event(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags);
|
||||
uint32_t flags);
|
||||
static uint32_t tcp_monitor_event(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -70,7 +70,7 @@ static uint16_t tcp_monitor_event(FAR struct net_driver_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void tcp_close_connection(FAR struct tcp_conn_s *conn, uint16_t flags)
|
||||
static void tcp_close_connection(FAR struct tcp_conn_s *conn, uint32_t flags)
|
||||
{
|
||||
/* These loss-of-connection events may be reported:
|
||||
*
|
||||
@@ -130,14 +130,15 @@ static void tcp_close_connection(FAR struct tcp_conn_s *conn, uint16_t flags)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t tcp_monitor_event(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t tcp_monitor_event(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_conn_s *conn = pvpriv;
|
||||
|
||||
if (conn != NULL)
|
||||
{
|
||||
ninfo("flags: %04x s_flags: %02x\n", flags, conn->sconn.s_flags);
|
||||
ninfo("flags: %" PRIx32 " s_flags: %02x\n", flags,
|
||||
conn->sconn.s_flags);
|
||||
|
||||
/* TCP_DISCONN_EVENTS: TCP_ABORT, TCP_TIMEDOUT, or NETDEV_DOWN.
|
||||
* All loss-of-connection events.
|
||||
@@ -205,7 +206,7 @@ static uint16_t tcp_monitor_event(FAR struct net_driver_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void tcp_shutdown_monitor(FAR struct tcp_conn_s *conn, uint16_t flags)
|
||||
static void tcp_shutdown_monitor(FAR struct tcp_conn_s *conn, uint32_t flags)
|
||||
{
|
||||
/* Perform callbacks to assure that all sockets, including dup'ed copies,
|
||||
* are informed of the loss of connection event.
|
||||
@@ -335,7 +336,7 @@ int tcp_start_monitor(FAR struct socket *psock)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void tcp_stop_monitor(FAR struct tcp_conn_s *conn, uint16_t flags)
|
||||
void tcp_stop_monitor(FAR struct tcp_conn_s *conn, uint32_t flags)
|
||||
{
|
||||
DEBUGASSERT(conn != NULL);
|
||||
|
||||
@@ -368,7 +369,7 @@ void tcp_stop_monitor(FAR struct tcp_conn_s *conn, uint16_t flags)
|
||||
****************************************************************************/
|
||||
|
||||
void tcp_lost_connection(FAR struct tcp_conn_s *conn,
|
||||
FAR struct devif_callback_s *cb, uint16_t flags)
|
||||
FAR struct devif_callback_s *cb, uint32_t flags)
|
||||
{
|
||||
DEBUGASSERT(conn != NULL);
|
||||
|
||||
|
||||
@@ -66,12 +66,12 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t tcp_poll_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t tcp_poll_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_poll_s *info = pvpriv;
|
||||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
ninfo("flags: %" PRIx32 "\n", flags);
|
||||
|
||||
DEBUGASSERT(info == NULL || (info->conn != NULL && info->fds != NULL));
|
||||
|
||||
|
||||
@@ -170,9 +170,9 @@ static size_t tcp_recvfrom_newdata(FAR struct net_driver_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint16_t tcp_newdata(FAR struct net_driver_s *dev,
|
||||
static inline uint32_t tcp_newdata(FAR struct net_driver_s *dev,
|
||||
FAR struct tcp_recvfrom_s *pstate,
|
||||
uint16_t flags)
|
||||
uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_conn_s *conn = pstate->ir_conn;
|
||||
|
||||
@@ -391,13 +391,13 @@ static inline void tcp_sender(FAR struct net_driver_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t tcp_recvhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t tcp_recvhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_recvfrom_s *pstate = pvpriv;
|
||||
FAR struct iob_s *iob = NULL;
|
||||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
ninfo("flags: %" PRIx32 "\n", flags);
|
||||
|
||||
/* 'priv' might be null in some race conditions (?) */
|
||||
|
||||
|
||||
@@ -431,8 +431,8 @@ static int parse_sack(FAR struct tcp_conn_s *conn, FAR struct tcp_hdr_s *tcp,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_conn_s *conn = pvpriv;
|
||||
#ifdef CONFIG_NET_TCP_SELECTIVE_ACK
|
||||
@@ -459,7 +459,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
||||
return flags;
|
||||
}
|
||||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
ninfo("flags: %" PRIx32 "\n", flags);
|
||||
|
||||
/* The TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags are expected to
|
||||
* appear here strictly one at a time, except for the FIN + ACK case.
|
||||
@@ -505,7 +505,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
||||
/* Get the ACK number from the TCP header */
|
||||
|
||||
ackno = tcp_getsequence(tcp->ackno);
|
||||
ninfo("ACK: ackno=%" PRIu32 " flags=%04x\n", ackno, flags);
|
||||
ninfo("ACK: ackno=%" PRIu32 " flags=%" PRIx32 "\n", ackno, flags);
|
||||
|
||||
/* Look at every write buffer in the unacked_q. The unacked_q
|
||||
* holds write buffers that have been entirely sent, but which
|
||||
@@ -707,7 +707,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
||||
|
||||
if ((flags & TCP_DISCONN_EVENTS) != 0)
|
||||
{
|
||||
ninfo("Lost connection: %04x\n", flags);
|
||||
ninfo("Lost connection: %" PRIx32 "\n", flags);
|
||||
|
||||
/* We could get here recursively through the callback actions of
|
||||
* tcp_lost_connection(). So don't repeat that action if we have
|
||||
@@ -893,7 +893,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR struct tcp_wrbuffer_s *wrb;
|
||||
FAR sq_entry_t *entry;
|
||||
|
||||
ninfo("REXMIT: %04x\n", flags);
|
||||
ninfo("REXMIT: %" PRIx32 "\n", flags);
|
||||
|
||||
/* If there is a partially sent write buffer at the head of the
|
||||
* write_q? Has anything been sent from that write buffer?
|
||||
|
||||
@@ -125,8 +125,8 @@ struct send_s
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct send_s *pstate = pvpriv;
|
||||
FAR struct tcp_conn_s *conn;
|
||||
@@ -151,7 +151,7 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
|
||||
return flags;
|
||||
}
|
||||
|
||||
ninfo("flags: %04x acked: %" PRId32 " sent: %zd\n",
|
||||
ninfo("flags: %" PRIx32 " acked: %" PRId32 " sent: %zd\n",
|
||||
flags, pstate->snd_acked, pstate->snd_sent);
|
||||
|
||||
/* The TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags are expected to
|
||||
|
||||
@@ -117,8 +117,8 @@ struct sendfile_s
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t sendfile_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t sendfile_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct sendfile_s *pstate = pvpriv;
|
||||
FAR struct tcp_conn_s *conn;
|
||||
@@ -143,7 +143,7 @@ static uint16_t sendfile_eventhandler(FAR struct net_driver_s *dev,
|
||||
return flags;
|
||||
}
|
||||
|
||||
ninfo("flags: %04x acked: %" PRId32 " sent: %zd\n",
|
||||
ninfo("flags: %" PRIx32 " acked: %" PRId32 " sent: %zd\n",
|
||||
flags, pstate->snd_acked, pstate->snd_sent);
|
||||
|
||||
/* The TCP_ACKDATA, TCP_REXMIT and TCP_DISCONN_EVENTS flags are expected to
|
||||
|
||||
@@ -49,12 +49,12 @@
|
||||
* Name: tcp_shutdown_eventhandler
|
||||
****************************************************************************/
|
||||
|
||||
static uint16_t tcp_shutdown_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint16_t flags)
|
||||
static uint32_t tcp_shutdown_eventhandler(FAR struct net_driver_s *dev,
|
||||
FAR void *pvpriv, uint32_t flags)
|
||||
{
|
||||
FAR struct tcp_conn_s *conn = pvpriv;
|
||||
|
||||
ninfo("flags: %04x\n", flags);
|
||||
ninfo("flags: %" PRIx32 "\n", flags);
|
||||
|
||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
/* We don't need the send callback anymore. */
|
||||
|
||||
+1
-1
@@ -364,7 +364,7 @@ void tcp_stop_timer(FAR struct tcp_conn_s *conn)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void tcp_set_zero_probe(FAR struct tcp_conn_s *conn, uint16_t flags)
|
||||
void tcp_set_zero_probe(FAR struct tcp_conn_s *conn, uint32_t flags)
|
||||
{
|
||||
if ((conn->tcpstateflags & TCP_ESTABLISHED) &&
|
||||
((flags & TCP_NEWDATA) == 0) && conn->tx_unacked <= 0 &&
|
||||
|
||||
Reference in New Issue
Block a user