From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next RFC 6/7] devlink: Add a boolean generic port parameter Date: Wed, 5 Dec 2018 14:04:14 +0100 Message-ID: <20181205130414.GG2318@nanopsycho> References: <1543989420-14859-1-git-send-email-vasundhara-v.volam@broadcom.com> <1543989420-14859-7-git-send-email-vasundhara-v.volam@broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, michael.chan@broadcom.com, jiri@mellanox.com, netdev@vger.kernel.org To: Vasundhara Volam Return-path: Received: from mail-wr1-f68.google.com ([209.85.221.68]:34441 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727025AbeLENLW (ORCPT ); Wed, 5 Dec 2018 08:11:22 -0500 Received: by mail-wr1-f68.google.com with SMTP id j2so19653793wrw.1 for ; Wed, 05 Dec 2018 05:11:19 -0800 (PST) Content-Disposition: inline In-Reply-To: <1543989420-14859-7-git-send-email-vasundhara-v.volam@broadcom.com> Sender: netdev-owner@vger.kernel.org List-ID: Wed, Dec 05, 2018 at 06:56:59AM CET, vasundhara-v.volam@broadcom.com wrote: >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 >Signed-off-by: Vasundhara Volam >--- > 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, \ >+} Just use DEVLINK_PARAM_GENERIC >+ > 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 >