net/: Correct some comments.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche
2021-01-15 10:01:00 +01:00
committed by hartmannathan
parent 154949403c
commit 6385408483
9 changed files with 27 additions and 26 deletions
+2 -2
View File
@@ -177,8 +177,8 @@ static int bluetooth_sockif_alloc(FAR struct socket *psock)
static int bluetooth_setup(FAR struct socket *psock, int protocol) static int bluetooth_setup(FAR struct socket *psock, int protocol)
{ {
/* Allocate the appropriate connection structure. This reserves the /* Allocate the appropriate connection structure. This reserves the
* the connection structure is is unallocated at this point. It will * connection structure, it is unallocated at this point. It will not
* not actually be initialized until the socket is connected. * actually be initialized until the socket is connected.
* *
* Only SOCK_RAW is supported * Only SOCK_RAW is supported
*/ */
+5 -5
View File
@@ -189,7 +189,7 @@ static uint16_t can_poll_eventhandler(FAR struct net_driver_s *dev,
* Input Parameters: * Input Parameters:
* psock - A pointer to a user allocated socket structure to be * psock - A pointer to a user allocated socket structure to be
* initialized. * initialized.
* protocol - NetLink socket protocol (see sys/socket.h) * protocol - CAN socket protocol (see sys/socket.h)
* *
* Returned Value: * Returned Value:
* Zero (OK) is returned on success. Otherwise, a negated errno value is * Zero (OK) is returned on success. Otherwise, a negated errno value is
@@ -226,7 +226,7 @@ static int can_setup(FAR struct socket *psock, int protocol)
if (domain == PF_CAN && (type == SOCK_RAW || type == SOCK_DGRAM)) if (domain == PF_CAN && (type == SOCK_RAW || type == SOCK_DGRAM))
{ {
/* Allocate the NetLink socket connection structure and save it in the /* Allocate the CAN socket connection structure and save it in the
* new socket instance. * new socket instance.
*/ */
@@ -322,7 +322,7 @@ static void can_addref(FAR struct socket *psock)
* space (address family) but has no name assigned. * space (address family) but has no name assigned.
* *
* Input Parameters: * Input Parameters:
* conn NetLink socket connection structure * conn CAN socket connection structure
* addr Socket local address * addr Socket local address
* addrlen Length of 'addr' * addrlen Length of 'addr'
* *
@@ -384,7 +384,7 @@ static int can_bind(FAR struct socket *psock,
* the object pointed to by address is unspecified. * the object pointed to by address is unspecified.
* *
* Input Parameters: * Input Parameters:
* conn NetLink socket connection structure * conn CAN socket connection structure
* addr sockaddr structure to receive data [out] * addr sockaddr structure to receive data [out]
* addrlen Length of sockaddr structure [in/out] * addrlen Length of sockaddr structure [in/out]
* *
@@ -801,7 +801,7 @@ static ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
* Name: can_close * Name: can_close
* *
* Description: * Description:
* Performs the close operation on a NetLink socket instance * Performs the close operation on a CAN socket instance
* *
* Input Parameters: * Input Parameters:
* psock Socket instance * psock Socket instance
+2 -2
View File
@@ -240,7 +240,7 @@ static int devif_poll_pkt_connections(FAR struct net_driver_s *dev,
#endif /* CONFIG_NET_PKT */ #endif /* CONFIG_NET_PKT */
/**************************************************************************** /****************************************************************************
* Name: devif_poll_pkt_connections * Name: devif_poll_can_connections
* *
* Description: * Description:
* Poll all packet connections for available packets to send. * Poll all packet connections for available packets to send.
@@ -705,7 +705,7 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
#endif #endif
#ifdef CONFIG_NET_CAN #ifdef CONFIG_NET_CAN
{ {
/* Check for pending packet socket transfer */ /* Check for pending CAN socket transfer */
bstop = devif_poll_can_connections(dev, callback); bstop = devif_poll_can_connections(dev, callback);
} }
+2 -2
View File
@@ -178,8 +178,8 @@ static int ieee802154_sockif_alloc(FAR struct socket *psock)
static int ieee802154_setup(FAR struct socket *psock, int protocol) static int ieee802154_setup(FAR struct socket *psock, int protocol)
{ {
/* Allocate the appropriate connection structure. This reserves the /* Allocate the appropriate connection structure. This reserves the
* the connection structure is is unallocated at this point. It will * connection structure, it is unallocated at this point. It will not
* not actually be initialized until the socket is connected. * actually be initialized until the socket is connected.
* *
* Only SOCK_DGRAM is supported (since the MAC header is stripped) * Only SOCK_DGRAM is supported (since the MAC header is stripped)
*/ */
+2 -2
View File
@@ -178,8 +178,8 @@ static int local_sockif_alloc(FAR struct socket *psock)
static int local_setup(FAR struct socket *psock, int protocol) static int local_setup(FAR struct socket *psock, int protocol)
{ {
/* Allocate the appropriate connection structure. This reserves the /* Allocate the appropriate connection structure. This reserves the
* the connection structure is is unallocated at this point. It will * connection structure, it is unallocated at this point. It will not
* not actually be initialized until the socket is connected. * actually be initialized until the socket is connected.
* *
* REVIST: Only SOCK_STREAM and SOCK_DGRAM are supported. Should also * REVIST: Only SOCK_STREAM and SOCK_DGRAM are supported. Should also
* support SOCK_RAW. * support SOCK_RAW.
+2 -2
View File
@@ -163,7 +163,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
* *
* Returned Value: * Returned Value:
* On success, returns the number of characters sent. On error, * On success, returns the number of characters sent. On error,
* a negated errno value is retruend. See send() for the complete list * a negated errno value is returned. See send() for the complete list
* of return values. * of return values.
* *
****************************************************************************/ ****************************************************************************/
@@ -244,7 +244,7 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf,
nxsem_destroy(&state.snd_sem); nxsem_destroy(&state.snd_sem);
net_unlock(); net_unlock();
/* Check for a errors, Errors are signalled by negative errno values /* Check for errors. Errors are signalled by negative errno values
* for the send length * for the send length
*/ */
+4 -4
View File
@@ -176,8 +176,8 @@ static int pkt_sockif_alloc(FAR struct socket *psock)
static int pkt_setup(FAR struct socket *psock, int protocol) static int pkt_setup(FAR struct socket *psock, int protocol)
{ {
/* Allocate the appropriate connection structure. This reserves the /* Allocate the appropriate connection structure. This reserves the
* the connection structure is is unallocated at this point. It will * connection structure, it is unallocated at this point. It will not
* not actually be initialized until the socket is connected. * actually be initialized until the socket is connected.
* *
* Only SOCK_RAW is supported. * Only SOCK_RAW is supported.
*/ */
@@ -361,14 +361,14 @@ static int pkt_bind(FAR struct socket *psock,
return -EBADF; return -EBADF;
} }
/* Bind a raw socket to an network device. */ /* Bind a raw socket to a network device. */
if (psock->s_type == SOCK_RAW) if (psock->s_type == SOCK_RAW)
{ {
FAR struct pkt_conn_s *conn = (FAR struct pkt_conn_s *)psock->s_conn; FAR struct pkt_conn_s *conn = (FAR struct pkt_conn_s *)psock->s_conn;
FAR struct net_driver_s *dev; FAR struct net_driver_s *dev;
/* Look at the addr and identify network interface */ /* Look at the addr and identify the network interface */
ifindex = ((FAR struct sockaddr_ll *)addr)->sll_ifindex; ifindex = ((FAR struct sockaddr_ll *)addr)->sll_ifindex;
+3 -2
View File
@@ -51,7 +51,7 @@
* Name: chksum * Name: chksum
* *
* Description: * Description:
* Calculate the raw change some over the memory region described by * Calculate the raw change sum over the memory region described by
* data and len. * data and len.
* *
* Input Parameters: * Input Parameters:
@@ -124,7 +124,8 @@ uint16_t chksum(uint16_t sum, FAR const uint8_t *data, uint16_t len)
* *
* buf - A pointer to the buffer over which the checksum is to be computed. * buf - A pointer to the buffer over which the checksum is to be computed.
* *
* len - The length of the buffer over which the checksum is to be computed. * len - The length of the buffer over which the checksum is to be
* computed.
* *
* Returned Value: * Returned Value:
* The Internet checksum of the buffer. * The Internet checksum of the buffer.
+4 -4
View File
@@ -394,11 +394,11 @@ int net_restorelock(unsigned int count)
* Name: net_timedwait * Name: net_timedwait
* *
* Description: * Description:
* Atomically wait for sem (or a timeout( while temporarily releasing * Atomically wait for sem (or a timeout) while temporarily releasing
* the lock on the network. * the lock on the network.
* *
* Caution should be utilized. Because the network lock is relinquished * Caution should be utilized. Because the network lock is relinquished
* during the wait, there could changes in the network state that occur * during the wait, there could be changes in the network state that occur
* before the lock is recovered. Your design should account for this * before the lock is recovered. Your design should account for this
* possibility. * possibility.
* *
@@ -424,7 +424,7 @@ int net_timedwait(sem_t *sem, unsigned int timeout)
* Atomically wait for sem while temporarily releasing the network lock. * Atomically wait for sem while temporarily releasing the network lock.
* *
* Caution should be utilized. Because the network lock is relinquished * Caution should be utilized. Because the network lock is relinquished
* during the wait, there could changes in the network state that occur * during the wait, there could be changes in the network state that occur
* before the lock is recovered. Your design should account for this * before the lock is recovered. Your design should account for this
* possibility. * possibility.
* *
@@ -493,7 +493,7 @@ int net_lockedwait_uninterruptible(sem_t *sem)
* for the IOB while temporarily releasing the lock on the network. * for the IOB while temporarily releasing the lock on the network.
* *
* Caution should be utilized. Because the network lock is relinquished * Caution should be utilized. Because the network lock is relinquished
* during the wait, there could changes in the network state that occur * during the wait, there could be changes in the network state that occur
* before the lock is recovered. Your design should account for this * before the lock is recovered. Your design should account for this
* possibility. * possibility.
* *