Skip to contentSkip to conversation

net: add documentation to socket.c

PATCH Superseded Pedro Tammela 2 participants 3 messages Mar 14, 2019 – Mar 15, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: add documentation to socket.c

Adds missing sphinx documentation to the socket.c's functions. Also fixes some whitespaces.

I also changed the style of older documentation as an effort to have an uniform documentation style.

---
 include/linux/net.h    |   6 +
 include/linux/socket.h |  12 +-
 net/socket.c           | 277 ++++++++++++++++++++++++++++++++++++++---
 3 files changed, 271 insertions(+), 24 deletions(-)
include/linux/net.h +6 -0
index e0930678c8bf..41dc703b261c 100644
@@ -83,6 +83,12 @@ enum sock_type {
 
 #endif /* ARCH_HAS_SOCKET_TYPES */
 
+/**
+ * enum sock_shutdown_cmd - Shutdown types
+ * @SHUT_RD: shutdown receptions
+ * @SHUT_WR: shutdown transmissions
+ * @SHUT_RDWR: shutdown receptions/transmissions
+ */
 enum sock_shutdown_cmd {
 	SHUT_RD,
 	SHUT_WR,
include/linux/socket.h +6 -6
index 6016daeecee4..b57cd8bf96e2 100644
@@ -26,7 +26,7 @@ typedef __kernel_sa_family_t	sa_family_t;
 /*
  *	1003.1g requires sa_family_t and that sa_data is char.
  */
- 
+
 struct sockaddr {
 	sa_family_t	sa_family;	/* address family, AF_xxx	*/
 	char		sa_data[14];	/* 14 bytes of protocol address	*/
@@ -44,7 +44,7 @@ struct linger {
  *	system, not 4.3. Thus msg_accrights(len) are now missing. They
  *	belong in an obscure libc emulation or the bin.
  */
- 
+
 struct msghdr {
 	void		*msg_name;	/* ptr to socket address structure */
 	int		msg_namelen;	/* size of socket address structure */
@@ -54,7 +54,7 @@ struct msghdr {
 	unsigned int	msg_flags;	/* flags on received message */
 	struct kiocb	*msg_iocb;	/* ptr to iocb for async requests */
 };
- 
+
 struct user_msghdr {
 	void		__user *msg_name;	/* ptr to socket address structure */
 	int		msg_namelen;		/* size of socket address structure */
@@ -122,7 +122,7 @@ struct cmsghdr {
  *	inside range, given by msg->msg_controllen before using
  *	ancillary object DATA.				--ANK (980731)
  */
- 
+
 static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
 					       struct cmsghdr *__cmsg)
 {
@@ -264,10 +264,10 @@ struct ucred {
 /* Maximum queue length specifiable by listen.  */
 #define SOMAXCONN	128
 
-/* Flags we can use with send/ and recv. 
+/* Flags we can use with send/ and recv.
    Added those for 1003.1g not all are supported yet
  */
- 
+
 #define MSG_OOB		1
 #define MSG_PEEK	2
 #define MSG_DONTROUTE	4
net/socket.c +259 -18

440 lines not on this page · raw message

Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/1 net: add documentation to socket.c

Adds missing sphinx documentation to the socket.c's functions. Also fixes some whitespaces.

I also changed the style of older documentation as an effort to have an uniform documentation style.

---
Changes in v2:
- Fixed some mixed tab and spaces
- Added missing signed-off to commit message

 include/linux/net.h    |   6 +
 include/linux/socket.h |  12 +-
 net/socket.c           | 277 ++++++++++++++++++++++++++++++++++++++---
 3 files changed, 271 insertions(+), 24 deletions(-)
include/linux/net.h +6 -0
index e0930678c8bf..41dc703b261c 100644
@@ -83,6 +83,12 @@ enum sock_type {
 
 #endif /* ARCH_HAS_SOCKET_TYPES */
 
+/**
+ * enum sock_shutdown_cmd - Shutdown types
+ * @SHUT_RD: shutdown receptions
+ * @SHUT_WR: shutdown transmissions
+ * @SHUT_RDWR: shutdown receptions/transmissions
+ */
 enum sock_shutdown_cmd {
 	SHUT_RD,
 	SHUT_WR,
include/linux/socket.h +6 -6
index 6016daeecee4..b57cd8bf96e2 100644
@@ -26,7 +26,7 @@ typedef __kernel_sa_family_t	sa_family_t;
 /*
  *	1003.1g requires sa_family_t and that sa_data is char.
  */
- 
+
 struct sockaddr {
 	sa_family_t	sa_family;	/* address family, AF_xxx	*/
 	char		sa_data[14];	/* 14 bytes of protocol address	*/
@@ -44,7 +44,7 @@ struct linger {
  *	system, not 4.3. Thus msg_accrights(len) are now missing. They
  *	belong in an obscure libc emulation or the bin.
  */
- 
+
 struct msghdr {
 	void		*msg_name;	/* ptr to socket address structure */
 	int		msg_namelen;	/* size of socket address structure */
@@ -54,7 +54,7 @@ struct msghdr {
 	unsigned int	msg_flags;	/* flags on received message */
 	struct kiocb	*msg_iocb;	/* ptr to iocb for async requests */
 };
- 
+
 struct user_msghdr {
 	void		__user *msg_name;	/* ptr to socket address structure */
 	int		msg_namelen;		/* size of socket address structure */
@@ -122,7 +122,7 @@ struct cmsghdr {
  *	inside range, given by msg->msg_controllen before using
  *	ancillary object DATA.				--ANK (980731)
  */
- 
+
 static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
 					       struct cmsghdr *__cmsg)
 {
@@ -264,10 +264,10 @@ struct ucred {
 /* Maximum queue length specifiable by listen.  */
 #define SOMAXCONN	128
 
-/* Flags we can use with send/ and recv. 
+/* Flags we can use with send/ and recv.
    Added those for 1003.1g not all are supported yet
  */
- 
+
 #define MSG_OOB		1
 #define MSG_PEEK	2
 #define MSG_DONTROUTE	4
net/socket.c +259 -18

440 lines not on this page · raw message

Signature · 1 line
2.21.0
maintainer Applied
#2 lore raw

From: Pedro Tammela <[email protected]>
Date: Thu, 14 Mar 2019 10:45:23 -0300

Quoted 11 lines

Adds missing sphinx documentation to the socket.c's functions. Also fixes some whitespaces.

I also changed the style of older documentation as an effort to have an uniform documentation style.

---
Changes in v2:
- Fixed some mixed tab and spaces
- Added missing signed-off to commit message

Applied, thanks Pedro.