xref: /linux/net/ethtool/ts.h (revision 0e59523b440c90ed1899476f32ad4e949282f43e)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _NET_ETHTOOL_TS_H
4 #define _NET_ETHTOOL_TS_H
5 
6 #include "netlink.h"
7 
8 /* phc_index is an int and -1 means no PHC, so keep the request non-negative */
9 static const struct netlink_range_validation ethnl_ts_prov_index_range = {
10 	.max = INT_MAX,
11 };
12 
13 static const struct nla_policy
14 ethnl_ts_hwtst_prov_policy[ETHTOOL_A_TS_HWTSTAMP_PROVIDER_MAX + 1] = {
15 	[ETHTOOL_A_TS_HWTSTAMP_PROVIDER_INDEX] =
16 		NLA_POLICY_FULL_RANGE(NLA_U32, &ethnl_ts_prov_index_range),
17 	[ETHTOOL_A_TS_HWTSTAMP_PROVIDER_QUALIFIER] =
18 		NLA_POLICY_MAX(NLA_U32, HWTSTAMP_PROVIDER_QUALIFIER_CNT - 1)
19 };
20 
21 int ts_parse_hwtst_provider(const struct nlattr *nest,
22 			    struct hwtstamp_provider_desc *hwprov_desc,
23 			    struct netlink_ext_ack *extack,
24 			    bool *mod);
25 
26 #endif /* _NET_ETHTOOL_TS_H */
27