#include <net/sock.h>
#include <linux/ethtool_netlink.h>
#include <linux/pm_runtime.h>
#include "netlink.h"
#include "module_fw.h"
static struct genl_family ethtool_genl_family;
static bool ethnl_ok __read_mostly;
static u32 ethnl_bcast_seq;
#define ETHTOOL_FLAGS_BASIC …
#define ETHTOOL_FLAGS_STATS …
const struct nla_policy ethnl_header_policy[] = …;
const struct nla_policy ethnl_header_policy_stats[] = …;
int ethnl_sock_priv_set(struct sk_buff *skb, struct net_device *dev, u32 portid,
enum ethnl_sock_type type)
{ … }
static void ethnl_sock_priv_destroy(void *priv)
{ … }
int ethnl_ops_begin(struct net_device *dev)
{ … }
void ethnl_ops_complete(struct net_device *dev)
{ … }
int ethnl_parse_header_dev_get(struct ethnl_req_info *req_info,
const struct nlattr *header, struct net *net,
struct netlink_ext_ack *extack, bool require_dev)
{ … }
int ethnl_fill_reply_header(struct sk_buff *skb, struct net_device *dev,
u16 attrtype)
{ … }
struct sk_buff *ethnl_reply_init(size_t payload, struct net_device *dev, u8 cmd,
u16 hdr_attrtype, struct genl_info *info,
void **ehdrp)
{ … }
void *ethnl_dump_put(struct sk_buff *skb, struct netlink_callback *cb, u8 cmd)
{ … }
void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd)
{ … }
void *ethnl_unicast_put(struct sk_buff *skb, u32 portid, u32 seq, u8 cmd)
{ … }
int ethnl_multicast(struct sk_buff *skb, struct net_device *dev)
{ … }
struct ethnl_dump_ctx { … };
static const struct ethnl_request_ops *
ethnl_default_requests[__ETHTOOL_MSG_USER_CNT] = …;
static struct ethnl_dump_ctx *ethnl_dump_context(struct netlink_callback *cb)
{ … }
static int ethnl_default_parse(struct ethnl_req_info *req_info,
const struct genl_info *info,
const struct ethnl_request_ops *request_ops,
bool require_dev)
{ … }
static void ethnl_init_reply_data(struct ethnl_reply_data *reply_data,
const struct ethnl_request_ops *ops,
struct net_device *dev)
{ … }
static int ethnl_default_doit(struct sk_buff *skb, struct genl_info *info)
{ … }
static int ethnl_default_dump_one(struct sk_buff *skb, struct net_device *dev,
const struct ethnl_dump_ctx *ctx,
const struct genl_info *info)
{ … }
static int ethnl_default_dumpit(struct sk_buff *skb,
struct netlink_callback *cb)
{ … }
static int ethnl_default_start(struct netlink_callback *cb)
{ … }
static int ethnl_default_done(struct netlink_callback *cb)
{ … }
static int ethnl_default_set_doit(struct sk_buff *skb, struct genl_info *info)
{ … }
static const struct ethnl_request_ops *
ethnl_default_notify_ops[ETHTOOL_MSG_KERNEL_MAX + 1] = …;
static void ethnl_default_notify(struct net_device *dev, unsigned int cmd,
const void *data)
{ … }
ethnl_notify_handler_t;
static const ethnl_notify_handler_t ethnl_notify_handlers[] = …;
void ethtool_notify(struct net_device *dev, unsigned int cmd, const void *data)
{ … }
EXPORT_SYMBOL(…);
static void ethnl_notify_features(struct netdev_notifier_info *info)
{ … }
static int ethnl_netdev_event(struct notifier_block *this, unsigned long event,
void *ptr)
{ … }
static struct notifier_block ethnl_netdev_notifier = …;
static const struct genl_ops ethtool_genl_ops[] = …;
static const struct genl_multicast_group ethtool_nl_mcgrps[] = …;
static struct genl_family ethtool_genl_family __ro_after_init = …;
static int __init ethnl_init(void)
{ … }
subsys_initcall(ethnl_init);