@@ -200,7 +200,8 @@ struct ucred {
#define AF_ALG 38 /* Algorithm sockets */
#define AF_NFC 39 /* NFC sockets */
#define AF_VSOCK 40 /* vSockets */
-#define AF_MAX 41 /* For now.. */
+#define AF_SMC 41 /* smc sockets>->------->-------*/
+#define AF_MAX 42 /* For now.. */
/* Protocol families, same as address families. */
#define PF_UNSPEC AF_UNSPEC
@@ -246,6 +247,7 @@ struct ucred {
#define PF_ALG AF_ALG
#define PF_NFC AF_NFC
#define PF_VSOCK AF_VSOCK
+#define PF_SMC AF_SMC
#define PF_MAX AF_MAX
/* Maximum queue length specifiable by listen. */
new file mode 100644
@@ -0,0 +1,13 @@
+/*
+ * SMC Definitions for the SMC protocol.
+ *
+ * Author: Ursula Braun <ursula.braun@de.ibm.com>
+ */
+#ifndef _SMC_H
+#define _SMC_H
+
+/* SMC socket options - disjunct with TCP socket options */
+#define SMC_KEEPALIVE 99 /* start/stop keepalives */
+
+#endif /* _SMC_H */
+
@@ -54,6 +54,7 @@ source "net/packet/Kconfig"
source "net/unix/Kconfig"
source "net/xfrm/Kconfig"
source "net/iucv/Kconfig"
+source "net/smc/Kconfig"
config INET
bool "TCP/IP networking"
@@ -49,6 +49,7 @@ obj-$(CONFIG_MAC80211) += mac80211/
obj-$(CONFIG_TIPC) += tipc/
obj-$(CONFIG_NETLABEL) += netlabel/
obj-$(CONFIG_IUCV) += iucv/
+obj-$(CONFIG_AFSMC) += smc/
obj-$(CONFIG_RFKILL) += rfkill/
obj-$(CONFIG_NET_9P) += 9p/
obj-$(CONFIG_CAIF) += caif/
@@ -139,6 +139,9 @@
#ifdef CONFIG_INET
#include <net/tcp.h>
+#if IS_ENABLED(CONFIG_AFSMC)
+#include <net/smc.h>
+#endif /* CONFIG_AFSMC */
#endif
#include <net/busy_poll.h>
@@ -784,8 +787,16 @@ set_rcvbuf:
case SO_KEEPALIVE:
#ifdef CONFIG_INET
if (sk->sk_protocol == IPPROTO_TCP &&
- sk->sk_type == SOCK_STREAM)
- tcp_set_keepalive(sk, valbool);
+ sk->sk_type == SOCK_STREAM) {
+#if IS_ENABLED(CONFIG_AFSMC)
+ if (sk->sk_family == AF_SMC)
+ sock->ops->setsockopt(sock, SOL_TCP,
+ SMC_KEEPALIVE,
+ optval, optlen);
+ else
+#endif
+ tcp_set_keepalive(sk, valbool);
+ }
#endif
sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool);
break;