-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathena_phc.h
More file actions
54 lines (44 loc) · 1.79 KB
/
Copy pathena_phc.h
File metadata and controls
54 lines (44 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) Amazon.com, Inc. or its affiliates.
* All rights reserved.
*/
#ifndef ENA_PHC_H
#define ENA_PHC_H
#ifdef ENA_PHC_SUPPORT
#include <linux/ptp_clock_kernel.h>
struct ena_phc_info {
/* PTP hardware capabilities */
struct ptp_clock_info clock_info;
/* Registered PTP clock device */
struct ptp_clock *clock;
/* Adapter specific private data structure */
struct ena_adapter *adapter;
/* PHC lock */
spinlock_t lock;
/* Enabled by kernel */
bool enabled;
};
void ena_phc_enable(struct ena_adapter *adapter, bool enable);
bool ena_phc_is_enabled(struct ena_adapter *adapter);
bool ena_phc_is_active(struct ena_adapter *adapter);
int ena_phc_get_index(struct ena_adapter *adapter);
int ena_phc_init(struct ena_adapter *adapter);
void ena_phc_destroy(struct ena_adapter *adapter);
int ena_phc_alloc(struct ena_adapter *adapter);
void ena_phc_free(struct ena_adapter *adapter);
int ena_phc_get_error_bound(struct ena_adapter *adapter, u32 *error_bound);
#else /* ENA_PHC_SUPPORT */
static inline void ena_phc_enable(struct ena_adapter *adapter, bool enable) { }
static inline bool ena_phc_is_enabled(struct ena_adapter *adapter) { return false; }
static inline bool ena_phc_is_active(struct ena_adapter *adapter) { return false; }
static inline int ena_phc_get_index(struct ena_adapter *adapter) { return -1; }
static inline int ena_phc_init(struct ena_adapter *adapter) { return 0; }
static inline void ena_phc_destroy(struct ena_adapter *adapter) { }
static inline int ena_phc_alloc(struct ena_adapter *adapter) { return 0; }
static inline void ena_phc_free(struct ena_adapter *adapter) { }
static inline int ena_phc_get_error_bound(struct ena_adapter *adapter, u32 *error_bound)
{
return 0;
}
#endif /* ENA_PHC_SUPPORT */
#endif /* ENA_PHC_H */