diff options
author | Ian Munsie | 2016-07-14 07:17:04 +1000 |
---|---|---|
committer | Michael Ellerman | 2016-07-14 20:26:52 +1000 |
commit | a19bd79e31769626d288cc016e21a31b6f47bf6f (patch) | |
tree | da10b02e662c4541f75db8ded6ca65bc76efe3c5 /include/misc/cxl-base.h | |
parent | 62ccf2d2efefa01d0eb92cd6ecbb45ea0499fb1c (diff) |
cxl: Allow a default context to be associated with an external pci_dev
The cxl kernel API has a concept of a default context associated with
each PCI device under the virtual PHB. The Mellanox CX4 will also use
the cxl kernel API, but it does not use a virtual PHB - rather, the AFU
appears as a physical function as a peer to the networking functions.
In order to allow the kernel API to work with those networking
functions, we will need to associate a default context with them as
well. To this end, refactor the corresponding code to do this in vphb.c
and export it so that it can be called from the PHB code.
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'include/misc/cxl-base.h')
-rw-r--r-- | include/misc/cxl-base.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/misc/cxl-base.h b/include/misc/cxl-base.h index f53808fa638a..bb7e629ae492 100644 --- a/include/misc/cxl-base.h +++ b/include/misc/cxl-base.h @@ -10,6 +10,8 @@ #ifndef _MISC_CXL_BASE_H #define _MISC_CXL_BASE_H +#include <misc/cxl.h> + #ifdef CONFIG_CXL_BASE #define CXL_IRQ_RANGES 4 @@ -39,6 +41,8 @@ static inline void cxl_ctx_put(void) struct cxl_afu *cxl_afu_get(struct cxl_afu *afu); void cxl_afu_put(struct cxl_afu *afu); void cxl_slbia(struct mm_struct *mm); +bool cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu); +void cxl_pci_disable_device(struct pci_dev *dev); #else /* CONFIG_CXL_BASE */ @@ -46,6 +50,8 @@ static inline bool cxl_ctx_in_use(void) { return false; } static inline struct cxl_afu *cxl_afu_get(struct cxl_afu *afu) { return NULL; } static inline void cxl_afu_put(struct cxl_afu *afu) {} static inline void cxl_slbia(struct mm_struct *mm) {} +static inline bool cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu) { return false; } +static inline void cxl_pci_disable_device(struct pci_dev *dev) {} #endif /* CONFIG_CXL_BASE */ |