summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.h
blob: e173155b146a8afb54b43cf4d34d3b6703822aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* SPDX-License-Identifier: GPL-2.0+ */
/* Copyright (c) 2024 Hisilicon Limited. */

#ifndef __HBG_ETHTOOL_H
#define __HBG_ETHTOOL_H

#include <linux/netdevice.h>

#define HBG_STATS_FIELD_OFF(f) (offsetof(struct hbg_stats, f))
#define HBG_STATS_R(p, offset) (*(u64 *)((u8 *)(p) + (offset)))
#define HBG_STATS_U(p, offset, val) (HBG_STATS_R(p, offset) += (val))

void hbg_ethtool_set_ops(struct net_device *netdev);
void hbg_update_stats(struct hbg_priv *priv);

#endif