Contributors: 8
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Vladimir Oltean |
80 |
59.26% |
4 |
30.77% |
Andrew Lunn |
33 |
24.44% |
2 |
15.38% |
Lennert Buytenhek |
7 |
5.19% |
1 |
7.69% |
Américo Wang |
6 |
4.44% |
1 |
7.69% |
Vivien Didelot |
4 |
2.96% |
2 |
15.38% |
Arjan van de Ven |
3 |
2.22% |
1 |
7.69% |
Thomas Gleixner |
1 |
0.74% |
1 |
7.69% |
Alexander Duyck |
1 |
0.74% |
1 |
7.69% |
Total |
135 |
|
13 |
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* include/net/dsa_stubs.h - Stubs for the Distributed Switch Architecture framework
*/
#include <linux/mutex.h>
#include <linux/netdevice.h>
#include <linux/net_tstamp.h>
#include <net/dsa.h>
#if IS_ENABLED(CONFIG_NET_DSA)
extern const struct dsa_stubs *dsa_stubs;
struct dsa_stubs {
int (*master_hwtstamp_validate)(struct net_device *dev,
const struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack);
};
static inline int dsa_master_hwtstamp_validate(struct net_device *dev,
const struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack)
{
if (!netdev_uses_dsa(dev))
return 0;
/* rtnl_lock() is a sufficient guarantee, because as long as
* netdev_uses_dsa() returns true, the dsa_core module is still
* registered, and so, dsa_unregister_stubs() couldn't have run.
* For netdev_uses_dsa() to start returning false, it would imply that
* dsa_master_teardown() has executed, which requires rtnl_lock().
*/
ASSERT_RTNL();
return dsa_stubs->master_hwtstamp_validate(dev, config, extack);
}
#else
static inline int dsa_master_hwtstamp_validate(struct net_device *dev,
const struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack)
{
return 0;
}
#endif