Commit 3b225cd3 authored by Matthew R. Ochs's avatar Matthew R. Ochs Committed by Martin K. Petersen

scsi: cxlflash: Update sysfs helper routines to pass config structure

As staging for future function, pass the config pointer instead of the AFU
pointer for port-related sysfs helper routines.
Signed-off-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent cba06e6d
...@@ -2058,13 +2058,16 @@ static int cxlflash_change_queue_depth(struct scsi_device *sdev, int qdepth) ...@@ -2058,13 +2058,16 @@ static int cxlflash_change_queue_depth(struct scsi_device *sdev, int qdepth)
/** /**
* cxlflash_show_port_status() - queries and presents the current port status * cxlflash_show_port_status() - queries and presents the current port status
* @port: Desired port for status reporting. * @port: Desired port for status reporting.
* @afu: AFU owning the specified port. * @cfg: Internal structure associated with the host.
* @buf: Buffer of length PAGE_SIZE to report back port status in ASCII. * @buf: Buffer of length PAGE_SIZE to report back port status in ASCII.
* *
* Return: The size of the ASCII string returned in @buf. * Return: The size of the ASCII string returned in @buf.
*/ */
static ssize_t cxlflash_show_port_status(u32 port, struct afu *afu, char *buf) static ssize_t cxlflash_show_port_status(u32 port,
struct cxlflash_cfg *cfg,
char *buf)
{ {
struct afu *afu = cfg->afu;
char *disp_status; char *disp_status;
u64 status; u64 status;
__be64 __iomem *fc_regs; __be64 __iomem *fc_regs;
...@@ -2099,9 +2102,8 @@ static ssize_t port0_show(struct device *dev, ...@@ -2099,9 +2102,8 @@ static ssize_t port0_show(struct device *dev,
char *buf) char *buf)
{ {
struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev)); struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev));
struct afu *afu = cfg->afu;
return cxlflash_show_port_status(0, afu, buf); return cxlflash_show_port_status(0, cfg, buf);
} }
/** /**
...@@ -2117,9 +2119,8 @@ static ssize_t port1_show(struct device *dev, ...@@ -2117,9 +2119,8 @@ static ssize_t port1_show(struct device *dev,
char *buf) char *buf)
{ {
struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev)); struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev));
struct afu *afu = cfg->afu;
return cxlflash_show_port_status(1, afu, buf); return cxlflash_show_port_status(1, cfg, buf);
} }
/** /**
...@@ -2208,15 +2209,16 @@ static ssize_t ioctl_version_show(struct device *dev, ...@@ -2208,15 +2209,16 @@ static ssize_t ioctl_version_show(struct device *dev,
/** /**
* cxlflash_show_port_lun_table() - queries and presents the port LUN table * cxlflash_show_port_lun_table() - queries and presents the port LUN table
* @port: Desired port for status reporting. * @port: Desired port for status reporting.
* @afu: AFU owning the specified port. * @cfg: Internal structure associated with the host.
* @buf: Buffer of length PAGE_SIZE to report back port status in ASCII. * @buf: Buffer of length PAGE_SIZE to report back port status in ASCII.
* *
* Return: The size of the ASCII string returned in @buf. * Return: The size of the ASCII string returned in @buf.
*/ */
static ssize_t cxlflash_show_port_lun_table(u32 port, static ssize_t cxlflash_show_port_lun_table(u32 port,
struct afu *afu, struct cxlflash_cfg *cfg,
char *buf) char *buf)
{ {
struct afu *afu = cfg->afu;
int i; int i;
ssize_t bytes = 0; ssize_t bytes = 0;
__be64 __iomem *fc_port; __be64 __iomem *fc_port;
...@@ -2245,9 +2247,8 @@ static ssize_t port0_lun_table_show(struct device *dev, ...@@ -2245,9 +2247,8 @@ static ssize_t port0_lun_table_show(struct device *dev,
char *buf) char *buf)
{ {
struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev)); struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev));
struct afu *afu = cfg->afu;
return cxlflash_show_port_lun_table(0, afu, buf); return cxlflash_show_port_lun_table(0, cfg, buf);
} }
/** /**
...@@ -2263,9 +2264,8 @@ static ssize_t port1_lun_table_show(struct device *dev, ...@@ -2263,9 +2264,8 @@ static ssize_t port1_lun_table_show(struct device *dev,
char *buf) char *buf)
{ {
struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev)); struct cxlflash_cfg *cfg = shost_priv(class_to_shost(dev));
struct afu *afu = cfg->afu;
return cxlflash_show_port_lun_table(1, afu, buf); return cxlflash_show_port_lun_table(1, cfg, buf);
} }
/** /**
......
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