| 1 |
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ |
| 2 |
/* |
| 3 |
* Copyright 2015-2022 Amazon.com, Inc. or its affiliates. All rights reserved. |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef ENA_PHC_H |
| 7 |
#define ENA_PHC_H |
| 8 |
|
| 9 |
#include <linux/ptp_clock_kernel.h> |
| 10 |
|
| 11 |
struct ena_phc_info { |
| 12 |
/* PTP hardware capabilities */ |
| 13 |
struct ptp_clock_info clock_info; |
| 14 |
|
| 15 |
/* Registered PTP clock device */ |
| 16 |
struct ptp_clock *clock; |
| 17 |
|
| 18 |
/* Adapter specific private data structure */ |
| 19 |
struct ena_adapter *adapter; |
| 20 |
|
| 21 |
/* PHC lock */ |
| 22 |
spinlock_t lock; |
| 23 |
|
| 24 |
/* Enabled by kernel */ |
| 25 |
bool enabled; |
| 26 |
}; |
| 27 |
|
| 28 |
void ena_phc_enable(struct ena_adapter *adapter, bool enable); |
| 29 |
bool ena_phc_is_enabled(struct ena_adapter *adapter); |
| 30 |
bool ena_phc_is_active(struct ena_adapter *adapter); |
| 31 |
int ena_phc_get_index(struct ena_adapter *adapter); |
| 32 |
int ena_phc_init(struct ena_adapter *adapter); |
| 33 |
void ena_phc_destroy(struct ena_adapter *adapter); |
| 34 |
int ena_phc_alloc(struct ena_adapter *adapter); |
| 35 |
void ena_phc_free(struct ena_adapter *adapter); |
| 36 |
|
| 37 |
#endif /* ENA_PHC_H */ |