summaryrefslogtreecommitdiffstats
path: root/net/mctp/af_mctp.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2021-07-29 10:20:44 +0800
committerDavid S. Miller <davem@davemloft.net>2021-07-29 15:06:50 +0100
commit583be982d93479ea3d85091b0fd0b01201ede87d (patch)
treeb4407ff68cdafc6bea2041b6ca0dac5be0a1bfa2 /net/mctp/af_mctp.c
parent4b2e69305cbbc7c32ecbd946110b505c4ff6071a (diff)
downloadlinux-583be982d93479ea3d85091b0fd0b01201ede87d.tar.gz
linux-583be982d93479ea3d85091b0fd0b01201ede87d.tar.bz2
linux-583be982d93479ea3d85091b0fd0b01201ede87d.zip
mctp: Add device handling and netlink interface
This change adds the infrastructure for managing MCTP netdevices; we add a pointer to the AF_MCTP-specific data to struct netdevice, and hook up the rtnetlink operations for adding and removing addresses. Includes changes from Matt Johnston <matt@codeconstruct.com.au>. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mctp/af_mctp.c')
-rw-r--r--net/mctp/af_mctp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index b3aeca6486e3..401b4fa141a5 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -6,13 +6,18 @@
* Copyright (c) 2021 Google
*/
+#include <linux/if_arp.h>
#include <linux/net.h>
#include <linux/mctp.h>
#include <linux/module.h>
#include <linux/socket.h>
+#include <net/mctp.h>
+#include <net/mctpdevice.h>
#include <net/sock.h>
+/* socket implementation */
+
struct mctp_sock {
struct sock sk;
};
@@ -152,6 +157,8 @@ static __init int mctp_init(void)
if (rc)
goto err_unreg_sock;
+ mctp_device_init();
+
return 0;
err_unreg_sock:
@@ -162,6 +169,7 @@ err_unreg_sock:
static __exit void mctp_exit(void)
{
+ mctp_device_exit();
proto_unregister(&mctp_proto);
sock_unregister(PF_MCTP);
}