Commit f363b943 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[SCSI] qla2xxx: Use shost_priv().

Drop usage of legacy to_qla_host() macro.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent e745759a
...@@ -18,7 +18,7 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj, ...@@ -18,7 +18,7 @@ qla2x00_sysfs_read_fw_dump(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
char *rbuf = (char *)ha->fw_dump; char *rbuf = (char *)ha->fw_dump;
...@@ -39,7 +39,7 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, ...@@ -39,7 +39,7 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
int reading; int reading;
...@@ -89,7 +89,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, ...@@ -89,7 +89,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
int size = ha->nvram_size; int size = ha->nvram_size;
char *nvram_cache = ha->nvram; char *nvram_cache = ha->nvram;
...@@ -112,7 +112,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, ...@@ -112,7 +112,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
unsigned long flags; unsigned long flags;
uint16_t cnt; uint16_t cnt;
...@@ -170,7 +170,7 @@ qla2x00_sysfs_read_optrom(struct kobject *kobj, ...@@ -170,7 +170,7 @@ qla2x00_sysfs_read_optrom(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
if (ha->optrom_state != QLA_SREADING) if (ha->optrom_state != QLA_SREADING)
...@@ -190,7 +190,7 @@ qla2x00_sysfs_write_optrom(struct kobject *kobj, ...@@ -190,7 +190,7 @@ qla2x00_sysfs_write_optrom(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
if (ha->optrom_state != QLA_SWRITING) if (ha->optrom_state != QLA_SWRITING)
...@@ -220,7 +220,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, ...@@ -220,7 +220,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
uint32_t start = 0; uint32_t start = 0;
uint32_t size = ha->optrom_size; uint32_t size = ha->optrom_size;
...@@ -372,7 +372,7 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, ...@@ -372,7 +372,7 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
int size = ha->vpd_size; int size = ha->vpd_size;
char *vpd_cache = ha->vpd; char *vpd_cache = ha->vpd;
...@@ -395,7 +395,7 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, ...@@ -395,7 +395,7 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
unsigned long flags; unsigned long flags;
...@@ -426,7 +426,7 @@ qla2x00_sysfs_read_sfp(struct kobject *kobj, ...@@ -426,7 +426,7 @@ qla2x00_sysfs_read_sfp(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj, struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj))); struct device, kobj)));
uint16_t iter, addr, offset; uint16_t iter, addr, offset;
int rval; int rval;
...@@ -531,7 +531,7 @@ qla2x00_drvr_version_show(struct class_device *cdev, char *buf) ...@@ -531,7 +531,7 @@ qla2x00_drvr_version_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_fw_version_show(struct class_device *cdev, char *buf) qla2x00_fw_version_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
char fw_str[30]; char fw_str[30];
return snprintf(buf, PAGE_SIZE, "%s\n", return snprintf(buf, PAGE_SIZE, "%s\n",
...@@ -541,7 +541,7 @@ qla2x00_fw_version_show(struct class_device *cdev, char *buf) ...@@ -541,7 +541,7 @@ qla2x00_fw_version_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_serial_num_show(struct class_device *cdev, char *buf) qla2x00_serial_num_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
uint32_t sn; uint32_t sn;
sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1;
...@@ -552,14 +552,14 @@ qla2x00_serial_num_show(struct class_device *cdev, char *buf) ...@@ -552,14 +552,14 @@ qla2x00_serial_num_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_isp_name_show(struct class_device *cdev, char *buf) qla2x00_isp_name_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "ISP%04X\n", ha->pdev->device); return snprintf(buf, PAGE_SIZE, "ISP%04X\n", ha->pdev->device);
} }
static ssize_t static ssize_t
qla2x00_isp_id_show(struct class_device *cdev, char *buf) qla2x00_isp_id_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%04x %04x %04x %04x\n", return snprintf(buf, PAGE_SIZE, "%04x %04x %04x %04x\n",
ha->product_id[0], ha->product_id[1], ha->product_id[2], ha->product_id[0], ha->product_id[1], ha->product_id[2],
ha->product_id[3]); ha->product_id[3]);
...@@ -568,14 +568,14 @@ qla2x00_isp_id_show(struct class_device *cdev, char *buf) ...@@ -568,14 +568,14 @@ qla2x00_isp_id_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_model_name_show(struct class_device *cdev, char *buf) qla2x00_model_name_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%s\n", ha->model_number); return snprintf(buf, PAGE_SIZE, "%s\n", ha->model_number);
} }
static ssize_t static ssize_t
qla2x00_model_desc_show(struct class_device *cdev, char *buf) qla2x00_model_desc_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%s\n", return snprintf(buf, PAGE_SIZE, "%s\n",
ha->model_desc ? ha->model_desc: ""); ha->model_desc ? ha->model_desc: "");
} }
...@@ -583,7 +583,7 @@ qla2x00_model_desc_show(struct class_device *cdev, char *buf) ...@@ -583,7 +583,7 @@ qla2x00_model_desc_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_pci_info_show(struct class_device *cdev, char *buf) qla2x00_pci_info_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
char pci_info[30]; char pci_info[30];
return snprintf(buf, PAGE_SIZE, "%s\n", return snprintf(buf, PAGE_SIZE, "%s\n",
...@@ -593,7 +593,7 @@ qla2x00_pci_info_show(struct class_device *cdev, char *buf) ...@@ -593,7 +593,7 @@ qla2x00_pci_info_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_state_show(struct class_device *cdev, char *buf) qla2x00_state_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
int len = 0; int len = 0;
if (atomic_read(&ha->loop_state) == LOOP_DOWN || if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
...@@ -631,7 +631,7 @@ qla2x00_state_show(struct class_device *cdev, char *buf) ...@@ -631,7 +631,7 @@ qla2x00_state_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_zio_show(struct class_device *cdev, char *buf) qla2x00_zio_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
int len = 0; int len = 0;
switch (ha->zio_mode) { switch (ha->zio_mode) {
...@@ -648,7 +648,7 @@ qla2x00_zio_show(struct class_device *cdev, char *buf) ...@@ -648,7 +648,7 @@ qla2x00_zio_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count) qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
int val = 0; int val = 0;
uint16_t zio_mode; uint16_t zio_mode;
...@@ -674,7 +674,7 @@ qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count) ...@@ -674,7 +674,7 @@ qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count)
static ssize_t static ssize_t
qla2x00_zio_timer_show(struct class_device *cdev, char *buf) qla2x00_zio_timer_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%d us\n", ha->zio_timer * 100); return snprintf(buf, PAGE_SIZE, "%d us\n", ha->zio_timer * 100);
} }
...@@ -683,7 +683,7 @@ static ssize_t ...@@ -683,7 +683,7 @@ static ssize_t
qla2x00_zio_timer_store(struct class_device *cdev, const char *buf, qla2x00_zio_timer_store(struct class_device *cdev, const char *buf,
size_t count) size_t count)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
int val = 0; int val = 0;
uint16_t zio_timer; uint16_t zio_timer;
...@@ -701,7 +701,7 @@ qla2x00_zio_timer_store(struct class_device *cdev, const char *buf, ...@@ -701,7 +701,7 @@ qla2x00_zio_timer_store(struct class_device *cdev, const char *buf,
static ssize_t static ssize_t
qla2x00_beacon_show(struct class_device *cdev, char *buf) qla2x00_beacon_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
int len = 0; int len = 0;
if (ha->beacon_blink_led) if (ha->beacon_blink_led)
...@@ -715,7 +715,7 @@ static ssize_t ...@@ -715,7 +715,7 @@ static ssize_t
qla2x00_beacon_store(struct class_device *cdev, const char *buf, qla2x00_beacon_store(struct class_device *cdev, const char *buf,
size_t count) size_t count)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
int val = 0; int val = 0;
int rval; int rval;
...@@ -745,7 +745,7 @@ qla2x00_beacon_store(struct class_device *cdev, const char *buf, ...@@ -745,7 +745,7 @@ qla2x00_beacon_store(struct class_device *cdev, const char *buf,
static ssize_t static ssize_t
qla2x00_optrom_bios_version_show(struct class_device *cdev, char *buf) qla2x00_optrom_bios_version_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1], return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1],
ha->bios_revision[0]); ha->bios_revision[0]);
...@@ -754,7 +754,7 @@ qla2x00_optrom_bios_version_show(struct class_device *cdev, char *buf) ...@@ -754,7 +754,7 @@ qla2x00_optrom_bios_version_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_optrom_efi_version_show(struct class_device *cdev, char *buf) qla2x00_optrom_efi_version_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1], return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1],
ha->efi_revision[0]); ha->efi_revision[0]);
...@@ -763,7 +763,7 @@ qla2x00_optrom_efi_version_show(struct class_device *cdev, char *buf) ...@@ -763,7 +763,7 @@ qla2x00_optrom_efi_version_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_optrom_fcode_version_show(struct class_device *cdev, char *buf) qla2x00_optrom_fcode_version_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1], return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1],
ha->fcode_revision[0]); ha->fcode_revision[0]);
...@@ -772,7 +772,7 @@ qla2x00_optrom_fcode_version_show(struct class_device *cdev, char *buf) ...@@ -772,7 +772,7 @@ qla2x00_optrom_fcode_version_show(struct class_device *cdev, char *buf)
static ssize_t static ssize_t
qla2x00_optrom_fw_version_show(struct class_device *cdev, char *buf) qla2x00_optrom_fw_version_show(struct class_device *cdev, char *buf)
{ {
scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev)); scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d %d\n", return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d %d\n",
ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2], ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2],
...@@ -829,7 +829,7 @@ struct class_device_attribute *qla2x00_host_attrs[] = { ...@@ -829,7 +829,7 @@ struct class_device_attribute *qla2x00_host_attrs[] = {
static void static void
qla2x00_get_host_port_id(struct Scsi_Host *shost) qla2x00_get_host_port_id(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
fc_host_port_id(shost) = ha->d_id.b.domain << 16 | fc_host_port_id(shost) = ha->d_id.b.domain << 16 |
ha->d_id.b.area << 8 | ha->d_id.b.al_pa; ha->d_id.b.area << 8 | ha->d_id.b.al_pa;
...@@ -838,7 +838,7 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost) ...@@ -838,7 +838,7 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost)
static void static void
qla2x00_get_host_speed(struct Scsi_Host *shost) qla2x00_get_host_speed(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
uint32_t speed = 0; uint32_t speed = 0;
switch (ha->link_data_rate) { switch (ha->link_data_rate) {
...@@ -858,7 +858,7 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) ...@@ -858,7 +858,7 @@ qla2x00_get_host_speed(struct Scsi_Host *shost)
static void static void
qla2x00_get_host_port_type(struct Scsi_Host *shost) qla2x00_get_host_port_type(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
uint32_t port_type = FC_PORTTYPE_UNKNOWN; uint32_t port_type = FC_PORTTYPE_UNKNOWN;
switch (ha->current_topology) { switch (ha->current_topology) {
...@@ -882,7 +882,7 @@ static void ...@@ -882,7 +882,7 @@ static void
qla2x00_get_starget_node_name(struct scsi_target *starget) qla2x00_get_starget_node_name(struct scsi_target *starget)
{ {
struct Scsi_Host *host = dev_to_shost(starget->dev.parent); struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
scsi_qla_host_t *ha = to_qla_host(host); scsi_qla_host_t *ha = shost_priv(host);
fc_port_t *fcport; fc_port_t *fcport;
u64 node_name = 0; u64 node_name = 0;
...@@ -900,7 +900,7 @@ static void ...@@ -900,7 +900,7 @@ static void
qla2x00_get_starget_port_name(struct scsi_target *starget) qla2x00_get_starget_port_name(struct scsi_target *starget)
{ {
struct Scsi_Host *host = dev_to_shost(starget->dev.parent); struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
scsi_qla_host_t *ha = to_qla_host(host); scsi_qla_host_t *ha = shost_priv(host);
fc_port_t *fcport; fc_port_t *fcport;
u64 port_name = 0; u64 port_name = 0;
...@@ -918,7 +918,7 @@ static void ...@@ -918,7 +918,7 @@ static void
qla2x00_get_starget_port_id(struct scsi_target *starget) qla2x00_get_starget_port_id(struct scsi_target *starget)
{ {
struct Scsi_Host *host = dev_to_shost(starget->dev.parent); struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
scsi_qla_host_t *ha = to_qla_host(host); scsi_qla_host_t *ha = shost_priv(host);
fc_port_t *fcport; fc_port_t *fcport;
uint32_t port_id = ~0U; uint32_t port_id = ~0U;
...@@ -937,7 +937,7 @@ static void ...@@ -937,7 +937,7 @@ static void
qla2x00_get_rport_loss_tmo(struct fc_rport *rport) qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
{ {
struct Scsi_Host *host = rport_to_shost(rport); struct Scsi_Host *host = rport_to_shost(rport);
scsi_qla_host_t *ha = to_qla_host(host); scsi_qla_host_t *ha = shost_priv(host);
rport->dev_loss_tmo = ha->port_down_retry_count + 5; rport->dev_loss_tmo = ha->port_down_retry_count + 5;
} }
...@@ -946,7 +946,7 @@ static void ...@@ -946,7 +946,7 @@ static void
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
{ {
struct Scsi_Host *host = rport_to_shost(rport); struct Scsi_Host *host = rport_to_shost(rport);
scsi_qla_host_t *ha = to_qla_host(host); scsi_qla_host_t *ha = shost_priv(host);
if (timeout) if (timeout)
ha->port_down_retry_count = timeout; ha->port_down_retry_count = timeout;
...@@ -959,7 +959,7 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) ...@@ -959,7 +959,7 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
static int static int
qla2x00_issue_lip(struct Scsi_Host *shost) qla2x00_issue_lip(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
set_bit(LOOP_RESET_NEEDED, &ha->dpc_flags); set_bit(LOOP_RESET_NEEDED, &ha->dpc_flags);
return 0; return 0;
...@@ -968,7 +968,7 @@ qla2x00_issue_lip(struct Scsi_Host *shost) ...@@ -968,7 +968,7 @@ qla2x00_issue_lip(struct Scsi_Host *shost)
static struct fc_host_statistics * static struct fc_host_statistics *
qla2x00_get_fc_host_stats(struct Scsi_Host *shost) qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
int rval; int rval;
uint16_t mb_stat[1]; uint16_t mb_stat[1];
link_stat_t stat_buf; link_stat_t stat_buf;
...@@ -1006,7 +1006,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) ...@@ -1006,7 +1006,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
static void static void
qla2x00_get_host_symbolic_name(struct Scsi_Host *shost) qla2x00_get_host_symbolic_name(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
qla2x00_get_sym_node_name(ha, fc_host_symbolic_name(shost)); qla2x00_get_sym_node_name(ha, fc_host_symbolic_name(shost));
} }
...@@ -1014,7 +1014,7 @@ qla2x00_get_host_symbolic_name(struct Scsi_Host *shost) ...@@ -1014,7 +1014,7 @@ qla2x00_get_host_symbolic_name(struct Scsi_Host *shost)
static void static void
qla2x00_set_host_system_hostname(struct Scsi_Host *shost) qla2x00_set_host_system_hostname(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags);
} }
...@@ -1022,7 +1022,7 @@ qla2x00_set_host_system_hostname(struct Scsi_Host *shost) ...@@ -1022,7 +1022,7 @@ qla2x00_set_host_system_hostname(struct Scsi_Host *shost)
static void static void
qla2x00_get_host_fabric_name(struct Scsi_Host *shost) qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
u64 node_name; u64 node_name;
if (ha->device_flags & SWITCH_FOUND) if (ha->device_flags & SWITCH_FOUND)
...@@ -1036,7 +1036,7 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost) ...@@ -1036,7 +1036,7 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
static void static void
qla2x00_get_host_port_state(struct Scsi_Host *shost) qla2x00_get_host_port_state(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = to_qla_host(shost); scsi_qla_host_t *ha = shost_priv(shost);
if (!ha->flags.online) if (!ha->flags.online)
fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE; fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
...@@ -1050,7 +1050,7 @@ static int ...@@ -1050,7 +1050,7 @@ static int
qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
{ {
int ret = 0; int ret = 0;
scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
scsi_qla_host_t *vha; scsi_qla_host_t *vha;
ret = qla24xx_vport_create_req_sanity_check(fc_vport); ret = qla24xx_vport_create_req_sanity_check(fc_vport);
...@@ -1119,7 +1119,7 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -1119,7 +1119,7 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
int int
qla24xx_vport_delete(struct fc_vport *fc_vport) qla24xx_vport_delete(struct fc_vport *fc_vport)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
scsi_qla_host_t *vha = fc_vport->dd_data; scsi_qla_host_t *vha = fc_vport->dd_data;
qla24xx_disable_vp(vha); qla24xx_disable_vp(vha);
......
...@@ -1402,7 +1402,7 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) ...@@ -1402,7 +1402,7 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
struct scsi_qla_host *ha; struct scsi_qla_host *ha;
srb_t *sp; srb_t *sp;
ha = (struct scsi_qla_host *)cmd->device->host->hostdata; ha = shost_priv(cmd->device->host);
sp = (srb_t *) cmd->SCp.ptr; sp = (srb_t *) cmd->SCp.ptr;
printk("SCSI Command @=0x%p, Handle=0x%p\n", cmd, cmd->host_scribble); printk("SCSI Command @=0x%p, Handle=0x%p\n", cmd, cmd->host_scribble);
......
...@@ -2545,8 +2545,6 @@ typedef struct scsi_qla_host { ...@@ -2545,8 +2545,6 @@ typedef struct scsi_qla_host {
test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \
atomic_read(&ha->loop_state) == LOOP_DOWN) atomic_read(&ha->loop_state) == LOOP_DOWN)
#define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata)
#define qla_printk(level, ha, format, arg...) \ #define qla_printk(level, ha, format, arg...) \
dev_printk(level , &((ha)->pdev->dev) , format , ## arg) dev_printk(level , &((ha)->pdev->dev) , format , ## arg)
......
...@@ -363,7 +363,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *ha) ...@@ -363,7 +363,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *ha)
int int
qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport) qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
scsi_qla_host_t *vha; scsi_qla_host_t *vha;
uint8_t port_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE];
...@@ -397,7 +397,7 @@ qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport) ...@@ -397,7 +397,7 @@ qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport)
scsi_qla_host_t * scsi_qla_host_t *
qla24xx_create_vhost(struct fc_vport *fc_vport) qla24xx_create_vhost(struct fc_vport *fc_vport)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
scsi_qla_host_t *vha; scsi_qla_host_t *vha;
struct Scsi_Host *host; struct Scsi_Host *host;
...@@ -409,7 +409,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport) ...@@ -409,7 +409,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
return(NULL); return(NULL);
} }
vha = (scsi_qla_host_t *)host->hostdata; vha = shost_priv(host);
/* clone the parent hba */ /* clone the parent hba */
memcpy(vha, ha, sizeof (scsi_qla_host_t)); memcpy(vha, ha, sizeof (scsi_qla_host_t));
......
...@@ -379,7 +379,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *ha, fc_port_t *fcport, ...@@ -379,7 +379,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *ha, fc_port_t *fcport,
static int static int
qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device)); struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device));
srb_t *sp; srb_t *sp;
...@@ -445,7 +445,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -445,7 +445,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
static int static int
qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device)); struct fc_rport *rport = starget_to_rport(scsi_target(cmd->device));
srb_t *sp; srb_t *sp;
...@@ -663,7 +663,7 @@ qla2x00_block_error_handler(struct scsi_cmnd *cmnd) ...@@ -663,7 +663,7 @@ qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
static int static int
qla2xxx_eh_abort(struct scsi_cmnd *cmd) qla2xxx_eh_abort(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
srb_t *sp; srb_t *sp;
int ret, i; int ret, i;
unsigned int id, lun; unsigned int id, lun;
...@@ -803,7 +803,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t) ...@@ -803,7 +803,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
static int static int
qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
int ret = FAILED; int ret = FAILED;
unsigned int id, lun; unsigned int id, lun;
...@@ -932,7 +932,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha) ...@@ -932,7 +932,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
static int static int
qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd) qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
scsi_qla_host_t *pha = to_qla_parent(ha); scsi_qla_host_t *pha = to_qla_parent(ha);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
int ret = FAILED; int ret = FAILED;
...@@ -992,7 +992,7 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd) ...@@ -992,7 +992,7 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
static int static int
qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *ha = to_qla_host(cmd->device->host); scsi_qla_host_t *ha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
int ret = FAILED; int ret = FAILED;
unsigned int id, lun; unsigned int id, lun;
...@@ -1142,7 +1142,7 @@ qla2xxx_slave_alloc(struct scsi_device *sdev) ...@@ -1142,7 +1142,7 @@ qla2xxx_slave_alloc(struct scsi_device *sdev)
static int static int
qla2xxx_slave_configure(struct scsi_device *sdev) qla2xxx_slave_configure(struct scsi_device *sdev)
{ {
scsi_qla_host_t *ha = to_qla_host(sdev->host); scsi_qla_host_t *ha = shost_priv(sdev->host);
struct fc_rport *rport = starget_to_rport(sdev->sdev_target); struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
if (sdev->tagged_supported) if (sdev->tagged_supported)
...@@ -1543,7 +1543,7 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) ...@@ -1543,7 +1543,7 @@ qla2x00_iospace_config(scsi_qla_host_t *ha)
static void static void
qla2xxx_scan_start(struct Scsi_Host *shost) qla2xxx_scan_start(struct Scsi_Host *shost)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; scsi_qla_host_t *ha = shost_priv(shost);
set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
...@@ -1553,7 +1553,7 @@ qla2xxx_scan_start(struct Scsi_Host *shost) ...@@ -1553,7 +1553,7 @@ qla2xxx_scan_start(struct Scsi_Host *shost)
static int static int
qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time) qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time)
{ {
scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; scsi_qla_host_t *ha = shost_priv(shost);
if (!ha->host) if (!ha->host)
return 1; return 1;
...@@ -1600,7 +1600,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1600,7 +1600,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
} }
/* Clear our data area */ /* Clear our data area */
ha = (scsi_qla_host_t *)host->hostdata; ha = shost_priv(host);
memset(ha, 0, sizeof(scsi_qla_host_t)); memset(ha, 0, sizeof(scsi_qla_host_t));
ha->pdev = pdev; ha->pdev = pdev;
......
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