1 /* 2 * CXL Flash Device Driver 3 * 4 * Written by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation 5 * Uma Krishnan <ukrishn@linux.vnet.ibm.com>, IBM Corporation 6 * 7 * Copyright (C) 2018 IBM Corporation 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License 11 * as published by the Free Software Foundation; either version 12 * 2 of the License, or (at your option) any later version. 13 */ 14 15 extern const struct cxlflash_backend_ops cxlflash_cxl_ops; 16 17 struct cxlflash_backend_ops { 18 struct module *module; 19 void __iomem * (*psa_map)(void *); 20 void (*psa_unmap)(void __iomem *); 21 int (*process_element)(void *); 22 int (*map_afu_irq)(void *, int, irq_handler_t, void *, char *); 23 void (*unmap_afu_irq)(void *, int, void *); 24 int (*start_context)(void *); 25 int (*stop_context)(void *); 26 int (*afu_reset)(void *); 27 void (*set_master)(void *); 28 void * (*get_context)(struct pci_dev *, void *); 29 void * (*dev_context_init)(struct pci_dev *, void *); 30 int (*release_context)(void *); 31 void (*perst_reloads_same_image)(void *, bool); 32 ssize_t (*read_adapter_vpd)(struct pci_dev *, void *, size_t); 33 int (*allocate_afu_irqs)(void *, int); 34 void (*free_afu_irqs)(void *); 35 void * (*create_afu)(struct pci_dev *); 36 struct file * (*get_fd)(void *, struct file_operations *, int *); 37 void * (*fops_get_context)(struct file *); 38 int (*start_work)(void *, u64); 39 int (*fd_mmap)(struct file *, struct vm_area_struct *); 40 int (*fd_release)(struct inode *, struct file *); 41 }; 42