linux/net/devlink/dev.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 <linux/device.h>
#include <net/genetlink.h>
#include <net/sock.h>
#include "devl_internal.h"

struct devlink_info_req {};

struct devlink_reload_combination {};

static const struct devlink_reload_combination devlink_reload_invalid_combinations[] =;

static bool
devlink_reload_combination_is_invalid(enum devlink_reload_action action,
				      enum devlink_reload_limit limit)
{}

static bool
devlink_reload_action_is_supported(struct devlink *devlink, enum devlink_reload_action action)
{}

static bool
devlink_reload_limit_is_supported(struct devlink *devlink, enum devlink_reload_limit limit)
{}

static int devlink_reload_stat_put(struct sk_buff *msg,
				   enum devlink_reload_limit limit, u32 value)
{}

static int
devlink_reload_stats_put(struct sk_buff *msg, struct devlink *devlink, bool is_remote)
{}

static int devlink_nl_nested_fill(struct sk_buff *msg, struct devlink *devlink)
{}

static int devlink_nl_fill(struct sk_buff *msg, struct devlink *devlink,
			   enum devlink_command cmd, u32 portid,
			   u32 seq, int flags)
{}

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

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

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

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

static void devlink_rel_notify_cb(struct devlink *devlink, u32 obj_index)
{}

static void devlink_rel_cleanup_cb(struct devlink *devlink, u32 obj_index,
				   u32 rel_index)
{}

int devl_nested_devlink_set(struct devlink *devlink,
			    struct devlink *nested_devlink)
{}
EXPORT_SYMBOL_GPL();

void devlink_notify_register(struct devlink *devlink)
{}

void devlink_notify_unregister(struct devlink *devlink)
{}

static void devlink_reload_failed_set(struct devlink *devlink,
				      bool reload_failed)
{}

bool devlink_is_reload_failed(const struct devlink *devlink)
{}
EXPORT_SYMBOL_GPL();

static void
__devlink_reload_stats_update(struct devlink *devlink, u32 *reload_stats,
			      enum devlink_reload_limit limit, u32 actions_performed)
{}

static void
devlink_reload_stats_update(struct devlink *devlink, enum devlink_reload_limit limit,
			    u32 actions_performed)
{}

/**
 *	devlink_remote_reload_actions_performed - Update devlink on reload actions
 *	  performed which are not a direct result of devlink reload call.
 *
 *	This should be called by a driver after performing reload actions in case it was not
 *	a result of devlink reload call. For example fw_activate was performed as a result
 *	of devlink reload triggered fw_activate on another host.
 *	The motivation for this function is to keep data on reload actions performed on this
 *	function whether it was done due to direct devlink reload call or not.
 *
 *	@devlink: devlink
 *	@limit: reload limit
 *	@actions_performed: bitmask of actions performed
 */
void devlink_remote_reload_actions_performed(struct devlink *devlink,
					     enum devlink_reload_limit limit,
					     u32 actions_performed)
{}
EXPORT_SYMBOL_GPL();

static struct net *devlink_netns_get(struct sk_buff *skb,
				     struct genl_info *info)
{}

static void devlink_reload_netns_change(struct devlink *devlink,
					struct net *curr_net,
					struct net *dest_net)
{}

static void devlink_reload_reinit_sanity_check(struct devlink *devlink)
{}

int devlink_reload(struct devlink *devlink, struct net *dest_net,
		   enum devlink_reload_action action,
		   enum devlink_reload_limit limit,
		   u32 *actions_performed, struct netlink_ext_ack *extack)
{}

static int
devlink_nl_reload_actions_performed_snd(struct devlink *devlink, u32 actions_performed,
					enum devlink_command cmd, struct genl_info *info)
{}

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

bool devlink_reload_actions_valid(const struct devlink_ops *ops)
{}

static int devlink_nl_eswitch_fill(struct sk_buff *msg, struct devlink *devlink,
				   enum devlink_command cmd, u32 portid,
				   u32 seq, int flags)
{}

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

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

int devlink_info_serial_number_put(struct devlink_info_req *req, const char *sn)
{}
EXPORT_SYMBOL_GPL();

int devlink_info_board_serial_number_put(struct devlink_info_req *req,
					 const char *bsn)
{}
EXPORT_SYMBOL_GPL();

static int devlink_info_version_put(struct devlink_info_req *req, int attr,
				    const char *version_name,
				    const char *version_value,
				    enum devlink_info_version_type version_type)
{}

int devlink_info_version_fixed_put(struct devlink_info_req *req,
				   const char *version_name,
				   const char *version_value)
{}
EXPORT_SYMBOL_GPL();

int devlink_info_version_stored_put(struct devlink_info_req *req,
				    const char *version_name,
				    const char *version_value)
{}
EXPORT_SYMBOL_GPL();

int devlink_info_version_stored_put_ext(struct devlink_info_req *req,
					const char *version_name,
					const char *version_value,
					enum devlink_info_version_type version_type)
{}
EXPORT_SYMBOL_GPL();

int devlink_info_version_running_put(struct devlink_info_req *req,
				     const char *version_name,
				     const char *version_value)
{}
EXPORT_SYMBOL_GPL();

int devlink_info_version_running_put_ext(struct devlink_info_req *req,
					 const char *version_name,
					 const char *version_value,
					 enum devlink_info_version_type version_type)
{}
EXPORT_SYMBOL_GPL();

static int devlink_nl_driver_info_get(struct device_driver *drv,
				      struct devlink_info_req *req)
{}

static int
devlink_nl_info_fill(struct sk_buff *msg, struct devlink *devlink,
		     enum devlink_command cmd, u32 portid,
		     u32 seq, int flags, struct netlink_ext_ack *extack)
{}

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

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

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

static int devlink_nl_flash_update_fill(struct sk_buff *msg,
					struct devlink *devlink,
					enum devlink_command cmd,
					struct devlink_flash_notify *params)
{}

static void __devlink_flash_update_notify(struct devlink *devlink,
					  enum devlink_command cmd,
					  struct devlink_flash_notify *params)
{}

static void devlink_flash_update_begin_notify(struct devlink *devlink)
{}

static void devlink_flash_update_end_notify(struct devlink *devlink)
{}

void devlink_flash_update_status_notify(struct devlink *devlink,
					const char *status_msg,
					const char *component,
					unsigned long done,
					unsigned long total)
{}
EXPORT_SYMBOL_GPL();

void devlink_flash_update_timeout_notify(struct devlink *devlink,
					 const char *status_msg,
					 const char *component,
					 unsigned long timeout)
{}
EXPORT_SYMBOL_GPL();

struct devlink_flash_component_lookup_ctx {};

static void
devlink_flash_component_lookup_cb(const char *version_name,
				  enum devlink_info_version_type version_type,
				  void *version_cb_priv)
{}

static int devlink_flash_component_get(struct devlink *devlink,
				       struct nlattr *nla_component,
				       const char **p_component,
				       struct netlink_ext_ack *extack)
{}

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

static void __devlink_compat_running_version(struct devlink *devlink,
					     char *buf, size_t len)
{}

void devlink_compat_running_version(struct devlink *devlink,
				    char *buf, size_t len)
{}

int devlink_compat_flash_update(struct devlink *devlink, const char *file_name)
{}

static int
devlink_nl_selftests_fill(struct sk_buff *msg, struct devlink *devlink,
			  u32 portid, u32 seq, int flags,
			  struct netlink_ext_ack *extack)
{}

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

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

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

static int devlink_selftest_result_put(struct sk_buff *skb, unsigned int id,
				       enum devlink_selftest_status test_status)
{}

static const struct nla_policy devlink_selftest_nl_policy[DEVLINK_ATTR_SELFTEST_ID_MAX + 1] =;

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