xref: /openbmc/linux/drivers/net/wireless/ath/ath11k/pci.h (revision 1399fb87)
15762613eSGovind Singh /* SPDX-License-Identifier: BSD-3-Clause-Clear */
25762613eSGovind Singh /*
35762613eSGovind Singh  * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
45762613eSGovind Singh  */
51399fb87SGovind Singh #ifndef _ATH11K_PCI_H
61399fb87SGovind Singh #define _ATH11K_PCI_H
71399fb87SGovind Singh 
81399fb87SGovind Singh #include <linux/mhi.h>
95762613eSGovind Singh 
105762613eSGovind Singh #include "core.h"
115762613eSGovind Singh 
125697a564SGovind Singh struct ath11k_msi_user {
135697a564SGovind Singh 	char *name;
145697a564SGovind Singh 	int num_vectors;
155697a564SGovind Singh 	u32 base_vector;
165697a564SGovind Singh };
175697a564SGovind Singh 
185697a564SGovind Singh struct ath11k_msi_config {
195697a564SGovind Singh 	int total_vectors;
205697a564SGovind Singh 	int total_users;
215697a564SGovind Singh 	struct ath11k_msi_user *users;
225697a564SGovind Singh };
235697a564SGovind Singh 
245762613eSGovind Singh struct ath11k_pci {
255762613eSGovind Singh 	struct pci_dev *pdev;
265762613eSGovind Singh 	struct ath11k_base *ab;
275762613eSGovind Singh 	u16 dev_id;
281399fb87SGovind Singh 	char amss_path[100];
295697a564SGovind Singh 	u32 msi_ep_base_data;
301399fb87SGovind Singh 	struct mhi_controller *mhi_ctrl;
311399fb87SGovind Singh 	unsigned long mhi_state;
325762613eSGovind Singh };
335762613eSGovind Singh 
345762613eSGovind Singh static inline struct ath11k_pci *ath11k_pci_priv(struct ath11k_base *ab)
355762613eSGovind Singh {
365762613eSGovind Singh 	return (struct ath11k_pci *)ab->drv_priv;
375762613eSGovind Singh }
381399fb87SGovind Singh 
391399fb87SGovind Singh int ath11k_pci_get_user_msi_assignment(struct ath11k_pci *ar_pci, char *user_name,
401399fb87SGovind Singh 				       int *num_vectors, u32 *user_base_data,
411399fb87SGovind Singh 				       u32 *base_vector);
421399fb87SGovind Singh int ath11k_pci_get_msi_irq(struct device *dev, unsigned int vector);
431399fb87SGovind Singh 
441399fb87SGovind Singh #endif
45