1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* SPDX-FileCopyrightText: Copyright Red Hat */
4 #ifndef _ICE_ADAPTER_H_
5 #define _ICE_ADAPTER_H_
7 #include <linux/types.h>
8 #include <linux/spinlock_types.h>
9 #include <linux/refcount_types.h>
15 * struct ice_port_list - data used to store the list of adapter ports
17 * This structure contains data used to maintain a list of adapter ports
19 * @ports: list of ports
20 * @lock: protect access to the ports list
22 struct ice_port_list {
23 struct list_head ports;
24 /* To synchronize the ports list operations */
29 * struct ice_adapter - PCI adapter resources shared across PFs
30 * @ptp_gltsyn_time_lock: Spinlock protecting access to the GLTSYN_TIME
31 * register of the PTP clock.
32 * @refcount: Reference count. struct ice_pf objects hold the references.
33 * @ctrl_pf: Control PF of the adapter
38 /* For access to the GLTSYN_TIME register */
39 spinlock_t ptp_gltsyn_time_lock;
41 struct ice_pf *ctrl_pf;
42 struct ice_port_list ports;
45 struct ice_adapter *ice_adapter_get(const struct pci_dev *pdev);
46 void ice_adapter_put(const struct pci_dev *pdev);
48 #endif /* _ICE_ADAPTER_H */