Commit 012f394c authored by Uma Krishnan's avatar Uma Krishnan Committed by Martin K. Petersen

scsi: cxlflash: Support process specific mappings

Once the context is started, the assigned MMIO space can be mapped and
unmapped. Provide means to map and unmap the context MMIO space.
Signed-off-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6b938ac9
...@@ -150,6 +150,28 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name, ...@@ -150,6 +150,28 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name,
goto out; goto out;
} }
/**
* ocxlflash_psa_map() - map the process specific MMIO space
* @ctx_cookie: Adapter context for which the mapping needs to be done.
*
* Return: MMIO pointer of the mapped region
*/
static void __iomem *ocxlflash_psa_map(void *ctx_cookie)
{
struct ocxlflash_context *ctx = ctx_cookie;
return ioremap(ctx->psn_phys, ctx->psn_size);
}
/**
* ocxlflash_psa_unmap() - unmap the process specific MMIO space
* @addr: MMIO pointer to unmap.
*/
static void ocxlflash_psa_unmap(void __iomem *addr)
{
iounmap(addr);
}
/** /**
* ocxlflash_process_element() - get process element of the adapter context * ocxlflash_process_element() - get process element of the adapter context
* @ctx_cookie: Adapter context associated with the process element. * @ctx_cookie: Adapter context associated with the process element.
...@@ -618,6 +640,8 @@ static void *ocxlflash_fops_get_context(struct file *file) ...@@ -618,6 +640,8 @@ static void *ocxlflash_fops_get_context(struct file *file)
/* Backend ops to ocxlflash services */ /* Backend ops to ocxlflash services */
const struct cxlflash_backend_ops cxlflash_ocxl_ops = { const struct cxlflash_backend_ops cxlflash_ocxl_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.psa_map = ocxlflash_psa_map,
.psa_unmap = ocxlflash_psa_unmap,
.process_element = ocxlflash_process_element, .process_element = ocxlflash_process_element,
.start_context = ocxlflash_start_context, .start_context = ocxlflash_start_context,
.set_master = ocxlflash_set_master, .set_master = ocxlflash_set_master,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment