#include <linux/ethtool.h>
#include <linux/firmware.h>
#include <linux/sfp.h>
#include <net/devlink.h>
#include "netlink.h"
#include "common.h"
#include "bitset.h"
#include "module_fw.h"
struct module_req_info { … };
struct module_reply_data { … };
#define MODULE_REPDATA(__reply_base) …
const struct nla_policy ethnl_module_get_policy[ETHTOOL_A_MODULE_HEADER + 1] = …;
static int module_get_power_mode(struct net_device *dev,
struct module_reply_data *data,
struct netlink_ext_ack *extack)
{ … }
static int module_prepare_data(const struct ethnl_req_info *req_base,
struct ethnl_reply_data *reply_base,
const struct genl_info *info)
{ … }
static int module_reply_size(const struct ethnl_req_info *req_base,
const struct ethnl_reply_data *reply_base)
{ … }
static int module_fill_reply(struct sk_buff *skb,
const struct ethnl_req_info *req_base,
const struct ethnl_reply_data *reply_base)
{ … }
const struct nla_policy ethnl_module_set_policy[ETHTOOL_A_MODULE_POWER_MODE_POLICY + 1] = …;
static int
ethnl_set_module_validate(struct ethnl_req_info *req_info,
struct genl_info *info)
{ … }
static int
ethnl_set_module(struct ethnl_req_info *req_info, struct genl_info *info)
{ … }
const struct ethnl_request_ops ethnl_module_request_ops = …;
const struct nla_policy
ethnl_module_fw_flash_act_policy[ETHTOOL_A_MODULE_FW_FLASH_PASSWORD + 1] = …;
static LIST_HEAD(module_fw_flash_work_list);
static DEFINE_SPINLOCK(module_fw_flash_work_list_lock);
static int
module_flash_fw_work_list_add(struct ethtool_module_fw_flash *module_fw,
struct genl_info *info)
{ … }
static void module_flash_fw_work_list_del(struct list_head *list)
{ … }
static void module_flash_fw_work(struct work_struct *work)
{ … }
#define MODULE_EEPROM_PHYS_ID_PAGE …
#define MODULE_EEPROM_PHYS_ID_I2C_ADDR …
static int module_flash_fw_work_init(struct ethtool_module_fw_flash *module_fw,
struct net_device *dev,
struct netlink_ext_ack *extack)
{ … }
void ethnl_module_fw_flash_sock_destroy(struct ethnl_sock_priv *sk_priv)
{ … }
static int
module_flash_fw_schedule(struct net_device *dev, const char *file_name,
struct ethtool_module_fw_flash_params *params,
struct sk_buff *skb, struct genl_info *info)
{ … }
static int module_flash_fw(struct net_device *dev, struct nlattr **tb,
struct sk_buff *skb, struct genl_info *info)
{ … }
static int ethnl_module_fw_flash_validate(struct net_device *dev,
struct netlink_ext_ack *extack)
{ … }
int ethnl_act_module_fw_flash(struct sk_buff *skb, struct genl_info *info)
{ … }
static int
ethnl_module_fw_flash_ntf_put_err(struct sk_buff *skb, char *err_msg,
char *sub_err_msg)
{ … }
static void
ethnl_module_fw_flash_ntf(struct net_device *dev,
enum ethtool_module_fw_flash_status status,
struct ethnl_module_fw_flash_ntf_params *ntf_params,
char *err_msg, char *sub_err_msg,
u64 done, u64 total)
{ … }
void ethnl_module_fw_flash_ntf_err(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params,
char *err_msg, char *sub_err_msg)
{ … }
void
ethnl_module_fw_flash_ntf_start(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params)
{ … }
void
ethnl_module_fw_flash_ntf_complete(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params)
{ … }
void
ethnl_module_fw_flash_ntf_in_progress(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params,
u64 done, u64 total)
{ … }