Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * CXL Flash Device Driver
0004  *
0005  * Written by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation
0006  *             Uma Krishnan <ukrishn@linux.vnet.ibm.com>, IBM Corporation
0007  *
0008  * Copyright (C) 2018 IBM Corporation
0009  */
0010 
0011 #ifndef _CXLFLASH_BACKEND_H
0012 #define _CXLFLASH_BACKEND_H
0013 
0014 extern const struct cxlflash_backend_ops cxlflash_cxl_ops;
0015 extern const struct cxlflash_backend_ops cxlflash_ocxl_ops;
0016 
0017 struct cxlflash_backend_ops {
0018     struct module *module;
0019     void __iomem * (*psa_map)(void *ctx_cookie);
0020     void (*psa_unmap)(void __iomem *addr);
0021     int (*process_element)(void *ctx_cookie);
0022     int (*map_afu_irq)(void *ctx_cookie, int num, irq_handler_t handler,
0023                void *cookie, char *name);
0024     void (*unmap_afu_irq)(void *ctx_cookie, int num, void *cookie);
0025     u64 (*get_irq_objhndl)(void *ctx_cookie, int irq);
0026     int (*start_context)(void *ctx_cookie);
0027     int (*stop_context)(void *ctx_cookie);
0028     int (*afu_reset)(void *ctx_cookie);
0029     void (*set_master)(void *ctx_cookie);
0030     void * (*get_context)(struct pci_dev *dev, void *afu_cookie);
0031     void * (*dev_context_init)(struct pci_dev *dev, void *afu_cookie);
0032     int (*release_context)(void *ctx_cookie);
0033     void (*perst_reloads_same_image)(void *afu_cookie, bool image);
0034     ssize_t (*read_adapter_vpd)(struct pci_dev *dev, void *buf,
0035                     size_t count);
0036     int (*allocate_afu_irqs)(void *ctx_cookie, int num);
0037     void (*free_afu_irqs)(void *ctx_cookie);
0038     void * (*create_afu)(struct pci_dev *dev);
0039     void (*destroy_afu)(void *afu_cookie);
0040     struct file * (*get_fd)(void *ctx_cookie, struct file_operations *fops,
0041                 int *fd);
0042     void * (*fops_get_context)(struct file *file);
0043     int (*start_work)(void *ctx_cookie, u64 irqs);
0044     int (*fd_mmap)(struct file *file, struct vm_area_struct *vm);
0045     int (*fd_release)(struct inode *inode, struct file *file);
0046 };
0047 
0048 #endif /* _CXLFLASH_BACKEND_H */