lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1543989420-14859-7-git-send-email-vasundhara-v.volam@broadcom.com>
Date:   Wed,  5 Dec 2018 11:26:59 +0530
From:   Vasundhara Volam <vasundhara-v.volam@...adcom.com>
To:     davem@...emloft.net
Cc:     michael.chan@...adcom.com, jiri@...lanox.com,
        netdev@...r.kernel.org
Subject: [PATCH net-next RFC 6/7] devlink: Add a boolean generic port parameter

wake-on-lan - Enables Wake on Lan for this port when magic packet
is received with this port's MAC address using ACPI pattern.
If enabled, the controller asserts a wake pin upon reception of
WoL packet.  ACPI (Advanced Configuration and Power Interface)
is an industry specification for the efficient handling of power
consumption in desktop and mobile computers.

Cc: Jiri Pirko <jiri@...lanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
---
 include/net/devlink.h | 17 +++++++++++++++++
 net/core/devlink.c    |  8 +++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/include/net/devlink.h b/include/net/devlink.h
index abb5b3a..7409076 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -421,12 +421,29 @@ enum devlink_param_generic_id {
 }
 
 enum devlink_port_param_generic_id {
+	DEVLINK_PORT_PARAM_GENERIC_ID_WOL,
+
 	/* add new param generic ids above here */
 	__DEVLINK_PORT_PARAM_GENERIC_ID_MAX,
 	DEVLINK_PORT_PARAM_GENERIC_ID_MAX =
 	       __DEVLINK_PORT_PARAM_GENERIC_ID_MAX - 1,
 };
 
+#define DEVLINK_PORT_PARAM_GENERIC_WOL_NAME "wake-on-lan"
+#define DEVLINK_PORT_PARAM_GENERIC_WOL_TYPE DEVLINK_PARAM_TYPE_BOOL
+
+#define DEVLINK_PORT_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
+{									\
+	.id = DEVLINK_PORT_PARAM_GENERIC_ID_##_id,			\
+	.name = DEVLINK_PORT_PARAM_GENERIC_##_id##_NAME,		\
+	.type = DEVLINK_PORT_PARAM_GENERIC_##_id##_TYPE,		\
+	.generic = true,						\
+	.supported_cmodes = _cmodes,					\
+	.get = _get,							\
+	.set = _set,							\
+	.validate = _validate,						\
+}
+
 struct devlink_region;
 
 typedef void devlink_snapshot_data_dest_t(const void *data);
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 7598da1..24c2b9e 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -3210,7 +3210,13 @@ static void devlink_param_unregister_one(struct devlink *devlink,
 	kfree(param_item);
 }
 
-static const struct devlink_param devlink_port_param_generic[] = {};
+static const struct devlink_param devlink_port_param_generic[] = {
+	{
+		.id = DEVLINK_PORT_PARAM_GENERIC_ID_WOL,
+		.name = DEVLINK_PORT_PARAM_GENERIC_WOL_NAME,
+		.type = DEVLINK_PORT_PARAM_GENERIC_WOL_TYPE,
+	},
+};
 
 static int devlink_port_param_generic_verify(const struct devlink_param *param)
 {
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ