Skip to content

Commit b639583

Browse files
Vasundhara Volamdavem330
authored andcommitted
devlink: Add a generic wake_on_lan port parameter
wake_on_lan - Enables Wake on Lan for this port. If enabled, the controller asserts a wake pin based on the WOL type. v2->v3: - Define only WOL types used now and define them as bitfield, so that mutliple WOL types can be enabled upon power on. - Modify "wake-on-lan" name to "wake_on_lan" to be symmetric with previous definitions. - Rename DEVLINK_PARAM_WOL_XXX to DEVLINK_PARAM_WAKE_XXX to be symmetrical with ethtool WOL definitions. Cc: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c1e5786 commit b639583

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

include/net/devlink.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,17 @@ enum devlink_param_generic_id {
367367
DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX,
368368
DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN,
369369
DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY,
370+
DEVLINK_PARAM_GENERIC_ID_WOL,
370371

371372
/* add new param generic ids above here*/
372373
__DEVLINK_PARAM_GENERIC_ID_MAX,
373374
DEVLINK_PARAM_GENERIC_ID_MAX = __DEVLINK_PARAM_GENERIC_ID_MAX - 1,
374375
};
375376

377+
enum devlink_param_wol_types {
378+
DEVLINK_PARAM_WAKE_MAGIC = (1 << 0),
379+
};
380+
376381
#define DEVLINK_PARAM_GENERIC_INT_ERR_RESET_NAME "internal_error_reset"
377382
#define DEVLINK_PARAM_GENERIC_INT_ERR_RESET_TYPE DEVLINK_PARAM_TYPE_BOOL
378383

@@ -397,6 +402,9 @@ enum devlink_param_generic_id {
397402
#define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_NAME "fw_load_policy"
398403
#define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_TYPE DEVLINK_PARAM_TYPE_U8
399404

405+
#define DEVLINK_PARAM_GENERIC_WOL_NAME "wake_on_lan"
406+
#define DEVLINK_PARAM_GENERIC_WOL_TYPE DEVLINK_PARAM_TYPE_U8
407+
400408
#define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \
401409
{ \
402410
.id = DEVLINK_PARAM_GENERIC_ID_##_id, \

net/core/devlink.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,6 +2697,11 @@ static const struct devlink_param devlink_param_generic[] = {
26972697
.name = DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_NAME,
26982698
.type = DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_TYPE,
26992699
},
2700+
{
2701+
.id = DEVLINK_PARAM_GENERIC_ID_WOL,
2702+
.name = DEVLINK_PARAM_GENERIC_WOL_NAME,
2703+
.type = DEVLINK_PARAM_GENERIC_WOL_TYPE,
2704+
},
27002705
};
27012706

27022707
static int devlink_param_generic_verify(const struct devlink_param *param)

0 commit comments

Comments
 (0)