devlink: Add support for 'fw_load_policy' generic parameter

Add string to uint conversion for 'fw_load_policy' generic parameter.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
Shalom Toledo 2018-12-04 10:14:08 +00:00 committed by David Ahern
parent 2557dca2b0
commit a463fd4fa4
2 changed files with 17 additions and 1 deletions

View File

@ -1972,7 +1972,18 @@ param_val_conv_str_get(const struct param_val_conv *param_val_conv,
return -ENOENT;
}
static const struct param_val_conv param_val_conv[] = {};
static const struct param_val_conv param_val_conv[] = {
{
.name = "fw_load_policy",
.vstr = "driver",
.vuint = DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
},
{
.name = "fw_load_policy",
.vstr = "flash",
.vuint = DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
},
};
#define PARAM_VAL_CONV_LEN ARRAY_SIZE(param_val_conv)

View File

@ -163,6 +163,11 @@ enum devlink_param_cmode {
DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1
};
enum devlink_param_fw_load_policy_value {
DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
};
enum devlink_attr {
/* don't change the order or add anything between, this is ABI! */
DEVLINK_ATTR_UNSPEC,