linux/net/devlink/param.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2016 Mellanox Technologies. All rights reserved.
 * Copyright (c) 2016 Jiri Pirko <[email protected]>
 */

#include "devl_internal.h"

static const struct devlink_param devlink_param_generic[] =;

static int devlink_param_generic_verify(const struct devlink_param *param)
{}

static int devlink_param_driver_verify(const struct devlink_param *param)
{}

static struct devlink_param_item *
devlink_param_find_by_name(struct xarray *params, const char *param_name)
{}

static struct devlink_param_item *
devlink_param_find_by_id(struct xarray *params, u32 param_id)
{}

static bool
devlink_param_cmode_is_supported(const struct devlink_param *param,
				 enum devlink_param_cmode cmode)
{}

static int devlink_param_get(struct devlink *devlink,
			     const struct devlink_param *param,
			     struct devlink_param_gset_ctx *ctx)
{}

static int devlink_param_set(struct devlink *devlink,
			     const struct devlink_param *param,
			     struct devlink_param_gset_ctx *ctx,
			     struct netlink_ext_ack *extack)
{}

static int
devlink_param_type_to_nla_type(enum devlink_param_type param_type)
{}

static int
devlink_nl_param_value_fill_one(struct sk_buff *msg,
				enum devlink_param_type type,
				enum devlink_param_cmode cmode,
				union devlink_param_value val)
{}

static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
				 unsigned int port_index,
				 struct devlink_param_item *param_item,
				 enum devlink_command cmd,
				 u32 portid, u32 seq, int flags)
{}

static void devlink_param_notify(struct devlink *devlink,
				 unsigned int port_index,
				 struct devlink_param_item *param_item,
				 enum devlink_command cmd)
{}

static void devlink_params_notify(struct devlink *devlink,
				  enum devlink_command cmd)
{}

void devlink_params_notify_register(struct devlink *devlink)
{}

void devlink_params_notify_unregister(struct devlink *devlink)
{}

static int devlink_nl_param_get_dump_one(struct sk_buff *msg,
					 struct devlink *devlink,
					 struct netlink_callback *cb,
					 int flags)
{}

int devlink_nl_param_get_dumpit(struct sk_buff *skb,
				struct netlink_callback *cb)
{}

static int
devlink_param_type_get_from_info(struct genl_info *info,
				 enum devlink_param_type *param_type)
{}

static int
devlink_param_value_get_from_info(const struct devlink_param *param,
				  struct genl_info *info,
				  union devlink_param_value *value)
{}

static struct devlink_param_item *
devlink_param_get_from_info(struct xarray *params, struct genl_info *info)
{}

int devlink_nl_param_get_doit(struct sk_buff *skb,
			      struct genl_info *info)
{}

static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink,
					   unsigned int port_index,
					   struct xarray *params,
					   struct genl_info *info,
					   enum devlink_command cmd)
{}

int devlink_nl_param_set_doit(struct sk_buff *skb, struct genl_info *info)
{}

int devlink_nl_port_param_get_dumpit(struct sk_buff *msg,
				     struct netlink_callback *cb)
{}

int devlink_nl_port_param_get_doit(struct sk_buff *skb,
				   struct genl_info *info)
{}

int devlink_nl_port_param_set_doit(struct sk_buff *skb,
				   struct genl_info *info)
{}

static int devlink_param_verify(const struct devlink_param *param)
{}

static int devlink_param_register(struct devlink *devlink,
				  const struct devlink_param *param)
{}

static void devlink_param_unregister(struct devlink *devlink,
				     const struct devlink_param *param)
{}

/**
 *	devl_params_register - register configuration parameters
 *
 *	@devlink: devlink
 *	@params: configuration parameters array
 *	@params_count: number of parameters provided
 *
 *	Register the configuration parameters supported by the driver.
 */
int devl_params_register(struct devlink *devlink,
			 const struct devlink_param *params,
			 size_t params_count)
{}
EXPORT_SYMBOL_GPL();

int devlink_params_register(struct devlink *devlink,
			    const struct devlink_param *params,
			    size_t params_count)
{}
EXPORT_SYMBOL_GPL();

/**
 *	devl_params_unregister - unregister configuration parameters
 *	@devlink: devlink
 *	@params: configuration parameters to unregister
 *	@params_count: number of parameters provided
 */
void devl_params_unregister(struct devlink *devlink,
			    const struct devlink_param *params,
			    size_t params_count)
{}
EXPORT_SYMBOL_GPL();

void devlink_params_unregister(struct devlink *devlink,
			       const struct devlink_param *params,
			       size_t params_count)
{}
EXPORT_SYMBOL_GPL();

/**
 *	devl_param_driverinit_value_get - get configuration parameter
 *					  value for driver initializing
 *
 *	@devlink: devlink
 *	@param_id: parameter ID
 *	@val: pointer to store the value of parameter in driverinit
 *	      configuration mode
 *
 *	This function should be used by the driver to get driverinit
 *	configuration for initialization after reload command.
 *
 *	Note that lockless call of this function relies on the
 *	driver to maintain following basic sane behavior:
 *	1) Driver ensures a call to this function cannot race with
 *	   registering/unregistering the parameter with the same parameter ID.
 *	2) Driver ensures a call to this function cannot race with
 *	   devl_param_driverinit_value_set() call with the same parameter ID.
 *	3) Driver ensures a call to this function cannot race with
 *	   reload operation.
 *	If the driver is not able to comply, it has to take the devlink->lock
 *	while calling this.
 */
int devl_param_driverinit_value_get(struct devlink *devlink, u32 param_id,
				    union devlink_param_value *val)
{}
EXPORT_SYMBOL_GPL();

/**
 *	devl_param_driverinit_value_set - set value of configuration
 *					  parameter for driverinit
 *					  configuration mode
 *
 *	@devlink: devlink
 *	@param_id: parameter ID
 *	@init_val: value of parameter to set for driverinit configuration mode
 *
 *	This function should be used by the driver to set driverinit
 *	configuration mode default value.
 */
void devl_param_driverinit_value_set(struct devlink *devlink, u32 param_id,
				     union devlink_param_value init_val)
{}
EXPORT_SYMBOL_GPL();

void devlink_params_driverinit_load_new(struct devlink *devlink)
{}

/**
 *	devl_param_value_changed - notify devlink on a parameter's value
 *				   change. Should be called by the driver
 *				   right after the change.
 *
 *	@devlink: devlink
 *	@param_id: parameter ID
 *
 *	This function should be used by the driver to notify devlink on value
 *	change, excluding driverinit configuration mode.
 *	For driverinit configuration mode driver should use the function
 */
void devl_param_value_changed(struct devlink *devlink, u32 param_id)
{}
EXPORT_SYMBOL_GPL();