All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: netdev@vger.kernel.org
Cc: Andrew Jeffery <andrew@aj.id.au>,
	Matt Johnston <matt@codeconstruct.com.au>
Subject: [PATCH RFC net-next 01/16] mctp: Add MCTP base
Date: Thu,  3 Jun 2021 14:52:03 +0800	[thread overview]
Message-ID: <20210603065218.570867-2-jk@codeconstruct.com.au> (raw)
In-Reply-To: <20210603065218.570867-1-jk@codeconstruct.com.au>

Add basic Kconfig, an initial (empty) af_mctp source object, and
{AF,PF}_MCTP definitions.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
 MAINTAINERS               |  7 +++++++
 include/linux/socket.h    |  6 +++++-
 include/uapi/linux/mctp.h | 15 +++++++++++++++
 net/Kconfig               |  1 +
 net/Makefile              |  1 +
 net/mctp/Kconfig          | 13 +++++++++++++
 net/mctp/Makefile         |  3 +++
 net/mctp/af_mctp.c        |  7 +++++++
 8 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 include/uapi/linux/mctp.h
 create mode 100644 net/mctp/Kconfig
 create mode 100644 net/mctp/Makefile
 create mode 100644 net/mctp/af_mctp.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 503fd21901f1..5041ea78ab97 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10869,6 +10869,13 @@ F:	drivers/mailbox/arm_mhuv2.c
 F:	include/linux/mailbox/arm_mhuv2_message.h
 F:	Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
 
+MANAGEMENT CONTROLLER TRANSPORT PROTOCOL (MCTP)
+M:	Jeremy Kerr <jk@codeconstruct.com.au>
+M:	Matt Johnston <matt@codeconstruct.com.au>
+L:	netdev@vger.kernel.org
+S:	Maintained
+F:	net/mctp/
+
 MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7
 M:	Michael Kerrisk <mtk.manpages@gmail.com>
 L:	linux-man@vger.kernel.org
diff --git a/include/linux/socket.h b/include/linux/socket.h
index b8fc5c53ba6f..40f866575d3d 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -223,8 +223,11 @@ struct ucred {
 				 * reuses AF_INET address family
 				 */
 #define AF_XDP		44	/* XDP sockets			*/
+#define AF_MCTP		45	/* Management controller
+				 * transport protocol
+				 */
 
-#define AF_MAX		45	/* For now.. */
+#define AF_MAX		46	/* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC	AF_UNSPEC
@@ -274,6 +277,7 @@ struct ucred {
 #define PF_QIPCRTR	AF_QIPCRTR
 #define PF_SMC		AF_SMC
 #define PF_XDP		AF_XDP
+#define PF_MCTP		AF_MCTP
 #define PF_MAX		AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
diff --git a/include/uapi/linux/mctp.h b/include/uapi/linux/mctp.h
new file mode 100644
index 000000000000..eec6715143a0
--- /dev/null
+++ b/include/uapi/linux/mctp.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Management Controller Transport Protocol (MCTP)
+ *
+ * Copyright (c) 2021 Code Construct
+ * Copyright (c) 2021 Google
+ */
+
+#ifndef __UAPI_MCTP_H
+#define __UAPI_MCTP_H
+
+struct sockaddr_mctp {
+};
+
+#endif /* __UAPI_MCTP_H */
diff --git a/net/Kconfig b/net/Kconfig
index c7392c449b25..fb13460c6dab 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -363,6 +363,7 @@ source "net/bluetooth/Kconfig"
 source "net/rxrpc/Kconfig"
 source "net/kcm/Kconfig"
 source "net/strparser/Kconfig"
+source "net/mctp/Kconfig"
 
 config FIB_RULES
 	bool
diff --git a/net/Makefile b/net/Makefile
index 9ca9572188fe..fbfeb8a0bb37 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -78,3 +78,4 @@ obj-$(CONFIG_QRTR)		+= qrtr/
 obj-$(CONFIG_NET_NCSI)		+= ncsi/
 obj-$(CONFIG_XDP_SOCKETS)	+= xdp/
 obj-$(CONFIG_MPTCP)		+= mptcp/
+obj-$(CONFIG_MCTP)		+= mctp/
diff --git a/net/mctp/Kconfig b/net/mctp/Kconfig
new file mode 100644
index 000000000000..259aca76da60
--- /dev/null
+++ b/net/mctp/Kconfig
@@ -0,0 +1,13 @@
+
+menuconfig MCTP
+	depends on NET
+	tristate "MCTP core protocol support"
+	help
+	  Management Controller Transport Protocol (MCTP) is an in-system
+	  protocol for communicating between management controllers and
+	  their managed devices (peripherals, host processors, etc.). The
+	  protocol is defined by DMTF specification DSP0236.
+
+	  This option enables core MCTP support. For communicating with other
+	  devices, you'll want to enable a driver for a specific hardware
+	  channel.
diff --git a/net/mctp/Makefile b/net/mctp/Makefile
new file mode 100644
index 000000000000..7c056b1b7939
--- /dev/null
+++ b/net/mctp/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_MCTP) += mctp.o
+mctp-objs := af_mctp.o
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
new file mode 100644
index 000000000000..87823fd3a11e
--- /dev/null
+++ b/net/mctp/af_mctp.c
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Management Controller Transport Protocol (MCTP)
+ *
+ * Copyright (c) 2021 Code Construct
+ * Copyright (c) 2021 Google
+ */
-- 
2.30.2


  reply	other threads:[~2021-06-03  6:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  6:52 [PATCH RFC net-next 00/16] Add Management Controller Transport Protocol support Jeremy Kerr
2021-06-03  6:52 ` Jeremy Kerr [this message]
2021-06-03  8:41   ` [PATCH RFC net-next 01/16] mctp: Add MCTP base kernel test robot
2021-06-03 12:34   ` kernel test robot
2021-06-03  6:52 ` [PATCH RFC net-next 02/16] mctp: Add base socket/protocol definitions Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 03/16] mctp: Add base packet definitions Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 04/16] mctp: Add sockaddr_mctp to uapi Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 05/16] mctp: Add initial driver infrastructure Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 06/16] mctp: Add device handling and netlink interface Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 07/16] mctp: Add initial routing framework Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 08/16] mctp: Add netlink route management Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 09/16] mctp: Add neighbour implementation Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 10/16] mctp: Add neighbour netlink interface Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 11/16] mctp: Populate socket implementation Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 12/16] mctp: Add dest neighbour lladdr to route output Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 13/16] mctp: Implement message fragmentation & reassembly Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 14/16] mctp: Allow per-netns default networks Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 15/16] mctp: Allow MCTP on tun devices Jeremy Kerr
2021-06-03  6:52 ` [PATCH RFC net-next 16/16] mctp: Add MCTP overview document Jeremy Kerr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210603065218.570867-2-jk@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=andrew@aj.id.au \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.