net: unify socket into file descriptor

Change-Id: I9bcd21564e6c97d3edbb38aed1748c114160ea36
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong
2021-02-23 18:04:13 +08:00
committed by Xiang Xiao
parent 5e9e2bec32
commit 4d5a964f29
69 changed files with 628 additions and 1723 deletions
+1 -39
View File
@@ -1647,7 +1647,7 @@ int psock_vioctl(FAR struct socket *psock, int cmd, va_list ap)
/* Verify that the psock corresponds to valid, allocated socket */
if (psock == NULL || psock->s_crefs <= 0)
if (psock == NULL || psock->s_conn == NULL)
{
return -EBADF;
}
@@ -1757,44 +1757,6 @@ int psock_ioctl(FAR struct socket *psock, int cmd, ...)
return ret;
}
/****************************************************************************
* Name: netdev_vioctl
*
* Description:
* Perform network device specific operations.
*
* Input Parameters:
* sockfd Socket descriptor of device
* cmd The ioctl command
* ap The argument of the ioctl cmd
*
* Returned Value:
* A non-negative value is returned on success; a negated errno value is
* returned on any failure to indicate the nature of the failure:
*
* EBADF
* 'sockfd' is not a valid socket descriptor.
* EFAULT
* 'arg' references an inaccessible memory area.
* ENOTTY
* 'cmd' not valid.
* EINVAL
* 'arg' is not valid.
* ENOTTY
* 'sockfd' is not associated with a network device.
* ENOTTY
* The specified request does not apply to the kind of object that the
* descriptor 'sockfd' references.
*
****************************************************************************/
int netdev_vioctl(int sockfd, int cmd, va_list ap)
{
FAR struct socket *psock = sockfd_socket(sockfd);
return psock_vioctl(psock, cmd, ap);
}
/****************************************************************************
* Name: netdev_ifup / netdev_ifdown
*