From 9fb6eee5feae7cfe68a5ae043261ab1a5347c7f7 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 8 Apr 2020 01:44:23 +0800 Subject: [PATCH] netlink: Remove the unused netlink_active Change-Id: I976b3fbab033baa4eaec35f8f443d4eb971db142 Signed-off-by: Xiang Xiao --- net/netlink/Make.defs | 2 +- net/netlink/netlink.h | 36 +++--------------------------------- net/netlink/netlink_conn.c | 32 +++++--------------------------- net/netlink/netlink_sockif.c | 6 +++--- 4 files changed, 12 insertions(+), 64 deletions(-) diff --git a/net/netlink/Make.defs b/net/netlink/Make.defs index 5e1a58a093..ce5aa9a3d5 100644 --- a/net/netlink/Make.defs +++ b/net/netlink/Make.defs @@ -33,7 +33,7 @@ # ############################################################################ -# Logic specific to IPv6 Neighbor Discovery Protocol +# Logic specific to NETLINK ifeq ($(CONFIG_NET_NETLINK),y) diff --git a/net/netlink/netlink.h b/net/netlink/netlink.h index f7012c130f..e1e7c7d6e4 100644 --- a/net/netlink/netlink.h +++ b/net/netlink/netlink.h @@ -55,12 +55,6 @@ #ifdef CONFIG_NET_NETLINK -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define NETLINK_NO_WAITER ((pid_t)-1) - /**************************************************************************** * Public Type Definitions ****************************************************************************/ @@ -73,13 +67,6 @@ struct netlink_conn_s dq_entry_t node; /* Supports a doubly linked list */ - /* This is a list of NetLink connection callbacks. Each callback - * represents a thread that is stalled, waiting for a device-specific - * event. - */ - - FAR struct devif_callback_s *list; /* NetLink callbacks */ - /* NetLink-specific content follows */ uint32_t pid; /* Port ID (if bound) */ @@ -95,7 +82,7 @@ struct netlink_conn_s /* Queued response data */ - sq_queue_t resplist; /* Singly linked list of responses*/ + sq_queue_t resplist; /* Singly linked list of responses */ }; /**************************************************************************** @@ -112,12 +99,6 @@ extern "C" EXTERN const struct sock_intf_s g_netlink_sockif; -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -struct sockaddr_nl; /* Forward reference */ - /**************************************************************************** * Name: netlink_initialize() * @@ -164,17 +145,6 @@ void netlink_free(FAR struct netlink_conn_s *conn); FAR struct netlink_conn_s *netlink_nextconn(FAR struct netlink_conn_s *conn); -/**************************************************************************** - * Name: netlink_active() - * - * Description: - * Find a connection structure that is the appropriate connection for the - * provided NetLink address - * - ****************************************************************************/ - -FAR struct netlink_conn_s *netlink_active(FAR struct sockaddr_nl *addr); - /**************************************************************************** * Name: netlink_notifier_setup * @@ -255,7 +225,7 @@ void netlink_notifier_signal(FAR struct netlink_conn_s *conn); ****************************************************************************/ FAR struct netlink_response_s * - netlink_tryget_response(FAR struct socket *psock); +netlink_tryget_response(FAR struct socket *psock); /**************************************************************************** * Name: netlink_get_response @@ -276,7 +246,7 @@ FAR struct netlink_response_s * ****************************************************************************/ FAR struct netlink_response_s * - netlink_get_response(FAR struct socket *psock); +netlink_get_response(FAR struct socket *psock); /**************************************************************************** * Name: netlink_check_response diff --git a/net/netlink/netlink_conn.c b/net/netlink/netlink_conn.c index 8935d0e7cb..f72876a0bd 100644 --- a/net/netlink/netlink_conn.c +++ b/net/netlink/netlink_conn.c @@ -129,7 +129,7 @@ static void netlink_response_available(FAR void *arg) * Name: netlink_initialize() * * Description: - * Initialize the User Socket connection structures. Called once and only + * Initialize the NetLink connection structures. Called once and only * from the networking layer. * ****************************************************************************/ @@ -250,27 +250,6 @@ FAR struct netlink_conn_s *netlink_nextconn(FAR struct netlink_conn_s *conn) } } -/**************************************************************************** - * Name: netlink_active - * - * Description: - * Find a connection structure that is the appropriate connection for the - * provided NetLink address - * - * Assumptions: - * - ****************************************************************************/ - -FAR struct netlink_conn_s *netlink_active(FAR struct sockaddr_nl *addr) -{ - /* This function is used to handle routing of incoming messages to sockets - * connected to the address. There is no such use case for NetLink - * sockets. - */ - - return NULL; -} - /**************************************************************************** * Name: netlink_add_response * @@ -330,7 +309,7 @@ void netlink_add_response(NETLINK_HANDLE handle, ****************************************************************************/ FAR struct netlink_response_s * - netlink_tryget_response(FAR struct socket *psock) +netlink_tryget_response(FAR struct socket *psock) { FAR struct netlink_response_s *resp; FAR struct netlink_conn_s *conn; @@ -369,7 +348,7 @@ FAR struct netlink_response_s * ****************************************************************************/ FAR struct netlink_response_s * - netlink_get_response(FAR struct socket *psock) +netlink_get_response(FAR struct socket *psock) { FAR struct netlink_response_s *resp; FAR struct netlink_conn_s *conn; @@ -391,8 +370,8 @@ FAR struct netlink_response_s * /* Set up a semaphore to notify us when a response is queued. */ - (void)sem_init(&waitsem, 0, 0); - (void)nxsem_setprotocol(&waitsem, SEM_PRIO_NONE); + sem_init(&waitsem, 0, 0); + nxsem_setprotocol(&waitsem, SEM_PRIO_NONE); /* Set up a notifier to post the semaphore when a response is * received. @@ -420,7 +399,6 @@ FAR struct netlink_response_s * if (ret < 0) { - resp = NULL; break; } } diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c index cff507aa75..3b8e498e5f 100644 --- a/net/netlink/netlink_sockif.c +++ b/net/netlink/netlink_sockif.c @@ -118,7 +118,7 @@ const struct sock_intf_s g_netlink_sockif = ****************************************************************************/ /**************************************************************************** - * Name: inet_setup + * Name: netlink_setup * * Description: * Called for socket() to verify that the provided socket type and @@ -458,7 +458,7 @@ static int netlink_connect(FAR struct socket *psock, * actual length of the address returned. * * If no pending connections are present on the queue, and the socket is - * not marked as non-blocking, inet_accept blocks the caller until a + * not marked as non-blocking, accept blocks the caller until a * connection is present. If the socket is marked non-blocking and no * pending connections are present on the queue, inet_accept returns * EAGAIN. @@ -518,7 +518,7 @@ static void netlink_response_available(FAR void *arg) /* Wake up the poll() with POLLIN */ *conn->pollevent |= POLLIN; - (void)nxsem_post(conn->pollsem); + nxsem_post(conn->pollsem); } else {